From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Jes Bodi Klinke" Newsgroups: gmane.emacs.devel Subject: [PATCH 1/1] compile.el bug in recognizing -o switches among output Date: Wed, 27 Oct 2010 14:11:06 -0700 (PDT) Message-ID: <5e0d0f4adb8ef5510aeacb9bcbe9a1a7.squirrel@xspect.dk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1288225702 11233 80.91.229.12 (28 Oct 2010 00:28:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 28 Oct 2010 00:28:22 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 28 02:28:20 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PBGLr-00021U-Ky for ged-emacs-devel@m.gmane.org; Thu, 28 Oct 2010 02:28:19 +0200 Original-Received: from localhost ([127.0.0.1]:57517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PBG1V-0001eK-7v for ged-emacs-devel@m.gmane.org; Wed, 27 Oct 2010 20:07:17 -0400 Original-Received: from [140.186.70.92] (port=55575 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PBDJh-0002s8-7Z for emacs-devel@gnu.org; Wed, 27 Oct 2010 17:13:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PBDH3-0001OR-HD for emacs-devel@gnu.org; Wed, 27 Oct 2010 17:11:10 -0400 Original-Received: from xspect.dk ([77.66.17.204]:54714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PBDH3-0001O9-C7 for emacs-devel@gnu.org; Wed, 27 Oct 2010 17:11:09 -0400 Original-Received: from xspect.dk (xspect.dk [127.0.0.1]) by xspect.dk (Postfix) with ESMTP id E1CDE8AC72; Wed, 27 Oct 2010 23:11:06 +0200 (CEST) Original-Received: from 216.239.45.4 (SquirrelMail authenticated user jesk) by xspect.dk with HTTP; Wed, 27 Oct 2010 14:11:06 -0700 (PDT) User-Agent: SquirrelMail/1.4.15 X-Priority: 3 (Normal) Importance: Normal X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Mailman-Approved-At: Wed, 27 Oct 2010 20:05:17 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:132151 Archived-At: Hello emacs developers I have long been an satisfied user of Emacs for coding, this is my first attempt at modifying the code of Emacs itself, so please bear with me. I have noticed that the highlighting of -o switches in the *compilation* buffer (or rather the filename following any -o switch) does not properly handle some cases of extended switches. For example if it encounters "--omega" in the output, it will highligt "mega" as a file name. (If there had been just a single dash, like "-omega", then it would be correc= t to highligt "mega".) I have located the following regex inside compile.el: " --?o\\(?:utfile\\|utput\\)?[=3D ]?\\(\\S +\\)" It seems to me that this was thought to handle three cases: -o optionally followed by space or equal sign before filename --outfile followed by space or equal sign before filename --output followed by space or equal sign before filename However, the regex also matches cases such as: --o followed by any other characters "--omega" will highligt "mega" --output followed by any other characters (without space or equal) "--output-html-file" will highligt "-html-file" I do not think the two examples above should result in any highlighting, in fact i propose to limit the regex to the three initial cases only.=20 Please correct me if I have failed to consider other cases. I have attached a patch which changes the regex into: " -\\(o[=3D ]?\\|-\\(?:outfile\\|output\\)[=3D ]\\)\\(\\S +\\)" I have separated the regex into two cases, single dash followed by o and optional space or equal sign, or the other case of double dash followed b= y any of two long switch names and the mandatory space or equal sign. I do not (yet) subscribe to the emacs-devel list, so please cc me on any reply. Regards Jes Bodi Klinke =3D=3D=3D modified file 'lisp/progmodes/compile.el' *** lisp/progmodes/compile.el 2010-09-24 03:06:33 +0000 --- lisp/progmodes/compile.el 2010-10-27 20:44:03 +0000 *** 543,549 **** ;; Command output lines. Recognize `make[n]:' lines too. ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" (1 font-lock-function-name-face) (3 compilation-line-face nil t)) ! (" --?o\\(?:utfile\\|utput\\)?[=3D ]?\\(\\S +\\)" . 1) ("^Compilation \\(finished\\).*" (0 '(face nil message nil help-echo nil mouse-face nil) t) (1 compilation-info-face)) --- 543,549 ---- ;; Command output lines. Recognize `make[n]:' lines too. ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" (1 font-lock-function-name-face) (3 compilation-line-face nil t)) ! (" -\\(o[=3D ]?\\|-\\(?:outfile\\|output\\)[=3D ]\\)\\(\\S +\\)" .= 1) ("^Compilation \\(finished\\).*" (0 '(face nil message nil help-echo nil mouse-face nil) t) (1 compilation-info-face))