* bug#24173: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode
@ 2016-08-07 0:51 Clément Pit--Claudel
2016-08-07 1:19 ` Drew Adams
2016-08-07 9:11 ` Andreas Schwab
0 siblings, 2 replies; 6+ messages in thread
From: Clément Pit--Claudel @ 2016-08-07 0:51 UTC (permalink / raw)
To: 24173
[-- Attachment #1.1: Type: text/plain, Size: 482 bytes --]
Hey bug-gnu-emacs,
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?
Clément.
In GNU Emacs 25.1.50.7 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
of 2016-07-20 built on clem-w50-mint
Repository revision: a1a0c208e3e895a6ea0942e8e5c4077faf12c7ad
Windowing system distributor 'The X.Org Foundation', version 11.0.11803000
System Description: Linux Mint 18 Sarah
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#24173: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode
2016-08-07 0:51 bug#24173: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode Clément Pit--Claudel
@ 2016-08-07 1:19 ` Drew Adams
2016-08-07 1:24 ` Clément Pit--Claudel
2016-08-07 9:11 ` Andreas Schwab
1 sibling, 1 reply; 6+ messages in thread
From: Drew Adams @ 2016-08-07 1:19 UTC (permalink / raw)
To: Clément Pit--Claudel, 24173
> 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?
Whether intentional or a bug, it seems to have been introduced
in Emacs 25 builds. I see it there, and I don't see it in
Emacs 24.5 or older releases.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#24173: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode
2016-08-07 1:19 ` Drew Adams
@ 2016-08-07 1:24 ` Clément Pit--Claudel
0 siblings, 0 replies; 6+ messages in thread
From: Clément Pit--Claudel @ 2016-08-07 1:24 UTC (permalink / raw)
To: Drew Adams, 24173
[-- Attachment #1.1: Type: text/plain, Size: 398 bytes --]
On 2016-08-06 21:19, Drew Adams wrote:
>> 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?
>
> Whether intentional or a bug, it seems to have been introduced
> in Emacs 25 builds. I see it there, and I don't see it in
> Emacs 24.5 or older releases.
Thanks for testing!
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#24173: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode
2016-08-07 0:51 bug#24173: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode Clément Pit--Claudel
2016-08-07 1:19 ` Drew Adams
@ 2016-08-07 9:11 ` Andreas Schwab
2016-08-07 9:27 ` Clément Pit--Claudel
1 sibling, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2016-08-07 9:11 UTC (permalink / raw)
To: Clément Pit--Claudel; +Cc: 24173
Clément Pit--Claudel <clement.pitclaudel@live.com> writes:
> 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 "\\)\\]")
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#24173: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode
2016-08-07 9:11 ` Andreas Schwab
@ 2016-08-07 9:27 ` Clément Pit--Claudel
2016-08-07 14:08 ` Eli Zaretskii
0 siblings, 1 reply; 6+ messages in thread
From: Clément Pit--Claudel @ 2016-08-07 9:27 UTC (permalink / raw)
To: 24173; +Cc: Andreas Schwab
[-- Attachment #1.1: Type: text/plain, Size: 569 bytes --]
On 2016-08-07 05:11, Andreas Schwab wrote:
> Clément Pit--Claudel <clement.pitclaudel@live.com> writes:
>
>> 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 "\\)\\]")
Thanks Andreas!
Should this regexp be conditional on being in a docstring? Otherwise please feel free to close as notabug :)
Clément.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#24173: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode
2016-08-07 9:27 ` Clément Pit--Claudel
@ 2016-08-07 14:08 ` Eli Zaretskii
0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2016-08-07 14:08 UTC (permalink / raw)
To: Clément Pit--Claudel; +Cc: 24173
> 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-08-07 14:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-07 0:51 bug#24173: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode Clément Pit--Claudel
2016-08-07 1:19 ` Drew Adams
2016-08-07 1:24 ` Clément Pit--Claudel
2016-08-07 9:11 ` Andreas Schwab
2016-08-07 9:27 ` Clément Pit--Claudel
2016-08-07 14:08 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).