diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2020-11-07 10:15:22 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2020-11-07 10:15:22 -0500 |
commit | e8f5657bc7f6e0e45f70e4849736c6e87d44a1ac (patch) | |
tree | 7b75dee641c1eb1c57e80ab677ef7f012ce46004 /lisp/emacs-lisp | |
parent | 423b6b62296df0558cf16f286dd268e0b49b3bce (diff) | |
download | emacs-e8f5657bc7f6e0e45f70e4849736c6e87d44a1ac.tar.gz emacs-e8f5657bc7f6e0e45f70e4849736c6e87d44a1ac.tar.bz2 emacs-e8f5657bc7f6e0e45f70e4849736c6e87d44a1ac.zip |
* lisp/emacs-lisp/lisp-mode.el: Avoid false-positive "hidden arg" in strings
(lisp--match-hidden-arg): Don't misfire in strings and comments.
Reported by: Andrii Kolomoiets <andreyk.mad@gmail.com>
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 268992295bf..daf49670894 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -178,13 +178,16 @@ (defun lisp--match-hidden-arg (limit) (let ((res nil)) + (forward-line 0) (while - (let ((ppss (parse-partial-sexp (line-beginning-position) + (let ((ppss (parse-partial-sexp (point) (line-end-position) -1))) (skip-syntax-forward " )") (if (or (>= (car ppss) 0) - (looking-at ";\\|$")) + (eolp) + (looking-at ";") + (nth 8 (syntax-ppss))) ;Within a string or comment. (progn (forward-line 1) (< (point) limit)) |