summaryrefslogtreecommitdiff
path: root/elisp/geiser-syntax.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-08-30 07:15:55 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-08-30 07:15:55 +0200
commitb09474daeb892ef0293342839a379e34d4d7c048 (patch)
treecff2bfda7fadd09b8a142191b9b0184e9663c557 /elisp/geiser-syntax.el
parent627eef525aab39ba0895e120f0bca9be7fc10e6b (diff)
downloadgeiser-chez-b09474daeb892ef0293342839a379e34d4d7c048.tar.gz
geiser-chez-b09474daeb892ef0293342839a379e34d4d7c048.tar.bz2
Fix for locals scanning in presence of rest arguments.
Diffstat (limited to 'elisp/geiser-syntax.el')
-rw-r--r--elisp/geiser-syntax.el42
1 files changed, 22 insertions, 20 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index 23f0ed3..e7c2a9f 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -247,27 +247,29 @@
(flet ((if-symbol (x) (and (symbolp x) x))
(if-list (x) (and (listp x) x))
(normalize (vars) (mapcar (lambda (i) (if (listp i) (car i) i)) vars)))
- (cond ((or (null form) (not (listp form))) (normalize locals))
- ((not (geiser-syntax--binding-form-p bfs sbfs (car form)))
- (geiser-syntax--scan-locals bfs sbfs
- (car (last form)) partial locals))
- (t
- (let* ((head (car form))
- (name (if-symbol (cadr form)))
- (names (if name (if-list (caddr form))
- (if-list (cadr form))))
- (rest (if name (cdddr form) (cddr form)))
- (use-names (or rest
- (not partial)
- (geiser-syntax--binding-form*-p sbfs head))))
- (when name (push name locals))
- (when use-names (dolist (n names) (push n locals)))
- (dolist (f (butlast rest))
- (when (eq (car f) 'define) (push (cadr f) locals)))
+ (let ((form (if (listp form) (normalize form) form)))
+ (cond ((or (null form) (not (listp form))) (normalize locals))
+ ((not (geiser-syntax--binding-form-p bfs sbfs (car form)))
(geiser-syntax--scan-locals bfs sbfs
- (car (last (or rest names)))
- partial
- locals))))))
+ (car (last form)) partial locals))
+ (t
+ (let* ((head (car form))
+ (name (if-symbol (cadr form)))
+ (names (if name (if-list (caddr form))
+ (if-list (cadr form))))
+ (rest (if name (cdddr form) (cddr form)))
+ (use-names (or rest
+ (not partial)
+ (geiser-syntax--binding-form*-p sbfs
+ head))))
+ (when name (push name locals))
+ (when use-names (dolist (n names) (push n locals)))
+ (dolist (f (butlast rest))
+ (when (eq (car f) 'define) (push (cadr f) locals)))
+ (geiser-syntax--scan-locals bfs sbfs
+ (car (last (or rest names)))
+ partial
+ locals)))))))
(defun geiser-syntax--locals-around-point (bfs sbfs)
(when (eq major-mode 'scheme-mode)