[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-guile 75df3b1 024/284: Better symbol documentation.
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-guile 75df3b1 024/284: Better symbol documentation. |
Date: |
Sun, 1 Aug 2021 18:29:09 -0400 (EDT) |
branch: elpa/geiser-guile
commit 75df3b13501f2ccfc9ec8c7408795e5e8d5d067e
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
Better symbol documentation.
---
geiser/emacs.scm | 2 +-
geiser/introspection.scm | 54 ++++++++++++++++++++++++------------------------
2 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/geiser/emacs.scm b/geiser/emacs.scm
index b5ba284..36428f9 100644
--- a/geiser/emacs.scm
+++ b/geiser/emacs.scm
@@ -30,7 +30,7 @@
ge:symbol-location
ge:compile-file
ge:load-file
- ge:docstring
+ ge:symbol-documentation
ge:all-modules
ge:module-children
ge:module-location)
diff --git a/geiser/introspection.scm b/geiser/introspection.scm
index 2021a32..5d86d62 100644
--- a/geiser/introspection.scm
+++ b/geiser/introspection.scm
@@ -28,7 +28,7 @@
#:export (arguments
completions
symbol-location
- docstring
+ symbol-documentation
all-modules
module-children
module-location)
@@ -128,34 +128,34 @@
(define module-filename (@@ (ice-9 session) module-filename))
-(define (display-docstring sym)
+(define (docstring sym obj)
+ (with-output-to-string
+ (lambda ()
+ (let* ((type (cond ((macro? obj) "A macro")
+ ((procedure? obj) "A procedure")
+ ((program? obj) "A compiled program")
+ (else "An object")))
+ (modname (symbol-module sym))
+ (doc (object-documentation obj)))
+ (display type)
+ (if modname
+ (begin
+ (display " in module ")
+ (display modname)))
+ (newline)
+ (if doc (display doc))))))
+
+(define (obj-signature sym obj)
+ (let* ((args (obj-args obj))
+ (req (and args (car args)))
+ (opt (and args (cadr args))))
+ (and args (if (not opt) `(,sym ,@req) `(,sym ,@req . ,opt)) sym)))
+
+(define (symbol-documentation sym)
(let ((obj (symbol->obj sym)))
(if obj
- (let* ((args (obj-args obj))
- (req (and args (car args)))
- (opt (and args (cadr args)))
- (signature (if args
- (if (not opt) `(,sym ,@req) `(,sym ,@req . ,opt))
- sym))
- (type (cond ((macro? obj) "A macro")
- ((procedure? obj) "A procedure")
- ((program? obj) "A compiled program")
- (else "An object")))
- (modname (symbol-module sym))
- (doc (object-documentation obj)))
- (display signature)
- (newline)
- (display type)
- (if modname
- (begin
- (display " in module ")
- (display modname)))
- (newline)
- (if doc (display doc))))))
-
-(define (docstring sym)
- (with-output-to-string
- (lambda () (display-docstring sym))))
+ `((signature . ,(or (obj-signature sym obj) sym))
+ (docstring . ,(docstring sym obj))))))
(define (all-modules)
(let ((roots ((@@ (ice-9 session) root-modules))))
- [nongnu] elpa/geiser-guile f857023 007/284: Edit symbol at point for programs., (continued)
- [nongnu] elpa/geiser-guile f857023 007/284: Edit symbol at point for programs., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d0f98a7 036/284: Simpler handling of rest args in Emacs' side., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 221e64e 042/284: Some refactoring and new ge:macroexpand., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d69ca12 044/284: Autodoc support for GOOPS methods., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 4d48077 046/284: Fix recursive require. Nicer arg names in autodoc., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 5be0195 049/284: Cache arguments parsed from documentation; don't treat quasiquote as a function., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 6ff9936 052/284: They say call/cc is slow in Guile., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile a96b437 053/284: turn-on/off-geiser-mode commands added and used in scheme-mode-hook., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d71825c 058/284: Small bug fix., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile fe48642 008/284: M-. working for any symbol whose module can be located., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 75df3b1 024/284: Better symbol documentation.,
Philip Kaludercic <=
- [nongnu] elpa/geiser-guile 8cb76f1 045/284: Breakdown of schemeland into neat submodules., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 7b77380 054/284: New command to display generic methods (C-cC-dg) implemented., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 33b8c53 066/284: Callers/callees (C-c <, C-c >)., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 3398bc2 012/284: Inconsequential refactorings., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile af1c5a3 013/284: Small improvements., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile a461795 017/284: Better docstring., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 6f2ed87 018/284: Recognise empty doc string in Emacs side. Small refactorings., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 63c39be 019/284: Initial support for module name completion., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 06fabb2 020/284: Compile command adapted to new compiled-file-name behaviour., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 3432ccf 021/284: New command: module documentation., Philip Kaludercic, 2021/08/01