summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-02-09 12:14:04 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-02-09 12:14:04 +0100
commiteda610de4c00b648c5e2713838654600e546b481 (patch)
treefd05e3927951f06a458f4b44eb23786ff3ea936e /elisp
parentbe3ac190b5745ef88e65220aa19f1883fb38f5c6 (diff)
downloadgeiser-eda610de4c00b648c5e2713838654600e546b481.tar.gz
geiser-eda610de4c00b648c5e2713838654600e546b481.tar.bz2
Better argument position detection in autodoc.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-syntax.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index 07aafbb..9a476ce 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -52,14 +52,20 @@
;;; Code parsing:
+(defsubst geiser-syntax--end-of-thing ()
+ (let ((sc (syntax-class (syntax-after (point)))))
+ (when (= sc 7) (forward-char))
+ (cond ((nth 3 (syntax-ppss))
+ (skip-syntax-forward "^\"")
+ (forward-char))
+ ((= sc 5) (forward-char))
+ ((not (or (= sc 0) (= sc 12))) ;; comment, whitespace
+ (ignore-errors (forward-sexp))))
+ (point)))
+
(defun geiser-syntax--enclosing-form-data ()
(save-excursion
- (let ((p (progn (ignore-errors
- (unless (zerop (car (syntax-after (point))))
- (forward-sexp)
- (when (= 7 (car (syntax-after (point))))
- (forward-char))))
- (point)))
+ (let ((p (geiser-syntax--end-of-thing))
(arg-no 0)
(proc))
(condition-case nil