summaryrefslogtreecommitdiff
path: root/elisp
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
commit19f2c366f4ab2b7c579dc069220c0d2ade4a3a72 (patch)
tree684b5cf01650ace4ebc6ceb50f907c9842d5171a /elisp
parent909c2aed429945a1fbe6fc03536634f454cb7012 (diff)
downloadgeiser-19f2c366f4ab2b7c579dc069220c0d2ade4a3a72.tar.gz
geiser-19f2c366f4ab2b7c579dc069220c0d2ade4a3a72.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.
Diffstat (limited to 'elisp')
-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)