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

Previous Next

Package: emacs;

Reported by: Clément Pit--Claudel <clement.pitclaudel <at> live.com>

Date: Sun, 7 Aug 2016 00:52:02 UTC

Severity: minor

Tags: notabug

Found in version 25.1.50

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24173 in the body.
You can then email your comments to 24173 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#24173; Package emacs. (Sun, 07 Aug 2016 00:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Clément Pit--Claudel <clement.pitclaudel <at> live.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 07 Aug 2016 00:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode
Date: Sat, 6 Aug 2016 20:51:02 -0400
[Message part 1 (text/plain, inline)]
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

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24173; Package emacs. (Sun, 07 Aug 2016 01:20:01 GMT) Full text and rfc822 format available.

Message #8 received at 24173 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Clément Pit--Claudel <clement.pitclaudel <at> live.com>,
 24173 <at> debbugs.gnu.org
Subject: RE: bug#24173: 25.1.50; Surprising highlighting of "\[\]" in
 emacs-lisp-mode
Date: Sat, 6 Aug 2016 18:19:36 -0700 (PDT)
> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24173; Package emacs. (Sun, 07 Aug 2016 01:25:02 GMT) Full text and rfc822 format available.

Message #11 received at 24173 <at> debbugs.gnu.org (full text, mbox):

From: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
To: Drew Adams <drew.adams <at> oracle.com>, 24173 <at> debbugs.gnu.org
Subject: Re: bug#24173: 25.1.50; Surprising highlighting of "\[\]" in
 emacs-lisp-mode
Date: Sat, 6 Aug 2016 21:24:24 -0400
[Message part 1 (text/plain, inline)]
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!

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24173; Package emacs. (Sun, 07 Aug 2016 09:12:02 GMT) Full text and rfc822 format available.

Message #14 received at 24173 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
Cc: 24173 <at> debbugs.gnu.org
Subject: Re: bug#24173: 25.1.50;
 Surprising highlighting of "\[\]" in emacs-lisp-mode
Date: Sun, 07 Aug 2016 11:11:12 +0200
Clément Pit--Claudel <clement.pitclaudel <at> 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 <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24173; Package emacs. (Sun, 07 Aug 2016 09:28:01 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Clément Pit--Claudel <clement.pit <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Andreas Schwab <schwab <at> linux-m68k.org>
Subject: Re: bug#24173: 25.1.50; Surprising highlighting of "\[\]" in
 emacs-lisp-mode
Date: Sun, 7 Aug 2016 05:27:06 -0400
[Message part 1 (text/plain, inline)]
On 2016-08-07 05:11, Andreas Schwab wrote:
> Clément Pit--Claudel <clement.pitclaudel <at> 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.

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24173; Package emacs. (Sun, 07 Aug 2016 14:09:01 GMT) Full text and rfc822 format available.

Message #20 received at 24173 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Clément Pit--Claudel <clement.pit <at> gmail.com>
Cc: 24173 <at> debbugs.gnu.org
Subject: Re: 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 <at> gmail.com>
> Date: Sun, 7 Aug 2016 05:27:06 -0400
> Cc: Andreas Schwab <schwab <at> 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.




Added tag(s) notabug. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Wed, 17 Aug 2016 01:38:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 24173 <at> debbugs.gnu.org and Clément Pit--Claudel <clement.pitclaudel <at> live.com> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Wed, 17 Aug 2016 01:38:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 14 Sep 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 330 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.