From d6cb106a374800b1899dca8fc25b8698e152e64c Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 4 Nov 2020 11:37:00 -0500 Subject: * lisp-mode.el: Fix missing highlight of "hidden" string arg * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2) (lisp-cl-font-lock-keywords-2): Highlight "hidden arg" even if it already has another face. --- lisp/emacs-lisp/lisp-mode.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 352210f859d..268992295bf 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -478,7 +478,8 @@ This will generate compile-time constants from BINDINGS." (3 'font-lock-regexp-grouping-construct prepend)) (lisp--match-hidden-arg (0 '(face font-lock-warning-face - help-echo "Hidden behind deeper element; move to another line?"))) + help-echo "Hidden behind deeper element; move to another line?") + prepend)) (lisp--match-confusable-symbol-character 0 '(face font-lock-warning-face help-echo "Confusable character")) @@ -522,7 +523,8 @@ This will generate compile-time constants from BINDINGS." (1 font-lock-keyword-face)) (lisp--match-hidden-arg (0 '(face font-lock-warning-face - help-echo "Hidden behind deeper element; move to another line?"))) + help-echo "Hidden behind deeper element; move to another line?") + prepend)) )) "Gaudy level highlighting for Lisp modes."))) -- cgit v1.2.3 From e8f5657bc7f6e0e45f70e4849736c6e87d44a1ac Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 7 Nov 2020 10:15:22 -0500 Subject: * 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(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') 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)) -- cgit v1.2.3