summaryrefslogtreecommitdiff
path: root/elisp/geiser-syntax.el
diff options
context:
space:
mode:
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))