bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#24173: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode


From: Eli Zaretskii
Subject: bug#24173: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode
Date: Sun, 07 Aug 2016 17:08:00 +0300

> From: Clément Pit--Claudel <clement.pit@gmail.com>
> Date: Sun, 7 Aug 2016 05:27:06 -0400
> Cc: Andreas Schwab <schwab@linux-m68k.org>
> 
> >> In Emacs Lisp mode, the last two backslashes in the string "\\[\\]" are 
> >> highlighted with (font-lock-constant-face font-lock-string-face). Is this 
> >> expected?
> > 
> >          ;; Words inside \\[] tend to be for `substitute-command-keys'.
> >          (,(concat "\\\\\\\\\\[\\(" lisp-mode-symbol-regexp "\\)\\]")

Note that this is in no way specific to backslashes inside [].

> Thanks Andreas!
> 
> Should this regexp be conditional on being in a docstring?

But then the likes of the following will not be font-locked as you'd
expect:

    (message "%s" (substitute-command-keys "Type \\[calc] to return to the 
Calculator")))

IOW, the doc strings are not the only place where we want this.  OTOH,
the probability of having a string where such constructs are used with
no relation to substitute-command-keys is quite low.

> Otherwise please feel free to close as notabug :)

Yes, please do that.

Thanks.





reply via email to

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