From e8f5657bc7f6e0e45f70e4849736c6e87d44a1ac Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 7 Nov 2020 10:15:22 -0500 Subject: [PATCH] * 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 --- lisp/emacs-lisp/lisp-mode.el | 7 +++++-- 1 file 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)) -- 2.39.2