diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-28 04:35:45 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-28 04:35:45 +0100 |
commit | 9186ce41aabe30f6242fcfc32d80c21e4f63d4d5 (patch) | |
tree | e0471ca78c5f4a6d9287b7553f0730ffc86f4c3a /elisp/geiser-autodoc.el | |
parent | 5e55181bae7bc30a428854f2bde5cd03c9ff6717 (diff) | |
download | geiser-9186ce41aabe30f6242fcfc32d80c21e4f63d4d5.tar.gz geiser-9186ce41aabe30f6242fcfc32d80c21e4f63d4d5.tar.bz2 |
Simpler handling of rest args in Emacs' side.
Diffstat (limited to 'elisp/geiser-autodoc.el')
-rw-r--r-- | elisp/geiser-autodoc.el | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/elisp/geiser-autodoc.el b/elisp/geiser-autodoc.el index 3577193..5d5befa 100644 --- a/elisp/geiser-autodoc.el +++ b/elisp/geiser-autodoc.el @@ -85,23 +85,13 @@ when `geiser-autodoc-display-module-p' is on." (cdr geiser-autodoc--last)))))) (defun geiser-autodoc--insert-arg (arg current pos) - (let ((str (format "%s" arg))) + (let ((str (format "%s" (if (eq arg '\#:rest) "." arg)))) (when (= current pos) (put-text-property 0 (length str) 'face 'geiser-font-lock-autodoc-current-arg str)) (insert str))) -(defun geiser-autodoc--insert-args (arg args current pos) - (when arg - (geiser-autodoc--insert-arg arg current pos) - (cond ((null args) (insert ")")) - ((listp args) - (insert " ") - (geiser-autodoc--insert-args (car args) (cdr args) (1+ current) pos)) - (t (insert " . ") - (geiser-autodoc--insert-args args nil (1+ current) pos))))) - (defsubst geiser-autodoc--proc-name (proc module) (let ((str (if module (format geiser-autodoc-procedure-name-format module proc) @@ -116,17 +106,16 @@ when `geiser-autodoc-display-module-p' is on." (save-current-buffer (set-buffer (geiser-syntax--font-lock-buffer)) (erase-buffer) - (let ((proc (car signature)) - (args (cdr signature))) - (insert (format "(%s " (geiser-autodoc--proc-name proc module))) - (if args - (if (listp args) - (geiser-autodoc--insert-args (car args) (cdr args) 1 pos) - (insert ". ") - (geiser-autodoc--insert-arg args 1 1) - (insert ")")) - (delete-char -1) - (insert ")")) + (let* ((proc (car signature)) + (args (cdr signature)) + (current 1) + (pos (if (> pos (length args)) (length args) pos))) + (insert (format "(%s" (geiser-autodoc--proc-name proc module))) + (dolist (a args) + (insert " ") + (geiser-autodoc--insert-arg a current pos) + (setq current (1+ current))) + (insert ")") (buffer-string))))) |