emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: project--files-in-directory: code formatting


From: Dmitry Gutov
Subject: Re: project--files-in-directory: code formatting
Date: Wed, 4 Nov 2020 21:40:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 04.11.2020 16:30, Stefan Monnier wrote:
(if you replace
the empty string with a symbol, it does catch it, tho)

I tried it with a symbol. Yet, the red failed to show up with my config.

Looking at the text properties, 'help-echo' was there, but not the 'face' property. Apparently that is because of this personal setup I have for dimming parens:

(defface esk-paren-face
  '((((class color) (background light))
     (:foreground "grey55")))
  "Face for parens.")

(dolist (mode '(scheme emacs-lisp lisp lisp-interaction clojure clojurescript
                       inferior-emacs-lisp nrepl))
  (when (> (display-color-cells) 8)
    (font-lock-add-keywords (intern (format "%s-mode" mode))
                            '(("(\\|)" . 'esk-paren-face))))
  (add-hook (intern (format "%s-mode-hook" mode)) 'paredit-mode))

One way to avoid the conflict would be to avoid matching parens in lisp--match-hidden-arg, but that seems very ad-hoc.

How about this? Fixes the string literal case as well.

diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 352210f859..d4411f1fa4 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -477,8 +477,9 @@ lisp--match-confusable-symbol-character
            (1 'font-lock-regexp-grouping-backslash prepend)
            (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?")))
+          (0 '( face font-lock-warning-face
+ help-echo "Hidden behind deeper element; move to another line?")
+             t))
          (lisp--match-confusable-symbol-character
           0 '(face font-lock-warning-face
                     help-echo "Confusable character"))
@@ -521,8 +522,9 @@ lisp--match-confusable-symbol-character
          (,(concat "(\\(\\(do-\\|with-\\)" lisp-mode-symbol-regexp "\\)")
            (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?")))
+          (0 '( face font-lock-warning-face
+ help-echo "Hidden behind deeper element; move to another line?")
+             t))
          ))
       "Gaudy level highlighting for Lisp modes.")))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]