diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-10 17:11:45 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-10 17:11:45 +0100 |
commit | 6bc5dce3118a78e2665bbf981dc61866329269c1 (patch) | |
tree | 0b0f77490c888806fd6216ef57cb3668285525ae /elisp/geiser-autodoc.el | |
parent | 710d1f8be59066f0b52d07b0f43343b3ab671ffa (diff) | |
download | geiser-guile-6bc5dce3118a78e2665bbf981dc61866329269c1.tar.gz geiser-guile-6bc5dce3118a78e2665bbf981dc61866329269c1.tar.bz2 |
Multi-level form arity recognition in autodoc.
Diffstat (limited to 'elisp/geiser-autodoc.el')
-rw-r--r-- | elisp/geiser-autodoc.el | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/elisp/geiser-autodoc.el b/elisp/geiser-autodoc.el index 2d286ff..f5db63b 100644 --- a/elisp/geiser-autodoc.el +++ b/elisp/geiser-autodoc.el @@ -70,8 +70,7 @@ when `geiser-autodoc-display-module-p' is on." (defun geiser-autodoc--function-args (fun) (if (eq fun (car geiser-autodoc--last)) (cdr geiser-autodoc--last) - (let* ((cmd `(:gs ((:ge proc-args) ',fun))) - (result (geiser-eval--retort-result (geiser-eval--send/wait cmd)))) + (let ((result (geiser-eval--send/result `(:gs ((:ge proc-args) ',fun))))) (when (not (listp result)) (setq result 'undefined)) (setq geiser-autodoc--last (cons fun result)) result))) @@ -79,7 +78,9 @@ when `geiser-autodoc-display-module-p' is on." (defun geiser-autodoc--insert (sym current pos) (let ((str (format "%s" sym))) (when (= current pos) - (put-text-property 0 (length str) 'face 'geiser-font-lock-autodoc-current-arg str)) + (put-text-property 0 (length str) + 'face 'geiser-font-lock-autodoc-current-arg + str)) (insert str))) (defun geiser-autodoc--fun-args-str (fun args pos) @@ -87,8 +88,11 @@ when `geiser-autodoc-display-module-p' is on." (set-buffer (geiser-syntax--font-lock-buffer)) (erase-buffer) (let* ((current 0) - (module (and geiser-autodoc-display-module-p (cdr (assoc 'module args)))) - (fun (if module (format geiser-autodoc-procedure-name-format module fun) fun))) + (module (and geiser-autodoc-display-module-p + (cdr (assoc 'module args)))) + (fun (if module + (format geiser-autodoc-procedure-name-format module fun) + fun))) (insert "(") (geiser-autodoc--insert fun current pos) (dolist (arg (cdr (assoc 'required args))) @@ -107,13 +111,13 @@ when `geiser-autodoc-display-module-p' is on." ;;; Autodoc function: (defun geiser-autodoc--eldoc-function () - (let* ((f/a (geiser-syntax--enclosing-form-data)) - (fun (car f/a)) - (arg-no (cdr f/a))) - (when fun - (let ((args (geiser-autodoc--function-args fun))) - (when (listp args) - (geiser-autodoc--fun-args-str fun args arg-no)))))) + (let ((data (geiser-syntax--enclosing-form-data))) + (catch 'doc-msg + (dolist (f/a data) + (let ((args (geiser-autodoc--function-args (car f/a)))) + (when (listp args) + (throw 'doc-msg + (geiser-autodoc--fun-args-str (car f/a) args (cdr f/a))))))))) ;;; Autodoc mode: |