From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24173: 25.1.50; Surprising highlighting of "\[\]" in emacs-lisp-mode Date: Sun, 07 Aug 2016 17:08:00 +0300 Message-ID: <83ziooise7.fsf@gnu.org> References: <133f1f27-e7c7-3a59-ad88-414617ba38a4@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1470578966 27476 195.159.176.226 (7 Aug 2016 14:09:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 7 Aug 2016 14:09:26 +0000 (UTC) Cc: 24173@debbugs.gnu.org To: =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 07 16:09:20 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bWOlQ-0005kg-UB for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Aug 2016 16:09:17 +0200 Original-Received: from localhost ([::1]:52836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWOlN-0006fZ-KE for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Aug 2016 10:09:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWOlG-0006dS-AX for bug-gnu-emacs@gnu.org; Sun, 07 Aug 2016 10:09:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWOlC-0003Fp-5Y for bug-gnu-emacs@gnu.org; Sun, 07 Aug 2016 10:09:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWOlC-0003Fl-1i for bug-gnu-emacs@gnu.org; Sun, 07 Aug 2016 10:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bWOlB-0005cM-RG for bug-gnu-emacs@gnu.org; Sun, 07 Aug 2016 10:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Aug 2016 14:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24173 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24173-submit@debbugs.gnu.org id=B24173.147057889521541 (code B ref 24173); Sun, 07 Aug 2016 14:09:01 +0000 Original-Received: (at 24173) by debbugs.gnu.org; 7 Aug 2016 14:08:15 +0000 Original-Received: from localhost ([127.0.0.1]:59144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bWOkQ-0005bN-Vu for submit@debbugs.gnu.org; Sun, 07 Aug 2016 10:08:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bWOkP-0005bA-Ub for 24173@debbugs.gnu.org; Sun, 07 Aug 2016 10:08:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWOkG-00038c-D4 for 24173@debbugs.gnu.org; Sun, 07 Aug 2016 10:08:08 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWOkG-00038S-9Z; Sun, 07 Aug 2016 10:08:04 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3441 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bWOkE-0004ZY-GZ; Sun, 07 Aug 2016 10:08:03 -0400 In-reply-to: <133f1f27-e7c7-3a59-ad88-414617ba38a4@gmail.com> (message from =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel on Sun, 7 Aug 2016 05:27:06 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121942 Archived-At: > From: Clément Pit--Claudel > Date: Sun, 7 Aug 2016 05:27:06 -0400 > Cc: Andreas Schwab > > >> 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.