From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#13755: 24.3.50; regression: incorrect font-lock highlighting Date: Sat, 9 Mar 2013 09:16:25 -0800 Message-ID: <3B433F0584F243B1B28BE401BBC91E41@us.oracle.com> References: <37407E4E6385422185BDB9337946D9F4@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1362849451 12105 80.91.229.3 (9 Mar 2013 17:17:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Mar 2013 17:17:31 +0000 (UTC) Cc: 13755@debbugs.gnu.org To: "'Stefan Monnier'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 09 18:17:55 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UENP8-0002y0-NH for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Mar 2013 18:17:54 +0100 Original-Received: from localhost ([::1]:38064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UENOm-0007iL-Lu for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Mar 2013 12:17:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:47514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UENOe-0007gJ-Lf for bug-gnu-emacs@gnu.org; Sat, 09 Mar 2013 12:17:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UENOY-00015N-5J for bug-gnu-emacs@gnu.org; Sat, 09 Mar 2013 12:17:24 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UENOY-00015I-1I for bug-gnu-emacs@gnu.org; Sat, 09 Mar 2013 12:17:18 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UENPF-0007VK-OK for bug-gnu-emacs@gnu.org; Sat, 09 Mar 2013 12:18:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Mar 2013 17:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13755 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13755-submit@debbugs.gnu.org id=B13755.136284945028806 (code B ref 13755); Sat, 09 Mar 2013 17:18:01 +0000 Original-Received: (at 13755) by debbugs.gnu.org; 9 Mar 2013 17:17:30 +0000 Original-Received: from localhost ([127.0.0.1]:42077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UENOk-0007UZ-5Y for submit@debbugs.gnu.org; Sat, 09 Mar 2013 12:17:30 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:48611) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UENOi-0007UM-98 for 13755@debbugs.gnu.org; Sat, 09 Mar 2013 12:17:29 -0500 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r29HGc9U006194 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 9 Mar 2013 17:16:39 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r29HGbMb012325 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 9 Mar 2013 17:16:37 GMT Original-Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r29HGbTR029960; Sat, 9 Mar 2013 11:16:37 -0600 Original-Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 09 Mar 2013 09:16:36 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac4c3hyw1uKqTVxBTj6ZzCycHmKIAgAA2Mdw X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72284 Archived-At: > > (font-lock-add-keywords > > 'emacs-lisp-mode > > `((,(concat "(" (regexp-opt > > '("icicle-define-add-to-alist-command" > > "icicle-define-command" > > "icicle-define-file-command" > > "icicle-define-sort-command") > > t) > > "\\>[ \t'\(]*\\(\\sw+\\)?") > ^^^ > There's your bug: you should use \\_>. Interesting. I'm surprised that Emacs has for so long (decades) matched only a word-end here and not a symbol-end. Be that as it may, changing from \\> to \\_> here does NOT fix the bug. Here is the relevant entry from `font-lock-keywords' in Emacs-Lisp mode: ("(\\(icicle-define-\\(?:\\(?:\\(?:add-to-alist\\|file\\|sort\\)-\\)?command\\)\ \)\\_>[ '(]*\\(\\sw+\\)?" (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t)) The problem is not the highlighting of `icicle-define-command', which is correctly in `font-lock-keyword-face' (when using either \\> or \\_>, for that matter). The problem is the highlighting of the command name that follows keyword `icicle-define-command'. The command name should all be in `font-lock-function-name-face'. But only its first word is highlighted now, as shown in the screenshots I sent with the bug report. That is the regression. It's as if Emacs is not counting regexp groups the same way as before. Here is the code again (but with your suggested \\_> this time): (font-lock-add-keywords 'emacs-lisp-mode `((,(concat "(" (regexp-opt '("icicle-define-add-to-alist-command" "icicle-define-command" "icicle-define-file-command" "icicle-define-sort-command") t) "\\_>[ \t'\(]*\\(\\sw+\\)?") (1 font-lock-keyword-face) ;; Index (2 or 3) depends on whether or not ;; shy groups are supported. ,(list (if (string-match "\\(?:\\)" "") 2 3) 'font-lock-function-name-face nil t)) ("(\\(icicle-condition-case-no-debug\\)\\_>" 1 font-lock-keyword-face) ("(\\(icicle-user-error\\)\\_>" 1 font-lock-warning-face))) > > ("(\\(icicle-condition-case-no-debug\\)\\>" > ^^^ > Same here. No. That highlights correctly. Again, there is no problem with `font-lock-keyword-face' highlighting. Similarly, all the other uses of \\> in Emacs-Lisp mode `font-lock-keywords' (and there are several, in emacs -Q) also fontify correctly. AFAICT, you mistook the problem. Please take another look.