]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/lisp-mode.el: Avoid false-positive "hidden arg" in strings
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 7 Nov 2020 15:15:22 +0000 (10:15 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 7 Nov 2020 15:15:22 +0000 (10:15 -0500)
(lisp--match-hidden-arg): Don't misfire in strings and comments.

Reported by: Andrii Kolomoiets <andreyk.mad@gmail.com>

lisp/emacs-lisp/lisp-mode.el

index 268992295bf053c128b7001fbb07f32c8d9d2e6c..daf49670894eaac19004fbc485f06151e4b19ab7 100644 (file)
 
 (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))