aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinicius Jose Latorre2007-11-12 03:00:25 +0000
committerVinicius Jose Latorre2007-11-12 03:00:25 +0000
commit4cbf3aa72e398b35ab2f0f5272e1642737472d39 (patch)
treebad5b01842693281632492244881b299450cf69d
parentdcb3ea403d68611a3f47fcbf2351677e2a0b1fa8 (diff)
downloademacs-4cbf3aa72e398b35ab2f0f5272e1642737472d39.tar.gz
emacs-4cbf3aa72e398b35ab2f0f5272e1642737472d39.zip
New files.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/compilation-perl.el121
-rw-r--r--lisp/progmodes/compilation-weblint.el111
3 files changed, 237 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7e826ed904a..28533a7a177 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12007-11-12 Kevin Ryde <user42@zip.com.au>
2
3 * progmodes/compilation-perl.el:
4 * progmodes/compilation-weblint.el: New files.
5
12007-11-11 Juanma Barranquero <lekktu@gmail.com> 62007-11-11 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * international/iso-cvt.el (iso-translate-conventions): Doc fix. 8 * international/iso-cvt.el (iso-translate-conventions): Doc fix.
diff --git a/lisp/progmodes/compilation-perl.el b/lisp/progmodes/compilation-perl.el
new file mode 100644
index 00000000000..8401062d13a
--- /dev/null
+++ b/lisp/progmodes/compilation-perl.el
@@ -0,0 +1,121 @@
1;;; compilation-perl.el --- error regexps for perl podchecker and Test
2
3;; Copyright (C) 2007 Free Software Foundation, Inc.
4
5;; Author: Kevin Ryde <user42@zip.com.au>
6;; Version: 1
7;; Keywords: processes
8;; URL: http://www.geocities.com/user42_kevin/compilation/index.html
9;; EmacsWiki: PerlLanguage
10
11;; This file is part of GNU Emacs.
12
13;; GNU Emacs is free software; you can redistribute it and/or modify
14;; it under the terms of the GNU General Public License as published by
15;; the Free Software Foundation; either version 3, or (at your option)
16;; any later version.
17
18;; GNU Emacs is distributed in the hope that it will be useful,
19;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;; GNU General Public License for more details.
22
23;; You should have received a copy of the GNU General Public License
24;; along with GNU Emacs; see the file COPYING. If not, write to the
25;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26;; Boston, MA 02110-1301, USA.
27
28;;; Commentary:
29
30;; This is a spot of code adding `compilation-error-regexp-alist'
31;; patterns for perl podchecker (the Pod::Checker module) and Test and
32;; Test::Harness module error output.
33;;
34;; Emacs already has patterns for perl's normal compile and run
35;; errors, but podchecker and Test are a bit different.
36
37;;; Install:
38
39;; Put compilation-perl.el somewhere in your `load-path', and in
40;; .emacs put
41;;
42;; (eval-after-load "compile" '(require 'compilation-perl))
43;;
44;; There's an autoload cookie below for this, if you use
45;; `update-file-autoloads' and friends.
46
47;;; Emacsen:
48
49;; Works in Emacs 22, Emacs 21, and XEmacs 21.
50
51;;; History:
52
53;; Version 1 - the first version.
54
55
56;;; Code:
57
58;;;###autoload (eval-after-load "compile" '(require 'compilation-perl))
59
60(eval-after-load "compile"
61 '(dolist
62 (elem
63 '(;; podchecker error messages, per Pod::Checker.
64 ;; The style is from the Pod::Checker::poderror() function, eg.
65 ;; *** ERROR: Spurious text after =cut at line 193 in file foo.pm
66 ;;
67 ;; Plus end_pod() can give "at line EOF" instead of a
68 ;; number, so for that match "on line N" which is the
69 ;; originating spot, eg.
70 ;; *** ERROR: =over on line 37 without closing =back at line EOF in file bar.pm
71 ;;
72 ;; Plus command() can give both "on line N" and "at line N";
73 ;; the latter is desired and is matched because the .* is
74 ;; greedy.
75 ;; *** ERROR: =over on line 1 without closing =back (at head1) at line 3 in file x.pod
76 ;;
77 (compilation-perl--Pod::Checker
78 "^\\*\\*\\* \\(?:ERROR\\|\\(WARNING\\)\\).* \\(?:at\\|on\\) line \\([0-9]+\\) \\(?:.* \\)?in file \\([^ \t\n]+\\)"
79 3 2 nil (1))
80
81 ;; perl Test module error messages.
82 ;; Style per the ok() function "$context", eg.
83 ;; # Failed test 1 in foo.t at line 6
84 ;;
85 (compilation-perl--Test
86 "^# Failed test [0-9]+ in \\([^ \t\r\n]+\\) at line \\([0-9]+\\)"
87 1 2)
88
89 ;; perl Test::Harness output, eg.
90 ;; NOK 1# Test 1 got: "1234" (t/foo.t at line 46)
91 ;;
92 ;; Test::Harness is slightly designed for tty output, since
93 ;; it prints CRs to overwrite progress messages, but if you
94 ;; run it in with M-x compile this pattern can at least step
95 ;; through the failures.
96 ;;
97 (compilation-perl--Test::Harness
98 "^.*NOK.* \\([^ \t\r\n]+\\) at line \\([0-9]+\\)"
99 1 2)))
100
101 (cond
102 ((boundp 'compilation-error-regexp-systems-list)
103 ;; xemacs21
104 (setq elem (remove '(1) elem)) ; drop "type" specifier
105 (add-to-list 'compilation-error-regexp-alist-alist
106 (list (car elem) (cdr elem)))
107 (compilation-build-compilation-error-regexp-alist))
108
109 ((boundp 'compilation-error-regexp-alist-alist)
110 ;; emacs22
111 (add-to-list 'compilation-error-regexp-alist-alist elem)
112 (add-to-list 'compilation-error-regexp-alist (car elem)))
113
114 (t
115 ;; emacs21
116 (setq elem (remove '(1) elem)) ; drop "type" specifier
117 (add-to-list 'compilation-error-regexp-alist (cdr elem))))))
118
119(provide 'compilation-perl)
120
121;;; compilation-perl.el ends here
diff --git a/lisp/progmodes/compilation-weblint.el b/lisp/progmodes/compilation-weblint.el
new file mode 100644
index 00000000000..284d457c3e6
--- /dev/null
+++ b/lisp/progmodes/compilation-weblint.el
@@ -0,0 +1,111 @@
1;;; compilation-weblint.el --- error regexps for weblint
2
3;; Copyright (C) 2007 Free Software Foundation, Inc.
4
5;; Author: Kevin Ryde <user42@zip.com.au>
6;; Version: 1
7;; Keywords: processes
8;; URL: http://www.geocities.com/user42_kevin/compilation/index.html
9;; EmacsWiki: CompilationMode
10
11;; This file is part of GNU Emacs.
12
13;; GNU Emacs is free software; you can redistribute it and/or modify
14;; it under the terms of the GNU General Public License as published by
15;; the Free Software Foundation; either version 3, or (at your option)
16;; any later version.
17
18;; GNU Emacs is distributed in the hope that it will be useful,
19;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;; GNU General Public License for more details.
22
23;; You should have received a copy of the GNU General Public License
24;; along with GNU Emacs; see the file COPYING. If not, write to the
25;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26;; Boston, MA 02110-1301, USA.
27
28;;; Commentary:
29
30;; This is a spot of code adding a `compilation-error-regexp-alist'
31;; pattern for messages from the weblint program (the one based on the
32;; perl HTML::Lint modules).
33
34;;; Install:
35
36;; Put compilation-weblint.el somewhere in your `load-path', and in
37;; .emacs put
38;;
39;; (eval-after-load "compile" '(require 'compilation-weblint))
40;;
41;; There's an autoload cookie below for this, if you use
42;; `update-file-autoloads' and friends.
43
44;;; Emacsen:
45
46;; Works in Emacs 22, Emacs 21, and XEmacs 21.
47
48;;; History:
49
50;; Version 1 - the first version.
51
52
53;;; Code:
54
55;;;###autoload (eval-after-load "compile" '(require 'compilation-weblint))
56
57(eval-after-load "compile"
58 '(progn
59 ;; The style comes from HTML::Lint::Error::as_string(), eg.
60 ;; index.html (13:1) Unknown element <fdjsk>
61 ;;
62 ;; The pattern only matches filenames without spaces, since that
63 ;; should be usual and should help reduce the chance of a false
64 ;; match of a message from some unrelated program.
65 ;;
66 ;; This message style is quite close to the "ibm" entry of
67 ;; emacs22 `compilation-error-regexp-alist-alist' which is for
68 ;; IBM C, though that ibm bit doesn't put a space after the
69 ;; filename.
70 ;;
71 (let ((elem '(compilation-weblint
72 "^\\([^ \t\r\n(]+\\) (\\([0-9]+\\):\\([0-9]+\\)) "
73 1 2 3)))
74
75 (cond
76 ((boundp 'compilation-error-regexp-systems-list)
77 ;; xemacs21
78 (add-to-list 'compilation-error-regexp-alist-alist
79 (list (car elem) (cdr elem)))
80 (compilation-build-compilation-error-regexp-alist))
81
82 ((boundp 'compilation-error-regexp-alist-alist)
83 ;; emacs22
84 (add-to-list 'compilation-error-regexp-alist-alist elem)
85 (add-to-list 'compilation-error-regexp-alist (car elem)))
86
87 (t
88 ;; emacs21
89 (add-to-list 'compilation-error-regexp-alist (cdr elem))
90
91 ;; Remove the "4.3BSD lint pass 3" element because it wrongly
92 ;; matches weblint messages. It's apparently supposed to
93 ;; match something like
94 ;;
95 ;; bloofle defined( /users/wolfgang/foo.c(4) ) ...
96 ;;
97 ;; but it's rather loose and ends up matching the "(13:1)"
98 ;; part from weblint as if "13" is the filename and "1" is
99 ;; the line number. Forcibly removing this is a bit nasty,
100 ;; but emacs22 has dropped it, so consider it an upgrade!
101 ;;
102 ;; xemacs21 has the same pattern, but somehow the problem
103 ;; doesn't arise, so leave it alone there, for now.
104 ;;
105 (setq compilation-error-regexp-alist
106 (remove '(".*([ \t]*\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\))" 1 2)
107 compilation-error-regexp-alist)))))))
108
109(provide 'compilation-weblint)
110
111;;; compilation-weblint.el ends here