From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vinicius Jose Latorre Newsgroups: gmane.emacs.devel Subject: Re: [user42@zip.com.au: compilation regexps for perl and weblint] Date: Mon, 12 Nov 2007 01:03:44 -0300 Message-ID: <4737D0A0.4040100@ig.com.br> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1194836648 19652 80.91.229.12 (12 Nov 2007 03:04:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Nov 2007 03:04:08 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 12 04:04:11 2007 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.50) id 1IrPap-0003xY-On for ged-emacs-devel@m.gmane.org; Mon, 12 Nov 2007 04:04:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IrPad-0002Bv-Iz for ged-emacs-devel@m.gmane.org; Sun, 11 Nov 2007 22:03:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IrPab-0002Bo-0X for emacs-devel@gnu.org; Sun, 11 Nov 2007 22:03:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IrPaZ-0002Ak-QY for emacs-devel@gnu.org; Sun, 11 Nov 2007 22:03:52 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IrPaZ-0002Aa-MY for emacs-devel@gnu.org; Sun, 11 Nov 2007 22:03:51 -0500 Original-Received: from ro-out-1112.google.com ([72.14.202.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IrPaY-0007Op-SU for emacs-devel@gnu.org; Sun, 11 Nov 2007 22:03:51 -0500 Original-Received: by ro-out-1112.google.com with SMTP id p7so1291776roc for ; Sun, 11 Nov 2007 19:03:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=GbPi+iEo1mHhekIVVIXuVf879LACDr5/7b/2FHlCRc4=; b=OfBQGCVmnIY6/2OsFcFM5oc43FctUPcPyVmbwXb8x1pwybhNGY+Fgaz1qNOMzG/dWVx873KoyAOCV4HgL0WebPmy7KgA9cmhjgwsDor3HcBJdUtpiUAp2Z9Hg8EP6d8e6k3YCc49yqIxaF+zzi77ELops6H9K/PhlvmCv28u1v0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=QDxuU+I4Lr0HPDzM1TuRO/KBy6PrnocBSwrPiBfobcnsc8E73zYcNNekzy9NVyDuYFcJIEzy1tePus/+0Qb8MQORxB7MJL6BDEeYTwTnU4KObUJBdzuPxkTqxvX5MSxuXO/uk/r/VcMYH7oEFin/QbhKxom5QZtHvmLETPDV/0Y= Original-Received: by 10.100.248.9 with SMTP id v9mr558180anh.1194836629273; Sun, 11 Nov 2007 19:03:49 -0800 (PST) Original-Received: from ?192.168.0.100? ( [201.82.236.181]) by mx.google.com with ESMTPS id c40sm6029211anc.2007.11.11.19.03.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 11 Nov 2007 19:03:46 -0800 (PST) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8) Gecko/20071009 SeaMonkey/1.1.5 In-Reply-To: X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 (Google crawlbot) 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:83012 Archived-At: Richard Stallman wrote: > Would someone please install these error patterns in the trunk, > if they are correct? (I cannot tell if they are correct.) > > We have papers from Kevin Ryde. > Installed in the trunk. > ------- Start of forwarded message ------- > X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY > autolearn=failed version=3.1.0 > From: Kevin Ryde > To: gnu-emacs-sources@gnu.org > Organization: Bah Humbug > Date: Thu, 25 Oct 2007 10:38:01 +1000 > MIME-Version: 1.0 > Content-Type: multipart/mixed; boundary="=-=-=" > Subject: compilation regexps for perl and weblint > > - --=-=-= > > As part of my ongoing effort to get stuff out of my .emacs, this is a > few compilation-mode regexps I've had bouncing around, for perl > podchecker and Test, and for weblint (the one written in perl). Emacs > already matches perl's ordinary compile/run errors, but podchecker and > Test are a bit different. What ought to be four lines is rather > severely bloated by coping with different versions of emacs, but you get > that. > > > - --=-=-= > Content-Type: application/emacs-lisp > Content-Disposition: attachment; filename=compilation-perl.el > Content-Transfer-Encoding: quoted-printable > > ;;; compilation-perl.el --- error regexps for perl podchecker and Test > > ;; Copyright 2007 Kevin Ryde > > ;; Author: Kevin Ryde > ;; Version: 1 > ;; Keywords: processes > ;; URL: http://www.geocities.com/user42_kevin/compilation/index.html > ;; EmacsWiki: PerlLanguage > > ;; compilation-perl.el is free software; you can redistribute it and/or > ;; modify it under the terms of the GNU General Public License as published > ;; by the Free Software Foundation; either version 3, or (at your option) > ;; any later version. > ;; > ;; compilation-perl.el is distributed in the hope that it will be useful, > ;; but WITHOUT ANY WARRANTY; without even the implied warranty of > ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General > ;; Public License for more details. > ;; > ;; You can get a copy of the GNU General Public License online at > ;; . > > > ;;; Commentary: > > ;; This is a spot of code adding `compilation-error-regexp-alist' patterns > ;; for perl podchecker (the Pod::Checker module) and Test and Test::Harness > ;; module error output. > ;; > ;; Emacs already has patterns for perl's normal compile and run errors, but > ;; podchecker and Test are a bit different. > > ;;; Install: > > ;; Put compilation-perl.el somewhere in your `load-path', and in .emacs put > ;; > ;; (eval-after-load "compile" '(require 'compilation-perl)) > ;; > ;; There's an autoload cookie below for this, if you use > ;; `update-file-autoloads' and friends. > > ;;; Emacsen: > > ;; Works in Emacs 22, Emacs 21, and XEmacs 21. > > ;;; History: > > ;; Version 1 - the first version. > > > ;;; Code: > > ;;;###autoload (eval-after-load "compile" '(require 'compilation-perl)) > > (eval-after-load "compile" > '(dolist > (elem > '(;; podchecker error messages, per Pod::Checker. > ;; The style is from the Pod::Checker::poderror() function, eg. > ;; *** ERROR: Spurious text after =3Dcut at line 193 in file foo.= > pm > ;; > ;; Plus end_pod() can give "at line EOF" instead of a number, so > ;; for that match "on line N" which is the originating spot, eg. > ;; *** ERROR: =3Dover on line 37 without closing =3Dback at line = > EOF in file bar.pm > ;; > ;; Plus command() can give both "on line N" and "at line N"; the > ;; latter is desired and is matched because the .* is greedy. > ;; *** ERROR: =3Dover on line 1 without closing =3Dback (at head1= > ) at line 3 in file x.pod > ;; > (compilation-perl--Pod::Checker > "^\\*\\*\\* \\(?:ERROR\\|\\(WARNING\\)\\).* \\(?:at\\|on\\) line= > \\([0-9]+\\) \\(?:.* \\)?in file \\([^ \t\n]+\\)" > 3 2 nil (1)) > > ;; perl Test module error messages. > ;; Style per the ok() function "$context", eg. > ;; # Failed test 1 in foo.t at line 6 > ;; > (compilation-perl--Test > "^# Failed test [0-9]+ in \\([^ \t\r\n]+\\) at line \\([0-9]+\\)" > 1 2) > > ;; perl Test::Harness output, eg. > ;; NOK 1# Test 1 got: "1234" (t/foo.t at line 46) > ;; > ;; Test::Harness is slightly designed for tty output, since it > ;; prints CRs to overwrite progress messages, but if you run it in > ;; with M-x compile this pattern can at least step through the > ;; failures. > ;; > (compilation-perl--Test::Harness > "^.*NOK.* \\([^ \t\r\n]+\\) at line \\([0-9]+\\)" > 1 2))) > > (cond ((boundp 'compilation-error-regexp-systems-list) > ;; xemacs21 > (setq elem (remove '(1) elem)) ;; drop "type" specifier > (add-to-list 'compilation-error-regexp-alist-alist > (list (car elem) (cdr elem))) > (compilation-build-compilation-error-regexp-alist)) > > ((boundp 'compilation-error-regexp-alist-alist) > ;; emacs22 > (add-to-list 'compilation-error-regexp-alist-alist elem) > (add-to-list 'compilation-error-regexp-alist (car elem))) > > (t > ;; emacs21 > (setq elem (remove '(1) elem)) ;; drop "type" specifier > (add-to-list 'compilation-error-regexp-alist (cdr elem)))))) > > (provide 'compilation-perl) > > ;;; compilation-perl.el ends here > > - --=-=-= > Content-Type: application/emacs-lisp > Content-Disposition: attachment; filename=compilation-weblint.el > Content-Transfer-Encoding: quoted-printable > > ;;; compilation-weblint.el --- error regexps for weblint > > ;; Copyright 2007 Kevin Ryde > > ;; Author: Kevin Ryde > ;; Version: 1 > ;; Keywords: processes > ;; URL: http://www.geocities.com/user42_kevin/compilation/index.html > ;; EmacsWiki: CompilationMode > > ;; compilation-weblint.el is free software; you can redistribute it and/or > ;; modify it under the terms of the GNU General Public License as published > ;; by the Free Software Foundation; either version 3, or (at your option) > ;; any later version. > ;; > ;; compilation-weblint.el is distributed in the hope that it will be useful, > ;; but WITHOUT ANY WARRANTY; without even the implied warranty of > ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General > ;; Public License for more details. > ;; > ;; You can get a copy of the GNU General Public License online at > ;; . > > > ;;; Commentary: > > ;; This is a spot of code adding a `compilation-error-regexp-alist' pattern > ;; for messages from the weblint program (the one based on the perl > ;; HTML::Lint modules). > > ;;; Install: > > ;; Put compilation-weblint.el somewhere in your `load-path', and in .emacs = > put > ;; > ;; (eval-after-load "compile" '(require 'compilation-weblint)) > ;; > ;; There's an autoload cookie below for this, if you use > ;; `update-file-autoloads' and friends. > > ;;; Emacsen: > > ;; Works in Emacs 22, Emacs 21, and XEmacs 21. > > ;;; History: > > ;; Version 1 - the first version. > > > ;;; Code: > > ;;;###autoload (eval-after-load "compile" '(require 'compilation-weblint)) > > (eval-after-load "compile" > '(progn > ;; The style comes from HTML::Lint::Error::as_string(), eg. > ;; index.html (13:1) Unknown element > ;; > ;; The pattern only matches filenames without spaces, since that should > ;; be usual and should help reduce the chance of a false match of a > ;; message from some unrelated program. > ;; > ;; This message style is quite close to the "ibm" entry of emacs22 > ;; `compilation-error-regexp-alist-alist' which is for IBM C, though > ;; that ibm bit doesn't put a space after the filename. > ;; > (let ((elem '(compilation-weblint > "^\\([^ \t\r\n(]+\\) (\\([0-9]+\\):\\([0-9]+\\)) " > 1 2 3))) > > (cond ((boundp 'compilation-error-regexp-systems-list) > ;; xemacs21 > (add-to-list 'compilation-error-regexp-alist-alist > (list (car elem) (cdr elem))) > (compilation-build-compilation-error-regexp-alist)) > > ((boundp 'compilation-error-regexp-alist-alist) > ;; emacs22 > (add-to-list 'compilation-error-regexp-alist-alist elem) > (add-to-list 'compilation-error-regexp-alist (car elem))) > > (t > ;; emacs21 > (add-to-list 'compilation-error-regexp-alist (cdr elem)) > > ;; Remove the "4.3BSD lint pass 3" element because it wrongly > ;; matches weblint messages. It's apparently supposed to > ;; match something like > ;; > ;; bloofle defined( /users/wolfgang/foo.c(4) ) ... > ;; > ;; but it's rather loose and ends up matching the "(13:1)" > ;; part from weblint as if "13" is the filename and "1" is the > ;; line number. Forcibly removing this is a bit nasty, but > ;; emacs22 has dropped it, so consider it an upgrade! > ;; > ;; xemacs21 has the same pattern, but somehow the problem > ;; doesn't arise, so leave it alone there, for now. > ;; > (setq compilation-error-regexp-alist > (remove '(".*([ \t]*\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \= > t]*\\([0-9]+\\))" 1 2) > compilation-error-regexp-alist))))))) > > (provide 'compilation-weblint) > > ;;; compilation-weblint.el ends here > > - --=-=-= > > > - -- > "But I don't work Sundays or me day off." > > - --=-=-= > Content-Type: text/plain; charset="us-ascii" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Content-Disposition: inline > > _______________________________________________ > gnu-emacs-sources mailing list > gnu-emacs-sources@gnu.org > http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources > > - --=-=-=-- > ------- End of forwarded message ------- > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel > >