summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-10-06 02:34:51 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-10-06 02:34:51 +0200
commit6cca3627152fa6f4cd3c38c908db820fdc7eac98 (patch)
tree34fa9d3a025e5ff50984b92286d4c24882eeffe4
parentde4041d918ce90680bfddf9aa8430f8295dcea1e (diff)
downloadgeiser-chez-6cca3627152fa6f4cd3c38c908db820fdc7eac98.tar.gz
geiser-chez-6cca3627152fa6f4cd3c38c908db820fdc7eac98.tar.bz2
Autodoc: fix for position scanning and current symbol
Fixes scan of current symbol when point is in a string or comment and detection of argument boundaries.
-rw-r--r--elisp/geiser-syntax.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index 00b4030..f057d9d 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -214,6 +214,9 @@
;;; Code parsing:
+(defsubst geiser-syntax--symbol-at-point ()
+ (and (not (nth 8 (syntax-ppss))) (symbol-at-point)))
+
(defsubst geiser-syntax--skip-comment/string ()
(let ((pos (nth 8 (syntax-ppss))))
(goto-char (or pos (point)))
@@ -226,8 +229,8 @@
(if (cdr (last p)) (1+ (safe-length p)) (length p)))
(defun geiser-syntax--scan-sexps (&optional begin)
- (let* ((fst (symbol-at-point))
- (smth (or fst (not (looking-at-p "[\\s \\s)\\s>\\s<\n]"))))
+ (let* ((fst (geiser-syntax--symbol-at-point))
+ (smth (or fst (not (looking-at-p "[\s \s)\s>\s<\n]"))))
(path (and fst `((,fst 0)))))
(save-excursion
(geiser-syntax--skip-comment/string)