86039
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
1 ;;; compilation-perl.el --- error regexps for perl podchecker and Test
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
2
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
3 ;; Copyright (C) 2007 Free Software Foundation, Inc.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
4
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
5 ;; Author: Kevin Ryde <user42@zip.com.au>
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
6 ;; Version: 1
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
7 ;; Keywords: processes
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
8 ;; URL: http://www.geocities.com/user42_kevin/compilation/index.html
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
9 ;; EmacsWiki: PerlLanguage
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
10
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
11 ;; This file is part of GNU Emacs.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
12
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
14 ;; it under the terms of the GNU General Public License as published by
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
15 ;; the Free Software Foundation; either version 3, or (at your option)
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
16 ;; any later version.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
17
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
18 ;; GNU Emacs is distributed in the hope that it will be useful,
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
21 ;; GNU General Public License for more details.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
22
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
23 ;; You should have received a copy of the GNU General Public License
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
26 ;; Boston, MA 02110-1301, USA.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
27
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
28 ;;; Commentary:
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
29
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
30 ;; This is a spot of code adding `compilation-error-regexp-alist'
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
31 ;; patterns for perl podchecker (the Pod::Checker module) and Test and
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
32 ;; Test::Harness module error output.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
33 ;;
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
34 ;; Emacs already has patterns for perl's normal compile and run
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
35 ;; errors, but podchecker and Test are a bit different.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
36
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
37 ;;; Install:
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
38
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
39 ;; Put compilation-perl.el somewhere in your `load-path', and in
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
40 ;; .emacs put
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
41 ;;
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
42 ;; (eval-after-load "compile" '(require 'compilation-perl))
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
43 ;;
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
44 ;; There's an autoload cookie below for this, if you use
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
45 ;; `update-file-autoloads' and friends.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
46
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
47 ;;; Emacsen:
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
48
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
49 ;; Works in Emacs 22, Emacs 21, and XEmacs 21.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
50
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
51 ;;; History:
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
52
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
53 ;; Version 1 - the first version.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
54
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
55
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
56 ;;; Code:
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
57
|
86042
|
58 ;;;DISABLE ###autoload (eval-after-load "compile" '(require 'compilation-perl))
|
86039
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
59
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
60 (eval-after-load "compile"
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
61 '(dolist
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
62 (elem
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
63 '(;; podchecker error messages, per Pod::Checker.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
64 ;; The style is from the Pod::Checker::poderror() function, eg.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
65 ;; *** ERROR: Spurious text after =cut at line 193 in file foo.pm
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
66 ;;
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
67 ;; Plus end_pod() can give "at line EOF" instead of a
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
68 ;; number, so for that match "on line N" which is the
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
69 ;; originating spot, eg.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
70 ;; *** ERROR: =over on line 37 without closing =back at line EOF in file bar.pm
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
71 ;;
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
72 ;; Plus command() can give both "on line N" and "at line N";
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
73 ;; the latter is desired and is matched because the .* is
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
74 ;; greedy.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
75 ;; *** ERROR: =over on line 1 without closing =back (at head1) at line 3 in file x.pod
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
76 ;;
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
77 (compilation-perl--Pod::Checker
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
78 "^\\*\\*\\* \\(?:ERROR\\|\\(WARNING\\)\\).* \\(?:at\\|on\\) line \\([0-9]+\\) \\(?:.* \\)?in file \\([^ \t\n]+\\)"
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
79 3 2 nil (1))
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
80
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
81 ;; perl Test module error messages.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
82 ;; Style per the ok() function "$context", eg.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
83 ;; # Failed test 1 in foo.t at line 6
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
84 ;;
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
85 (compilation-perl--Test
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
86 "^# Failed test [0-9]+ in \\([^ \t\r\n]+\\) at line \\([0-9]+\\)"
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
87 1 2)
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
88
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
89 ;; perl Test::Harness output, eg.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
90 ;; NOK 1# Test 1 got: "1234" (t/foo.t at line 46)
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
91 ;;
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
92 ;; Test::Harness is slightly designed for tty output, since
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
93 ;; it prints CRs to overwrite progress messages, but if you
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
94 ;; run it in with M-x compile this pattern can at least step
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
95 ;; through the failures.
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
96 ;;
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
97 (compilation-perl--Test::Harness
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
98 "^.*NOK.* \\([^ \t\r\n]+\\) at line \\([0-9]+\\)"
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
99 1 2)))
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
100
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
101 (cond
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
102 ((boundp 'compilation-error-regexp-systems-list)
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
103 ;; xemacs21
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
104 (setq elem (remove '(1) elem)) ; drop "type" specifier
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
105 (add-to-list 'compilation-error-regexp-alist-alist
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
106 (list (car elem) (cdr elem)))
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
107 (compilation-build-compilation-error-regexp-alist))
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
108
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
109 ((boundp 'compilation-error-regexp-alist-alist)
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
110 ;; emacs22
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
111 (add-to-list 'compilation-error-regexp-alist-alist elem)
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
112 (add-to-list 'compilation-error-regexp-alist (car elem)))
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
113
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
114 (t
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
115 ;; emacs21
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
116 (setq elem (remove '(1) elem)) ; drop "type" specifier
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
117 (add-to-list 'compilation-error-regexp-alist (cdr elem))))))
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
118
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
119 (provide 'compilation-perl)
|
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
120
|
86044
|
121 ;; arch-tag: 98818a96-69f4-4528-b9ea-4a357499a451
|
86039
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff
changeset
|
122 ;;; compilation-perl.el ends here
|