diff options
-rw-r--r-- | elisp/geiser-syntax.el | 18 | ||||
-rw-r--r-- | scheme/geiser/introspection.scm | 2 |
2 files changed, 13 insertions, 7 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 diff --git a/scheme/geiser/introspection.scm b/scheme/geiser/introspection.scm index eff9573..0c759d5 100644 --- a/scheme/geiser/introspection.scm +++ b/scheme/geiser/introspection.scm @@ -51,7 +51,7 @@ (req (first arity)) (opt (third arity))) (format-args (map (lambda (n) - (string->symbol (format "arg~A" n))) + (string->symbol (format "arg~A" (+ 1 n)))) (iota req)) (and opt 'rest)))) |