From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rupert Swarbrick Newsgroups: gmane.emacs.bugs Subject: bug#19882: 25.0.50; Backwards font-lock regex in m4-mode Date: Mon, 16 Feb 2015 11:32:59 +0000 Message-ID: <889iof2rt04.fsf@broadcom.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1424086468 10472 80.91.229.3 (16 Feb 2015 11:34:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Feb 2015 11:34:28 +0000 (UTC) To: 19882@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 16 12:34:16 2015 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 1YNJwO-0001TT-BX for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Feb 2015 12:34:16 +0100 Original-Received: from localhost ([::1]:38901 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNJwN-0001RS-I9 for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Feb 2015 06:34:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNJwF-0001QB-Ff for bug-gnu-emacs@gnu.org; Mon, 16 Feb 2015 06:34:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNJwA-0001Rs-Rj for bug-gnu-emacs@gnu.org; Mon, 16 Feb 2015 06:34:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNJwA-0001Rg-OB for bug-gnu-emacs@gnu.org; Mon, 16 Feb 2015 06:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YNJwA-0004ap-Ao for bug-gnu-emacs@gnu.org; Mon, 16 Feb 2015 06:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Rupert Swarbrick Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Feb 2015 11:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19882 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Original-Received: via spool by submit@debbugs.gnu.org id=B.142408641517616 (code B ref -1); Mon, 16 Feb 2015 11:34:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Feb 2015 11:33:35 +0000 Original-Received: from localhost ([127.0.0.1]:45204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNJve-0004Zy-Ra for submit@debbugs.gnu.org; Mon, 16 Feb 2015 06:33:34 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55029) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNJvZ-0004Zg-3f for submit@debbugs.gnu.org; Mon, 16 Feb 2015 06:33:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNJvP-0000oY-4J for submit@debbugs.gnu.org; Mon, 16 Feb 2015 06:33:19 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:58615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNJvP-0000oM-1g for submit@debbugs.gnu.org; Mon, 16 Feb 2015 06:33:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNJvJ-000168-4i for bug-gnu-emacs@gnu.org; Mon, 16 Feb 2015 06:33:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNJvD-0000iV-7F for bug-gnu-emacs@gnu.org; Mon, 16 Feb 2015 06:33:09 -0500 Original-Received: from mail-gw1-out.broadcom.com ([216.31.210.62]:64733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNJvD-0000ha-2U for bug-gnu-emacs@gnu.org; Mon, 16 Feb 2015 06:33:03 -0500 X-IronPort-AV: E=Sophos;i="5.09,587,1418112000"; d="scan'208";a="57376186" Original-Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw1-out.broadcom.com with ESMTP; 16 Feb 2015 05:57:59 -0800 Original-Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.3.174.1; Mon, 16 Feb 2015 03:33:00 -0800 Original-Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) with Microsoft SMTP Server id 14.3.174.1; Mon, 16 Feb 2015 03:33:06 -0800 Original-Received: from xl-cam-20.broadcom.com (xl-cam-20.cam.broadcom.com [10.177.132.80]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 6E0A440FEB for ; Mon, 16 Feb 2015 03:31:56 -0800 (PST) Original-Received: by xl-cam-20.broadcom.com (Postfix, from userid 35990) id 2EE5018071E; Mon, 16 Feb 2015 11:32:59 +0000 (GMT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.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:99466 Archived-At: 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... Rupert In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) of 2015-02-09 on Repository revision: 2f7008715326a49770fcb82003ed78eab28c0626 Windowing system distributor `The X.Org Foundation', version 11.0.11300000 I'm trimming the rest of the build info because I'm pretty certain it's not relevant to this report and contains lots of internal company paths.