diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-01 02:19:41 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-01 02:19:41 +0100 |
commit | b03485cff434d8a2eafd8ad02620293a35c01977 (patch) | |
tree | 57da88fa59e1d874fae3e33d5a393df43bb7568d | |
parent | e9a5923201d09f13b522ccc769bcafbdd11e15c2 (diff) | |
download | geiser-chez-b03485cff434d8a2eafd8ad02620293a35c01977.tar.gz geiser-chez-b03485cff434d8a2eafd8ad02620293a35c01977.tar.bz2 |
More precise argument position highlighting in autodoc.
-rw-r--r-- | elisp/geiser-syntax.el | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el index a41f152..dcc8359 100644 --- a/elisp/geiser-syntax.el +++ b/elisp/geiser-syntax.el @@ -80,18 +80,18 @@ (geiser-syntax--with-buffer (erase-buffer) (insert-buffer-substring-no-properties buffer begin end) - (skip-syntax-backward "-<>") - (delete-region (point) (point-max)) + (when (not (eq (char-after (point)) ?\()) + (skip-syntax-backward "-<>") + (delete-region (point) (point-max))) (let ((pps (parse-partial-sexp (point-min) (point)))) (when (nth 8 pps) ;; inside a comment or string (delete-region (nth 8 pps) (point-max)))) - (cond ((eq (char-after (1- (point))) ?\)) - (geiser-syntax--del-sexp -1) (insert "XXpointXX")) - ((eq (char-after (point)) ?\() - (geiser-syntax--del-sexp 1) (insert "XXpointXX"))) - (when (memq (char-after (1- (point))) (list ?. ?@ ?, ?\' ?\` ?\#)) - (skip-syntax-backward "^-(") - (delete-region (point) (point-max)) + (when (cond ((eq (char-after (1- (point))) ?\)) (geiser-syntax--del-sexp -1) t) + ((eq (char-after (point)) ?\() (delete-region (point) (point-max)) t) + ((memq (char-after (1- (point))) (list ?. ?@ ?, ?\' ?\` ?\#)) + (skip-syntax-backward "^-(") + (delete-region (point) (point-max)) + t)) (insert "XXXpointXX")) (let ((depth (nth 0 (parse-partial-sexp (point-min) (point))))) (unless (zerop depth) (insert (make-string depth ?\))))) @@ -99,9 +99,10 @@ (defsubst geiser-syntax--get-partial-sexp () (unless (zerop (nth 0 (syntax-ppss))) - (let* ((end (save-excursion (skip-syntax-forward "^-()") (point))) + (let* ((end (if (eq (char-after (point)) ?\() (1+ (point)) + (save-excursion (skip-syntax-forward "^-()") (point)))) (begin (save-excursion (beginning-of-defun) (point)))) - (geiser-syntax--complete-partial-sexp (current-buffer) begin end)))) + (geiser-syntax--complete-partial-sexp (current-buffer) begin end)))) ;;; Fontify strings as Scheme code: |