unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Clément Pit--Claudel" <clement.pit@gmail.com>
Cc: 24173@debbugs.gnu.org
Subject: bug#24173: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode
Date: Sun, 07 Aug 2016 17:08:00 +0300	[thread overview]
Message-ID: <83ziooise7.fsf@gnu.org> (raw)
In-Reply-To: <133f1f27-e7c7-3a59-ad88-414617ba38a4@gmail.com> (message from Clément Pit--Claudel on Sun, 7 Aug 2016 05:27:06 -0400)

> 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	other threads:[~2016-08-07 14:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83ziooise7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=24173@debbugs.gnu.org \
    --cc=clement.pit@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).