diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-21 01:56:02 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-21 01:56:02 +0100 |
commit | 67bf9186531f919ce92d5099e3949d527d605f79 (patch) | |
tree | 20c33696f776fc3fcc1c631d2f8d1e78e80c43c8 | |
parent | b2b79169a4a7fab4de2f0337f5c850421a3ad3a0 (diff) | |
download | geiser-67bf9186531f919ce92d5099e3949d527d605f79.tar.gz geiser-67bf9186531f919ce92d5099e3949d527d605f79.tar.bz2 |
Better module help
We now display procedure signatures in module help, and keep a cache
in Guile, using procedure properties.
-rw-r--r-- | doc/img/repl-mod.png | bin | 17604 -> 29938 bytes | |||
-rw-r--r-- | elisp/geiser-doc.el | 32 |
2 files changed, 20 insertions, 12 deletions
diff --git a/doc/img/repl-mod.png b/doc/img/repl-mod.png Binary files differindex a2dcb10..9814b7e 100644 --- a/doc/img/repl-mod.png +++ b/doc/img/repl-mod.png diff --git a/elisp/geiser-doc.el b/elisp/geiser-doc.el index 7d42ce5..b95242c 100644 --- a/elisp/geiser-doc.el +++ b/elisp/geiser-doc.el @@ -122,19 +122,22 @@ (define-button-type 'geiser-doc--button 'action 'geiser-doc--button-action - 'face 'geiser-font-lock-doc-link 'follow-link t) -(defun geiser-doc--insert-button (target module impl) +(defun geiser-doc--insert-button (target module impl &optional sign) (let ((link (geiser-doc--make-link target module impl)) - (text (format "%s" (or target module))) + (text (format "%s" (or (and sign (geiser-autodoc--str* sign)) + target + module))) (help (format "%smodule %s" (if target (format "%s in " target) "") (or module "<unknown>")))) - (insert-text-button text - :type 'geiser-doc--button - 'geiser-link link - 'help-echo help))) + (apply 'insert-text-button + `(,text + :type geiser-doc--button + ,@(and (not sign) (list 'face 'geiser-font-lock-doc-link)) + geiser-link ,link + help-echo ,help)))) (defun geiser-doc--xbutton-action (button) (when geiser-doc--buffer-link @@ -183,7 +186,7 @@ (insert (format "%s" title)) (insert "(" (format "%s" (car title))) (dolist (a (cdr title)) - (insert " " (if (eq a '\#:rest) "." (format "%s" a)))) + (insert " " (if (eq a :rest) "." (format "%s" a)))) (insert ")")) (put-text-property p (point) 'face 'geiser-font-lock-doc-title) (when top @@ -199,11 +202,12 @@ (geiser-doc--insert-title title) (newline) (dolist (w lst) - (let ((name (if (listp w) (car w) w)) - (info (and (listp w) (cdr w)))) + (let ((name (car w)) + (signature (cdr (assoc 'signature w))) + (info (cdr (assoc 'info w)))) (insert (format "\t- ")) (if module - (geiser-doc--insert-button name module impl) + (geiser-doc--insert-button name module impl signature) (geiser-doc--insert-button nil name impl)) (when info (insert (format " %s" info))) (newline))) @@ -262,7 +266,10 @@ With prefix argument, ask for symbol (with completion)." "Display information about a given module." (interactive) (let* ((module (or module (geiser-completion--read-module))) - (exports (geiser-doc--get-module-exports module)) + (msg (format "Retrieving documentation for %s ..." module)) + (exports (progn + (message "%s" msg) + (geiser-doc--get-module-exports module))) (impl (or impl geiser-impl--implementation))) (if (not exports) (message "No information available for %s" module) @@ -286,6 +293,7 @@ With prefix argument, ask for symbol (with completion)." (geiser-doc--make-link nil module impl))) (geiser-doc--insert-footer) (goto-char (point-min))) + (message "%s done" msg) (geiser-doc--pop-to-buffer)))) (defun geiser-doc-next (&optional forget-current) |