[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-guile 190290b 213/284: Guile: fixes for documentati
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-guile 190290b 213/284: Guile: fixes for documentation display |
Date: |
Sun, 1 Aug 2021 18:29:47 -0400 (EDT) |
branch: elpa/geiser-guile
commit 190290b181a713d804a003d503a2d8c98e573b03
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
Guile: fixes for documentation display
We put the value of the identifier where it belongs, and add a missing
period. Works, but geiser/doc.scm is in sore need of a refactoring.
---
geiser/doc.scm | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/geiser/doc.scm b/geiser/doc.scm
index 345febd..640f4ad 100644
--- a/geiser/doc.scm
+++ b/geiser/doc.scm
@@ -29,7 +29,7 @@
'()
(map (lambda (id) (or (autodoc* id) (list id))) ids)))
-(define (autodoc* id)
+(define* (autodoc* id)
(let ((args (obj-args (symbol->object id))))
(and args
`(,@(signature id args)
@@ -39,7 +39,10 @@
(let ((args (obj-args obj)))
(and args (signature name args))))
-(define (signature id args-list)
+(define (value-str obj)
+ (format #f "~:@y" obj))
+
+(define* (signature id args-list #:optional (detail #t))
(define (arglst args kind)
(let ((args (assq-ref args kind)))
(cond ((or (not args) (null? args)) '())
@@ -52,10 +55,9 @@
(if rest (list "...") '())))
(key ,@(arglst as 'keyword))))
(let* ((args-list (map mkargs (if (list? args-list) args-list '())))
- (value (if (null? args-list)
- (format #f "~:@y" (symbol->object id))
- "")))
- (list id (cons 'args args-list) (cons 'value value))))
+ (value (and (and detail (null? args-list))
+ (value-str (symbol->object id)))))
+ `(,id (args ,@args-list) ,@(if value `((value . ,value)) '()))))
(define default-macro-args '(((required ...))))
@@ -184,10 +186,12 @@
(define (symbol-documentation sym)
(let ((obj (symbol->object sym)))
(if obj
- `((signature . ,(or (obj-signature sym obj) sym))
+ `((signature . ,(or (obj-signature sym obj #f) sym))
(docstring . ,(docstring sym obj))))))
(define (docstring sym obj)
+ (define (valuable?)
+ (not (or (macro? obj) (procedure? obj) (program? obj))))
(with-output-to-string
(lambda ()
(let* ((type (cond ((macro? obj) "A macro")
@@ -200,13 +204,19 @@
(if modname
(begin
(display " in module ")
- (display modname)))
+ (display modname)
+ (display ".")))
(newline)
- (if doc (begin (newline) (display doc)))))))
-
-(define (obj-signature sym obj)
+ (if doc (begin (newline) (display doc)))
+ (if (valuable?) (begin (newline)
+ (display "Value:")
+ (newline)
+ (display " ")
+ (display (value-str obj))))))))
+
+(define* (obj-signature sym obj #:optional (detail #t))
(let ((args (obj-args obj)))
- (and args (signature sym args))))
+ (and args (signature sym args detail))))
(define (module-exports mod-name)
(define elt-sort (make-symbol-sort car))
- [nongnu] elpa/geiser-guile 700ac98 282/284: Use new implementation extension declarator., (continued)
- [nongnu] elpa/geiser-guile 700ac98 282/284: Use new implementation extension declarator., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 5e2c874 139/284: Golfing., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 06d7cf5 144/284: Guile: taking advantage of the patterns property in macro transformers., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 3a80209 164/284: Guile: evaluation warnings, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 7563473 167/284: Guile: configurable warning level, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 17ebbec 183/284: Autodoc: fix for improper macro arglists scanning, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 04fd67f 185/284: Always fallback to edit-module in M-., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile cd2cfae 190/284: Guile: better meta-command args handling, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile c8dcc24 202/284: Make do with a single connection, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile fef0d8a 209/284: Document browser improvements, and Racket using them, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 190290b 213/284: Guile: fixes for documentation display,
Philip Kaludercic <=
- [nongnu] elpa/geiser-guile 6d69176 216/284: No more interning in the scheme reader, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile b9a8980 224/284: Guile: what if i do what i meant to do?, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d6fca59 232/284: guile: lambda* indentation, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 15af81d 247/284: Add 'geiser-syntax--simple-keywords', Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 362354d 241/284: Indent Guile's `with-mutex', Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 9fb965f 251/284: Add more highlighting/indentation for Guile, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile be00e7a 261/284: guile: fix manual symbol lookup., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile e975e10 263/284: guile 2.2: program-arities and program-module reloaded, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile f6f254f 262/284: guile 2.2: program-arities and program-module reloaded, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile f23e075 265/284: Guile: use load paths defined in dir-local variables (fixes #268), Philip Kaludercic, 2021/08/01