summaryrefslogtreecommitdiff
path: root/elisp/geiser-syntax.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-02-10 17:11:45 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-02-10 17:11:45 +0100
commit36ac636e82a9ce4e6fa49b514de149a889dfebdd (patch)
treeaa327bcfbea9898c0cf6d0cc9669dce5716de0e4 /elisp/geiser-syntax.el
parent690c7fb28a092ae6371c405373150414ae21ef55 (diff)
downloadgeiser-36ac636e82a9ce4e6fa49b514de149a889dfebdd.tar.gz
geiser-36ac636e82a9ce4e6fa49b514de149a889dfebdd.tar.bz2
Multi-level form arity recognition in autodoc.
Diffstat (limited to 'elisp/geiser-syntax.el')
-rw-r--r--elisp/geiser-syntax.el22
1 files changed, 13 insertions, 9 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index 5f109cf..32b28bb 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -66,16 +66,20 @@
(defun geiser-syntax--enclosing-form-data ()
(save-excursion
(let ((p (geiser-syntax--end-of-thing))
- (arg-no 0)
- (proc))
+ (current (cons (symbol-at-point) 0))
+ (data))
(ignore-errors
- (backward-up-list)
- (forward-char)
- (setq proc (symbol-at-point))
- (while (< (point) p)
- (forward-sexp)
- (when (< (point) p) (setq arg-no (1+ arg-no))))
- (cons proc arg-no)))))
+ (while (not (bobp))
+ (backward-up-list)
+ (save-excursion
+ (forward-char)
+ (let ((proc (symbol-at-point))
+ (arg-no 0))
+ (while (< (point) p)
+ (forward-sexp)
+ (when (< (point) p) (setq arg-no (1+ arg-no))))
+ (push (cons proc arg-no) data)))))
+ (reverse (push current data)))))
(defun geiser-syntax--prepare-scheme-for-elisp-reader ()
(goto-char (point-min))