From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.bugs Subject: bug#19882: 25.0.50; Backwards font-lock regex in m4-mode Date: Mon, 21 Mar 2016 06:30:20 +0100 Message-ID: <87bn68e6tv.fsf@mbork.pl> References: <889iof2rt04.fsf@broadcom.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1458538284 2284 80.91.229.3 (21 Mar 2016 05:31:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Mar 2016 05:31:24 +0000 (UTC) Cc: 19882@debbugs.gnu.org To: Rupert Swarbrick Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 21 06:31:13 2016 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 1ahsQp-0005Zw-NM for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Mar 2016 06:31:11 +0100 Original-Received: from localhost ([::1]:55715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahsQo-0004V2-Pb for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Mar 2016 01:31:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahsQl-0004Um-G5 for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2016 01:31:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahsQg-0007bi-H9 for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2016 01:31:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58998) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahsQg-0007be-D9 for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2016 01:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ahsQg-0006nR-8L for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2016 01:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Mar 2016 05:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19882 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19882-submit@debbugs.gnu.org id=B19882.145853823026078 (code B ref 19882); Mon, 21 Mar 2016 05:31:02 +0000 Original-Received: (at 19882) by debbugs.gnu.org; 21 Mar 2016 05:30:30 +0000 Original-Received: from localhost ([127.0.0.1]:56125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ahsQA-0006mY-N1 for submit@debbugs.gnu.org; Mon, 21 Mar 2016 01:30:30 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:35865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ahsQ9-0006mM-8O for 19882@debbugs.gnu.org; Mon, 21 Mar 2016 01:30:29 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 6C77BA3445F; Mon, 21 Mar 2016 06:30:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vj22kkdo3zRq; Mon, 21 Mar 2016 06:30:23 +0100 (CET) Original-Received: from localhost (98-171.echostar.pl [213.156.98.171]) by mail.mojserwer.eu (Postfix) with ESMTPSA id CBF6CA3445E; Mon, 21 Mar 2016 06:30:23 +0100 (CET) In-Reply-To: <889iof2rt04.fsf@broadcom.com> (Rupert Swarbrick's message of "Mon, 16 Feb 2015 11:32:59 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115210 Archived-At: On 2015-02-16, at 11:32, Rupert Swarbrick wrote: > In m4-mode.el, the last two sexps in m4-font-lock-keywords are the wrong > way around. As a result, if you are writing M4 code to be expanded in > "-P mode", so have things like > > m4_define > > in the file, then the "define" part gets matched by the penultimate > regex, so m4_ doesn't get highlighted as part of a keyword. > > I think the fix for this is to just swap the two regexes around. That > said, the commented stuff at the bottom of the file is rather > ugly. Maybe it would be better to have a single regex, made with > something like: > > (regexp-opt (append (mapcar (lambda (kw) > (concat "m4_" kw)) > prefixed) > prefixed > unprefixed)) > > with prefixed containing: > > '("builtin" "changecom" "changequote" "changeword" "debugfile" > "debugmode" "decr" "define" "defn" "divert" "divnum" "dnl" > "dumpdef" "errprint" "esyscmd" "eval" "file" "format" > "ifdef" "ifelse" "include" "incr" "index" "indir" "len" "line" > "m4exit" "m4wrap" "maketemp" "patsubst" "popdef" "pushdef" "regexp" > "shift" "sinclude" "substr" "syscmd" "sysval" "traceoff" "traceon" > "translit" "undefine" "undivert" "unix")) > > > and unprefixed containing: > > '("gnu") > > > Or maybe the absence of m4_gnu is a typo, in which case the logic could > be slightly simpler. I'm assuming that "m4_m4_undefine" at the bottom of > the file is a mistake. > > Sorry there's no patch: I've requested assignment papers, but they > haven't come through yet. Since I think I've hit my minimal change > limit, someone else gets to type the code... Hi, in case the problem is still there (I don't use m4, so it's difficult for me to verify it), would you be able to provide a patch now? > Rupert Best, -- Marcin