summaryrefslogtreecommitdiff
path: root/elisp/geiser-syntax.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-07-28 01:08:25 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-07-28 01:08:25 +0200
commit32f9cb274bc9abc16449d2da50df537c82cc7775 (patch)
tree70bdaee986544bb0ea5978bc33cbed47957fc003 /elisp/geiser-syntax.el
parent235543503d09a52a513054ed75ac2506b7ce87bf (diff)
downloadgeiser-chez-32f9cb274bc9abc16449d2da50df537c82cc7775.tar.gz
geiser-chez-32f9cb274bc9abc16449d2da50df537c82cc7775.tar.bz2
Displaying variable values in autodoc.
Diffstat (limited to 'elisp/geiser-syntax.el')
-rw-r--r--elisp/geiser-syntax.el31
1 files changed, 14 insertions, 17 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index 6240e75..3e8d590 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -217,24 +217,21 @@
(if (cdr (last p)) (1+ (safe-length p)) (length p)))
(defun geiser-syntax--scan-sexps (&optional begin)
- (let ((path))
+ (let* ((fst (symbol-at-point))
+ (path (and fst `((,fst 0)))))
(save-excursion
- (save-restriction
-;; (narrow-to-region (or begin (point-min)) (1+ (point)))
- (geiser-syntax--skip-comment/string)
- (while (not (zerop (geiser-syntax--nesting-level)))
- (let ((boundary (1+ (point))))
- (backward-up-list)
- (let ((form
- (nth-value 0 (geiser-syntax--form-after-point boundary))))
- (when (and (listp form) (car form) (symbolp (car form)))
- (let* ((len-1 (1- (geiser-syntax--pair-length form)))
- (prev (and (> len-1 1) (nth (1- len-1) form)))
- (prev (and (keywordp prev) (list prev))))
- (push `(,(car form) ,len-1 ,@prev) path))))))
- (if path (nreverse path)
- (let ((fst (symbol-at-point)))
- (and fst `((,fst 0)))))))))
+ (geiser-syntax--skip-comment/string)
+ (while (not (zerop (geiser-syntax--nesting-level)))
+ (let ((boundary (1+ (point))))
+ (backward-up-list)
+ (let ((form
+ (nth-value 0 (geiser-syntax--form-after-point boundary))))
+ (when (and (listp form) (car form) (symbolp (car form)))
+ (let* ((len-1 (1- (geiser-syntax--pair-length form)))
+ (prev (and (> len-1 1) (nth (1- len-1) form)))
+ (prev (and (keywordp prev) (list prev))))
+ (push `(,(car form) ,len-1 ,@prev) path)))))))
+ (nreverse path)))
(defsubst geiser-syntax--binding-form-p (bfs sbfs f)
(or (memq f '(define define* lambda let let* letrec))