Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 104167. ------------------------------------------------------------ revno: 104167 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-08 21:25:35 -0400 message: Fix last change. diff: === modified file 'etc/compilation.txt' --- etc/compilation.txt 2011-05-09 01:24:57 +0000 +++ etc/compilation.txt 2011-05-09 01:25:35 +0000 @@ -47,7 +47,7 @@ The regexps found on http://ant.apache.org/faq.html, and since integrated in both Emacsen, were hairy. The extra two numbers for -jikes are the ending line and ending column, which we don't use. +jikes are the ending line and ending column. [javac] /src/DataBaseTestCase.java:27: unreported exception ... [javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally ------------------------------------------------------------ revno: 104166 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-08 21:24:57 -0400 message: Doc fix to compilation.txt. diff: === modified file 'etc/compilation.txt' --- etc/compilation.txt 2011-01-25 04:08:28 +0000 +++ etc/compilation.txt 2011-05-09 01:24:57 +0000 @@ -45,9 +45,9 @@ symbol: ant -The regexps found on http://ant.apache.org/faq.html, and since integrated in -both Emacsen, were hairy. Why so many numbers for jikes -- is one a column -number? +The regexps found on http://ant.apache.org/faq.html, and since +integrated in both Emacsen, were hairy. The extra two numbers for +jikes are the ending line and ending column, which we don't use. [javac] /src/DataBaseTestCase.java:27: unreported exception ... [javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally ------------------------------------------------------------ revno: 104165 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-08 21:24:00 -0400 message: Various fixes to compilation-error-regexp-alist-alist. * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): Fix the ant regexp to handle end-line and end-column info from jikes. Re-introduce maven regexp. Give the ruby-Test::Unit regexp a higher priority to avoid clobbering by gnu. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-08 20:07:38 +0000 +++ lisp/ChangeLog 2011-05-09 01:24:00 +0000 @@ -1,3 +1,10 @@ +2011-05-09 Chong Yidong + + * progmodes/compile.el (compilation-error-regexp-alist-alist): Fix + the ant regexp to handle end-line and end-column info from jikes. + Re-introduce maven regexp. Give the ruby-Test::Unit regexp a + higher priority to avoid clobbering by gnu. + 2011-05-08 Chong Yidong * cus-face.el (custom-declare-face): Call custom-theme-recalc-face === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2011-05-08 05:17:17 +0000 +++ lisp/progmodes/compile.el 2011-05-09 01:24:00 +0000 @@ -126,6 +126,9 @@ (defvar compilation-num-errors-found) +;; If you make any changes to `compilation-error-regexp-alist-alist', +;; be sure to run the ERT test in test/automated/compile-tests.el. + (defvar compilation-error-regexp-alist-alist '((absoft "^\\(?:[Ee]rror on \\|[Ww]arning on\\( \\)\\)?[Ll]ine[ \t]+\\([0-9]+\\)[ \t]+\ @@ -138,8 +141,8 @@ " in line \\([0-9]+\\) of file \\([^ \n]+[^. \n]\\)\\.? " 2 1) (ant - "^[ \t]*\\[[^] \n]+\\][ \t]*\\([^: \n]+\\):\\([0-9]+\\):\\(?:\\([0-9]+\\):[0-9]+:[0-9]+:\\)?\ -\\( warning\\)?" 1 2 3 (4)) + "^[ \t]*\\[[^] \n]+\\][ \t]*\\([^: \n]+\\):\\([0-9]+\\):\\(?:\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\):\\)?\ +\\( warning\\)?" 1 (2 . 4) (3 . 5) (4)) (bash "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2) @@ -194,6 +197,14 @@ (jikes-file "^\\(?:Found\\|Issued\\) .* compiling \"\\(.+\\)\":$" 1 nil nil 0) + + + ;; This used to be pathologically slow on long lines (Bug#3441), + ;; due to matching filenames via \\(.*?\\). This might be faster. + (maven + ;; Maven is a popular free software build tool for Java. + "\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\] " 1 2 3) + (jikes-line "^ *\\([0-9]+\\)\\.[ \t]+.*\n +\\(<-*>\n\\*\\*\\* \\(?:Error\\|Warnin\\(g\\)\\)\\)" nil 1 nil 2 0 @@ -205,6 +216,9 @@ \\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?\\(?:\\(:\\)\\|\\(,\\|$\\)\\)?" 1 2 3 (4 . 5)) + (ruby-Test::Unit + "^[\t ]*\\[\\([^\(].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2) + (gnu ;; The first line matches the program name for @@ -257,11 +271,6 @@ (end-of-line) nil))) - ;; This regexp is pathologically slow on long lines (Bug#3441). - ;; (maven - ;; ;; Maven is a popular build tool for Java. Maven is Free Software. - ;; "\\(.*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\]" 1 2 3) - ;; Should be lint-1, lint-2 (SysV lint) (mips-1 " (\\([0-9]+\\)) in \\([^ \n]+\\)" 2 1) @@ -302,9 +311,6 @@ "\\(?:Parse\\|Fatal\\) error: \\(.*\\) in \\(.*\\) on line \\([0-9]+\\)" 2 3 nil nil) - (ruby-Test::Unit - "[\t ]*\\[\\([^\(].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:$" 1 2) - (rxp "^\\(?:Error\\|Warnin\\(g\\)\\):.*\n.* line \\([0-9]+\\) char\ \\([0-9]+\\) of file://\\(.+\\)" ------------------------------------------------------------ revno: 104164 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-08 21:22:05 -0400 message: Add regression test for compilation-error-regexp-alist-alist. * test/automated/compile-tests.el: New file. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2011-05-08 21:43:07 +0000 +++ test/ChangeLog 2011-05-09 01:22:05 +0000 @@ -1,3 +1,7 @@ +2011-05-09 Chong Yidong + + * automated/compile-tests.el: New file. + 2011-05-08 Chong Yidong * automated/font-parse-tests.el: Don't byte-compile. === added file 'test/automated/compile-tests.el' --- test/automated/compile-tests.el 1970-01-01 00:00:00 +0000 +++ test/automated/compile-tests.el 2011-05-09 01:22:05 +0000 @@ -0,0 +1,348 @@ +;;; compile-tests.el --- Test suite for font parsing. + +;; Copyright (C) 2011 Free Software Foundation, Inc. + +;; Author: Chong Yidong +;; Keywords: internal +;; Human-Keywords: internal + +;; This file is part of GNU Emacs. + +;; GNU Emacs 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 of the License, or +;; (at your option) any later version. + +;; GNU Emacs 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 should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Code: + +(require 'ert) +(require 'compile) + +(defvar compile-tests--test-regexps-data + ;; The computed column numbers are zero-indexed, so subtract 1 from + ;; what's reported in the string. The end column numbers are for + ;; the character after, so it matches what's reported in the string. + '(;; absoft + ("Error on line 3 of t.f: Execution error unclassifiable statement" + 1 nil 3 "t.f") + ("Line 45 of \"foo.c\": bloofle undefined" + 1 nil 45 "foo.c") + ("error on line 19 of fplot.f: spelling error?" + 1 nil 19 "fplot.f") + ("warning on line 17 of fplot.f: data type is undefined for variable d" + 1 nil 17 "fplot.f") + ;; Ada & Mpatrol + ("foo.adb:61:11: [...] in call to size declared at foo.ads:11" + 1 10 61 "foo.adb") + ("foo.adb:61:11: [...] in call to size declared at foo.ads:11" + 52 nil 11 "foo.ads") + (" 0x8008621 main+16 at error.c:17" + 23 nil 17 "error.c") + ;; aix + ("****** Error number 140 in line 8 of file errors.c ******" + 25 nil 8 "errors.c") + ;; ant + ("[javac] /src/DataBaseTestCase.java:27: unreported exception ..." + 13 nil 27 "/src/DataBaseTestCase.java") + ("[javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally" + 13 nil 49 "/src/DataBaseTestCase.java") + ("[jikes] foo.java:3:5:7:9: blah blah" + 14 (4 . 9) (3 . 7) "foo.java") + ;; bash + ("a.sh: line 1: ls-l: command not found" + 1 nil 1 "a.sh") + ;; borland + ("Error ping.c 15: Unable to open include file 'sys/types.h'" + 1 nil 15 "ping.c") + ("Warning pong.c 68: Call to function 'func' with no prototype" + 1 nil 68 "pong.c") + ("Error E2010 ping.c 15: Unable to open include file 'sys/types.h'" + 1 nil 15 "ping.c") + ("Warning W1022 pong.c 68: Call to function 'func' with no prototype" + 1 nil 68 "pong.c") + ;; caml + ("File \"foobar.ml\", lines 5-8, characters 20-155: blah blah" + 1 (19 . 155) (5 . 8) "foobar.ml") + ("File \"F:\\ocaml\\sorting.ml\", line 65, characters 2-145:" + 1 (1 . 145) 65 "F:\\ocaml\\sorting.ml") + ("File \"/usr/share/gdesklets/display/TargetGauge.py\", line 41, in add_children" + 1 nil 41 "/usr/share/gdesklets/display/TargetGauge.py") + ("File \\lib\\python\\Products\\PythonScripts\\PythonScript.py, line 302, in _exec" + 1 nil 302 "\\lib\\python\\Products\\PythonScripts\\PythonScript.py") + ("File \"/tmp/foo.py\", line 10" + 1 nil 10 "/tmp/foo.py") + ;; comma + ("\"foo.f\", line 3: Error: syntax error near end of statement" + 1 nil 3 "foo.f") + ("\"vvouch.c\", line 19.5: 1506-046 (S) Syntax error." + 1 4 19 "vvouch.c") + ("\"foo.c\", line 32 pos 1; (E) syntax error; unexpected symbol: \"lossage\"" + 1 0 32 "foo.c") + ("\"foo.adb\", line 2(11): warning: file name does not match ..." + 1 10 2 "foo.adb") + ("\"src/swapping.c\", line 30.34: 1506-342 (W) \"/*\" detected in comment." + 1 33 30 "src/swapping.c") + ;; cucumber + ("Scenario: undefined step # features/cucumber.feature:3" + 29 nil 3 "features/cucumber.feature") + (" /home/gusev/.rvm/foo/bar.rb:500:in `_wrap_assertion'" + 1 nil 500 "/home/gusev/.rvm/foo/bar.rb") + ;; edg-1 edg-2 + ("build/intel/debug/../../../struct.cpp(42): error: identifier \"foo\" is undefined" + 1 nil 42 "build/intel/debug/../../../struct.cpp") + ("build/intel/debug/struct.cpp(44): warning #1011: missing return statement at end of" + 1 nil 44 "build/intel/debug/struct.cpp") + ("build/intel/debug/iptr.h(302): remark #981: operands are evaluated in unspecified order" + 1 nil 302 "build/intel/debug/iptr.h") + (" detected during ... at line 62 of \"build/intel/debug/../../../trace.h\"" + 31 nil 62 "build/intel/debug/../../../trace.h") + ;; epc + ("Error 24 at (2:progran.f90) : syntax error" + 1 nil 2 "progran.f90") + ;; ftnchek + (" Dummy arg W in module SUBA line 8 file arrayclash.f is array" + 32 nil 8 "arrayclash.f") + (" L4 used at line 55 file test/assign.f; never set" + 16 nil 55 "test/assign.f") + ("Warning near line 10 file arrayclash.f: Module contains no executable" + 1 nil 10 "arrayclash.f") + ("Nonportable usage near line 31 col 9 file assign.f: mixed default and explicit" + 24 8 31 "assign.f") + ;; iar + ("\"foo.c\",3 Error[32]: Error message" + 1 nil 3 "foo.c") + ("\"foo.c\",3 Warning[32]: Error message" + 1 nil 3 "foo.c") + ;; ibm + ("foo.c(2:0) : informational EDC0804: Function foo is not referenced." + 1 -1 2 "foo.c") + ("foo.c(3:8) : warning EDC0833: Implicit return statement encountered." + 1 7 3 "foo.c") + ("foo.c(5:5) : error EDC0350: Syntax error." + 1 4 5 "foo.c") + ;; irix + ("ccom: Error: foo.c, line 2: syntax error" + 1 nil 2 "foo.c") + ("cc: Severe: /src/Python-2.3.3/Modules/_curses_panel.c, line 17: Cannot find file ..." + 1 nil 17 "/src/Python-2.3.3/Modules/_curses_panel.c") + ("cc: Info: foo.c, line 27: ..." + 1 nil 27 "foo.c") + ("cfe: Warning 712: foo.c, line 2: illegal combination of pointer and ..." + 1 nil 2 "foo.c") + ("cfe: Warning 600: xfe.c: 170: Not in a conditional directive while ..." + 1 nil 170 "xfe.c") + ("/usr/lib/cmplrs/cc/cfe: Error: foo.c: 1: blah blah" + 1 nil 1 "foo.c") + ("/usr/lib/cmplrs/cc/cfe: warning: foo.c: 1: blah blah" + 1 nil 1 "foo.c") + ("foo bar: baz.f, line 27: ..." + 1 nil 27 "baz.f") + ;; java + ("\tat org.foo.ComponentGateway.doGet(ComponentGateway.java:172)" + 5 nil 172 "ComponentGateway.java") + ("\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:740)" + 5 nil 740 "HttpServlet.java") + ("==1332== at 0x4040743C: System::getErrorString() (../src/Lib/System.cpp:217)" + 13 nil 217 "../src/Lib/System.cpp") + ("==1332== by 0x8008621: main (vtest.c:180)" + 13 nil 180 "vtest.c") + ;; jikes-file jikes-line + ("Found 2 semantic errors compiling \"../javax/swing/BorderFactory.java\":" + 1 nil nil "../javax/swing/BorderFactory.java") + ("Issued 1 semantic warning compiling \"java/awt/Toolkit.java\":" + 1 nil nil "java/awt/Toolkit.java") + ;; gcc-include + ("In file included from /usr/include/c++/3.3/backward/warn.h:4," + 1 nil 4 "/usr/include/c++/3.3/backward/warn.h") + (" from /usr/include/c++/3.3/backward/iostream.h:31:0," + 1 -1 31 "/usr/include/c++/3.3/backward/iostream.h") + (" from test_clt.cc:1:" + 1 nil 1 "test_clt.cc") + ;; gnu + ("foo.c:8: message" 1 nil 8 "foo.c") + ("../foo.c:8: W: message" 1 nil 8 "../foo.c") + ("/tmp/foo.c:8:warning message" 1 nil 8 "/tmp/foo.c") + ("foo/bar.py:8: FutureWarning message" 1 nil 8 "foo/bar.py") + ("foo.py:8: RuntimeWarning message" 1 nil 8 "foo.py") + ("foo.c:8:I: message" 1 nil 8 "foo.c") + ("foo.c:8.23: note: message" 1 22 8 "foo.c") + ("foo.c:8.23: info: message" 1 22 8 "foo.c") + ("foo.c:8:23:information: message" 1 22 8 "foo.c") + ("foo.c:8.23-45: Informational: message" 1 (22 . nil) (8 . 45) "foo.c") + ("foo.c:8-23: message" 1 nil (8 . 23) "foo.c") + ("foo.c:8-45.3: message" 1 (nil . 3) (8 . 45) "foo.c") + ("foo.c:8.23-9.1: message" 1 (22 . 1) (8 . 9) "foo.c") + ("jade:dbcommon.dsl:133:17:E: missing argument for function call" + 1 16 133 "dbcommon.dsl") + ("G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found." + 1 nil 54 "G:/cygwin/dev/build-myproj.xml") + ("file:G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found." + 1 nil 54 "G:/cygwin/dev/build-myproj.xml") + ("{standard input}:27041: Warning: end of file not at end of a line; newline inserted" + 1 nil 27041 "{standard input}") + ;; lcc + ("E, file.cc(35,52) Illegal operation on pointers" 1 51 35 "file.cc") + ("W, file.cc(36,52) blah blah" 1 51 36 "file.cc") + ;; makepp + ("makepp: Scanning `/foo/bar.c'" 19 nil nil "/foo/bar.c") + ("makepp: warning: bla bla `/foo/bar.c' and `/foo/bar.h'" 27 nil nil "/foo/bar.c") + ("makepp: bla bla `/foo/Makeppfile:12' bla" 18 nil 12 "/foo/Makeppfile") + ("makepp: bla bla `/foo/bar.c' and `/foo/bar.h'" 35 nil nil "/foo/bar.h") + ;; maven + ("FooBar.java:[111,53] no interface expected here" + 1 52 111 "FooBar.java") + ;; mips-1 mips-2 + ("TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomo.c due to truncation" + 11 nil 255 "solomon.c") + ("TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomo.c due to truncation" + 70 nil 93 "solomo.c") + ("name defined but never used: LinInt in cmap_calc.c(199)" + 40 nil 199 "cmap_calc.c") + ;; msft + ("keyboard handler.c(537) : warning C4005: 'min' : macro redefinition" + 1 nil 537 "keyboard handler.c") + ("d:\\tmp\\test.c(23) : error C2143: syntax error : missing ';' before 'if'" + 1 nil 23 "d:\\tmp\\test.c") + ("d:\\tmp\\test.c(1145) : see declaration of 'nsRefPtr'" + 1 nil 1145 "d:\\tmp\\test.c") + ;; watcom + ("..\src\ctrl\lister.c(109): Error! E1009: Expecting ';' but found '{'" + 1 nil 109 "..\src\ctrl\lister.c") + ("..\src\ctrl\lister.c(120): Warning! W201: Unreachable code" + 1 nil 120 "..\src\ctrl\lister.c") + ;; oracle + ("Semantic error at line 528, column 5, file erosacqdb.pc:" + 1 4 528 "erosacqdb.pc") + ("Error at line 41, column 10 in file /usr/src/sb/ODBI_BHP.hpp" + 1 9 41 "/usr/src/sb/ODBI_BHP.hpp") + ("PCC-02150: error at line 49, column 27 in file /usr/src/sb/ODBI_dxfgh.pc" + 1 26 49 "/usr/src/sb/ODBI_dxfgh.pc") + ("PCC-00003: invalid SQL Identifier at column name in line 12 of file /usr/src/sb/ODBI_BHP.hpp" + 1 nil 12 "/usr/src/sb/ODBI_BHP.hpp") + ("PCC-00004: mismatched IF/ELSE/ENDIF block at line 27 in file /usr/src/sb/ODBI_BHP.hpp" + 1 nil 27 "/usr/src/sb/ODBI_BHP.hpp") + ("PCC-02151: line 21 column 40 file /usr/src/sb/ODBI_BHP.hpp:" + 1 39 21 "/usr/src/sb/ODBI_BHP.hpp") + ;; perl + ("syntax error at automake line 922, near \"':'\"" + 14 nil 922 "automake") + ("Died at test.pl line 27." + 6 nil 27 "test.pl") + ("store::odrecall('File_A', 'x2') called at store.pm line 90" + 40 nil 90 "store.pm") + ("\t(in cleanup) something bad at foo.pl line 3 during global destruction." + 29 nil 3 "foo.pl") + ("GLib-GObject-WARNING **: /build/buildd/glib2.0-2.14.5/gobject/gsignal.c:1741: instance `0x8206790' has no handler with id `1234' at t-compilation-perl-gtk.pl line 3." + 130 nil 3 "t-compilation-perl-gtk.pl") + ;; php + ("Parse error: parse error, unexpected $ in main.php on line 59" + 1 nil 59 "main.php") + ("Fatal error: Call to undefined function: mysql_pconnect() in db.inc on line 66" + 1 nil 66 "db.inc") + ;; ruby + ("plain-exception.rb:7:in `fun': unhandled exception" + 1 nil 7 "plain-exception.rb") + ("\tfrom plain-exception.rb:3:in `proxy'" 2 nil 3 "plain-exception.rb") + ("\tfrom plain-exception.rb:12" 2 nil 12 "plain-exception.rb") + ;; ruby-Test::Unit + ;; FIXME + (" [examples/test-unit.rb:28:in `here_is_a_deep_assert'" + 5 nil 28 "examples/test-unit.rb") + (" examples/test-unit.rb:19:in `test_a_deep_assert']:" + 6 nil 19 "examples/test-unit.rb") + ("examples/test-unit.rb:10:in `test_assert_raise'" + 1 nil 10 "examples/test-unit.rb") + ;; rxp + ("Error: Mismatched end tag: expected , got \nin unnamed entity at line 71 char 8 of file:///home/reto/test/group.xml" + 1 7 71 "/home/reto/test/group.xml") + ("Warning: Start tag for undeclared element geroup\nin unnamed entity at line 4 char 8 of file:///home/reto/test/group.xml" + 1 7 4 "/home/reto/test/group.xml") + ;; sparc-pascal-file sparc-pascal-line sparc-pascal-example + ("Thu May 14 10:46:12 1992 mom3.p:" + 1 nil nil "mom3.p") + ;; sun + ("cc-1020 CC: REMARK File = CUI_App.h, Line = 735" + 13 nil 735 "CUI_App.h") + ("cc-1070 cc: WARNING File = linkl.c, Line = 38" + 13 nil 38 "linkl.c") + ("cf90-113 f90comp: ERROR NSE, File = Hoved.f90, Line = 16, Column = 3" + 18 2 16 "Hoved.f90") + ;; sun-ada + ("/home3/xdhar/rcds_rc/main.a, line 361, char 6:syntax error: \",\" inserted" + 1 5 361 "/home3/xdhar/rcds_rc/main.a") + ;; 4bsd + ("/usr/src/foo/foo.c(8): warning: w may be used before set" + 1 nil 8 "/usr/src/foo/foo.c") + ("/usr/src/foo/foo.c(9): error: w is used before set" + 1 nil 9 "/usr/src/foo/foo.c") + ("strcmp: variable # of args. llib-lc(359) :: /usr/src/foo/foo.c(8)" + 44 nil 8 "/usr/src/foo/foo.c") + ("bloofle defined( /users/wolfgang/foo.c(4) ), but never used" + 18 nil 4 "/users/wolfgang/foo.c") + ;; perl--Pod::Checker + ;; FIXME + ;; *** ERROR: Spurious text after =cut at line 193 in file foo.pm + ;; *** ERROR: =over on line 37 without closing =back at line EOF in file bar.pm + ;; *** ERROR: =over on line 1 without closing =back (at head1) at line 3 in file x.pod + ;; perl--Test + ("# Failed test 1 in foo.t at line 6" + 1 nil 6 "foo.t") + ;; perl--Test::Harness + ("NOK 1# Test 1 got: \"1234\" (t/foo.t at line 46)" + 1 nil 46 "t/foo.t") + ;; weblint + ("index.html (13:1) Unknown element " + 1 0 13 "index.html")) + "List of tests for `compilation-error-regexp-alist'. +Each element has the form (STR POS COLUMN LINE FILENAME), where +STR is an error string, POS is the position of the error in STR, +COLUMN and LINE are the reported column and line numbers (or nil) +for that error, and FILENAME is the reported filename. + +LINE can also be of the form (LINE . END-LINE) meaning a range of +lines. COLUMN can also be of the form (COLUMN . END-COLUMN) +meaning a range of columns starting on LINE and ending on +END-LINE, if that matched.") + +(defun compile--test-error-line (test) + (erase-buffer) + (setq compilation-locs (make-hash-table)) + (insert (car test)) + (compilation-parse-errors (point-min) (point-max)) + (let ((msg (get-text-property (nth 1 test) 'compilation-message))) + (when msg + (let ((loc (compilation--message->loc msg)) + (col (nth 2 test)) + (line (nth 3 test)) + (file (nth 4 test)) + end-col end-line) + (if (consp col) + (setq end-col (cdr col) col (car col))) + (if (consp line) + (setq end-line (cdr line) line (car line))) + (and (equal (compilation--loc->col loc) col) + (equal (compilation--loc->line loc) line) + (equal (caar (compilation--loc->file-struct loc)) file) + (or (null end-col) + (equal (car (cadr (nth 2 (compilation--loc->file-struct loc)))) + end-col)) + (equal (car (nth 2 (compilation--loc->file-struct loc))) + (or end-line line))))))) + +(ert-deftest compile-test-error-regexps () + "Test the `compilation-error-regexp-alist' regexps. +The test data is in `compile-tests--test-regexps-data'." + (with-temp-buffer + (font-lock-mode -1) + (dolist (test compile-tests--test-regexps-data) + (should (compile--test-error-line test))))) + +;;; compile-tests.el ends here. ------------------------------------------------------------ revno: 104163 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-08 17:43:07 -0400 message: Convert test/comint-testsuite.el to ERT format. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2011-04-06 12:18:10 +0000 +++ test/ChangeLog 2011-05-08 21:43:07 +0000 @@ -1,3 +1,9 @@ +2011-05-08 Chong Yidong + + * automated/font-parse-tests.el: Don't byte-compile. + + * automated/comint-testsuite.el: Move from test/. Convert to ERT. + 2011-03-10 Stefan Monnier * automated/lexbind-tests.el: New file. === renamed file 'test/comint-testsuite.el' => 'test/automated/comint-testsuite.el' --- test/comint-testsuite.el 2011-01-25 04:08:28 +0000 +++ test/automated/comint-testsuite.el 2011-05-08 21:43:07 +0000 @@ -1,4 +1,4 @@ -;;; bytecomp-testsuite.el +;;; comint-testsuite.el ;; Copyright (C) 2010-2011 Free Software Foundation, Inc. @@ -24,37 +24,29 @@ ;;; Code: (require 'comint) - -(defun comint-testsuite-run () - (interactive) - (with-output-to-temp-buffer "*comint test*" - (comint-testsuite--test-comint-password-prompt-regexp))) - -(defun comint-testsuite--test-comint-password-prompt-regexp () - (interactive) - (let ((password-strings - '("foo@example.net's password: " ;ssh - "Password for foo@example.org: " ; kinit - "Please enter the password for foo@example.org: " ; kinit - "Kerberos password for devnull/root GNU.ORG: " ; ksu - "Enter passphrase: " ; ssh-add - "Enter passphrase (empty for no passphrase): " ; ssh-keygen - "Enter same passphrase again: " ; ssh-keygen - "Passphrase for key root@GNU.ORG: " ; plink - "[sudo] password for user:" ; Ubuntu sudo - "Password (again):" - "Enter password:")) - fail) - (dolist (str password-strings) - (unless (string-match comint-password-prompt-regexp str) - (setq fail t) - (princ (format " ERROR: comint-password-prompt-regexp did not match %s\n" - str)))) - (if fail - (princ "FAILED: comint-password-prompt-regexp test\n") - (princ "PASSED: comint-password-prompt-regexp test\n")))) - -(provide 'comint-testsuite) +(require 'ert) + +(defvar comint-testsuite-password-strings + '("foo@example.net's password: " ;ssh + "Password for foo@example.org: " ; kinit + "Please enter the password for foo@example.org: " ; kinit + "Kerberos password for devnull/root GNU.ORG: " ; ksu + "Enter passphrase: " ; ssh-add + "Enter passphrase (empty for no passphrase): " ; ssh-keygen + "Enter same passphrase again: " ; ssh-keygen + "Passphrase for key root@GNU.ORG: " ; plink + "[sudo] password for user:" ; Ubuntu sudo + "Password (again):" + "Enter password:") + "List of strings that should match `comint-password-prompt-regexp'.") + +(ert-deftest comint-test-password-regexp () + "Test `comint-password-prompt-regexp' against common password strings." + (dolist (str comint-testsuite-password-strings) + (should (string-match comint-password-prompt-regexp str)))) + +;; Local Variables: +;; no-byte-compile: t +;; End: ;;; comint-testsuite.el ends here - === modified file 'test/automated/font-parse-tests.el' --- test/automated/font-parse-tests.el 2011-02-14 21:21:42 +0000 +++ test/automated/font-parse-tests.el 2011-05-08 21:43:07 +0000 @@ -158,4 +158,8 @@ (insert "\n")))) (goto-char (point-min))) +;; Local Variables: +;; no-byte-compile: t +;; End: + ;;; font-parse-tests.el ends here. ------------------------------------------------------------ revno: 104162 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-08 16:07:38 -0400 message: Handle calling defface on a face with existing theme settings (Bug#8454). * lisp/cus-face.el (custom-declare-face): Call custom-theme-recalc-face if the face has existing theme settings. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-08 18:34:51 +0000 +++ lisp/ChangeLog 2011-05-08 20:07:38 +0000 @@ -1,3 +1,8 @@ +2011-05-08 Chong Yidong + + * cus-face.el (custom-declare-face): Call custom-theme-recalc-face + if the face has existing theme settings (Bug#8454). + 2011-05-08 Ralph Schleicher * progmodes/perl-mode.el (perl-imenu-generic-expression): Only === modified file 'lisp/cus-face.el' --- lisp/cus-face.el 2011-04-07 23:59:27 +0000 +++ lisp/cus-face.el 2011-05-08 20:07:38 +0000 @@ -34,28 +34,30 @@ (defun custom-declare-face (face spec doc &rest args) "Like `defface', but FACE is evaluated as a normal argument." (unless (get face 'face-defface-spec) - (when (fboundp 'facep) - (unless (facep face) - ;; If the user has already created the face, respect that. - (let ((value (or (get face 'saved-face) spec)) - (have-window-system (memq initial-window-system '(x w32)))) - ;; Create global face. - (make-empty-face face) - ;; Create frame-local faces - (dolist (frame (frame-list)) - (face-spec-set-2 face frame value) - (when (memq (window-system frame) '(x w32 ns)) - (setq have-window-system t))) - ;; When making a face after frames already exist - (if have-window-system - (make-face-x-resource-internal face))))) + (unless (facep face) + ;; If the user has already created the face, respect that. + (let ((value (or (get face 'saved-face) spec)) + (have-window-system (memq initial-window-system '(x w32)))) + ;; Create global face. + (make-empty-face face) + ;; Create frame-local faces + (dolist (frame (frame-list)) + (face-spec-set-2 face frame value) + (when (memq (window-system frame) '(x w32 ns)) + (setq have-window-system t))) + ;; When making a face after frames already exist + (if have-window-system + (make-face-x-resource-internal face)))) ;; Don't record SPEC until we see it causes no errors. (put face 'face-defface-spec (purecopy spec)) (push (cons 'defface face) current-load-list) (when (and doc (null (face-documentation face))) (set-face-documentation face (purecopy doc))) (custom-handle-all-keywords face args 'custom-face) - (run-hooks 'custom-define-hook)) + (run-hooks 'custom-define-hook) + ;; If the face has an existing theme setting, recalculate it. + (if (get face 'theme-face) + (custom-theme-recalc-face face))) face) ;;; Face attributes. ------------------------------------------------------------ revno: 104161 author: Ralph Schleicher committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-08 14:34:51 -0400 message: Expand file names during browse-url-of-dired-file (Bug#8259). * lisp/net/browse-url.el (browse-url-of-dired-file): Allow browsing of special file names `.' and `..'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-08 18:23:11 +0000 +++ lisp/ChangeLog 2011-05-08 18:34:51 +0000 @@ -3,6 +3,9 @@ * progmodes/perl-mode.el (perl-imenu-generic-expression): Only match variables declared via `my' or `our' (Bug#8261). + * net/browse-url.el (browse-url-of-dired-file): Allow browsing of + special file names `.' and `..' (Bug#8259). + 2011-05-08 Chong Yidong * progmodes/grep.el (grep-mode-font-lock-keywords): Remove === modified file 'lisp/net/browse-url.el' --- lisp/net/browse-url.el 2011-04-08 03:26:40 +0000 +++ lisp/net/browse-url.el 2011-05-08 18:34:51 +0000 @@ -769,7 +769,10 @@ (defun browse-url-of-dired-file () "In Dired, ask a WWW browser to display the file named on this line." (interactive) - (browse-url-of-file (dired-get-filename))) + (let ((tem (dired-get-filename t t))) + (if tem + (browse-url-of-file (expand-file-name tem)) + (error "No file on this line")))) ;;;###autoload (defun browse-url-of-region (min max) ------------------------------------------------------------ revno: 104160 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-08 14:23:11 -0400 message: Handle "my" and "our" keywords in Perl imenu (Bug#8261). * progmodes/perl-mode.el (perl-imenu-generic-expression): Only match variables declared via `my' or `our'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-08 05:17:17 +0000 +++ lisp/ChangeLog 2011-05-08 18:23:11 +0000 @@ -1,3 +1,8 @@ +2011-05-08 Ralph Schleicher + + * progmodes/perl-mode.el (perl-imenu-generic-expression): Only + match variables declared via `my' or `our' (Bug#8261). + 2011-05-08 Chong Yidong * progmodes/grep.el (grep-mode-font-lock-keywords): Remove === modified file 'lisp/progmodes/perl-mode.el' --- lisp/progmodes/perl-mode.el 2011-04-22 18:44:26 +0000 +++ lisp/progmodes/perl-mode.el 2011-05-08 18:23:11 +0000 @@ -166,7 +166,7 @@ '(;; Functions (nil "^sub\\s-+\\([-A-Za-z0-9+_:]+\\)" 1) ;;Variables - ("Variables" "^\\([$@%][-A-Za-z0-9+_:]+\\)\\s-*=" 1) + ("Variables" "^\\(?:my\\|our\\)\\s-+\\([$@%][-A-Za-z0-9+_:]+\\)\\s-*=" 1) ("Packages" "^package\\s-+\\([-A-Za-z0-9+_:]+\\);" 1) ("Doc sections" "^=head[0-9][ \t]+\\(.*\\)" 1)) "Imenu generic expression for Perl mode. See `imenu-generic-expression'.") ------------------------------------------------------------ revno: 104159 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-05-08 01:17:17 -0400 message: Perform grep-mode's buffer modifications in a process filter (Bug#7952) * progmodes/grep.el (grep-mode-font-lock-keywords): Remove buffer-changing entries. (grep-filter): New function. (grep-mode): Add it to compilation-filter-hook. * progmodes/compile.el (compilation-filter-hook) (compilation-filter-start): New defvars. (compilation-filter): Call compilation-filter-hook prior to updating the process mark. diff: === modified file 'etc/NEWS' --- etc/NEWS 2011-05-07 07:45:35 +0000 +++ etc/NEWS 2011-05-08 05:17:17 +0000 @@ -377,9 +377,15 @@ ** comint and modes derived from it use the generic completion code. -** The compile.el mode can be used without font-lock-mode. +** Compilation mode + +*** Compilation mode can be used without font-lock-mode. `compilation-parse-errors-function' is now obsolete. +*** `compilation-filter-start' is let-bound to the start of the text +inserted by the compilation filter function, when calling +compilation-filter-hook. + ** The Landmark game is now invoked with `landmark', not `lm'. ** Prolog mode has been completely revamped, with lots of additional === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-05-08 02:33:28 +0000 +++ lisp/ChangeLog 2011-05-08 05:17:17 +0000 @@ -1,3 +1,15 @@ +2011-05-08 Chong Yidong + + * progmodes/grep.el (grep-mode-font-lock-keywords): Remove + buffer-changing entries. + (grep-filter): New function. + (grep-mode): Add it to compilation-filter-hook. + + * progmodes/compile.el (compilation-filter-hook) + (compilation-filter-start): New defvars. + (compilation-filter): Call compilation-filter-hook prior to + updating the process mark. + 2011-05-08 Stefan Monnier * emacs-lisp/eieio.el (defmethod): Fix typo in last change. === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2011-04-22 18:44:26 +0000 +++ lisp/progmodes/compile.el 2011-05-08 05:17:17 +0000 @@ -64,6 +64,16 @@ integer) :group 'compilation) +(defvar compilation-filter-hook nil + "Hook run after `compilation-filter' has inserted a string into the buffer. +It is called with the variable `compilation-filter-start' bound +to the position of the start of the inserted text, and point at +its end.") + +(defvar compilation-filter-start nil + "Start of the text inserted by `compilation-filter'. +This is bound to a buffer position before running `compilation-filter-hook'.") + (defvar compilation-first-column 1 "*This is how compilers number the first column, usually 1 or 0.") @@ -2038,11 +2048,12 @@ ;; If we are inserting at the end of the accessible part of the ;; buffer, keep the inserted text visible. (min (point-min-marker)) - (max (copy-marker (point-max) t))) + (max (copy-marker (point-max) t)) + (compilation-filter-start (marker-position (process-mark proc)))) (unwind-protect (progn (widen) - (goto-char (process-mark proc)) + (goto-char compilation-filter-start) ;; We used to use `insert-before-markers', so that windows with ;; point at `process-mark' scroll along with the output, but we ;; now use window-point-insertion-type instead. === modified file 'lisp/progmodes/grep.el' --- lisp/progmodes/grep.el 2011-04-02 18:52:08 +0000 +++ lisp/progmodes/grep.el 2011-05-08 05:17:17 +0000 @@ -1,4 +1,4 @@ -;;; grep.el --- run Grep as inferior of Emacs, parse match messages +;;; grep.el --- run `grep' and display the results ;; Copyright (C) 1985-1987, 1993-1999, 2001-2011 ;; Free Software Foundation, Inc. @@ -33,7 +33,7 @@ (defgroup grep nil - "Run grep as inferior of Emacs, parse error messages." + "Run `grep' and display the results." :group 'tools :group 'processes) @@ -399,26 +399,7 @@ (0 '(face nil compilation-message nil help-echo nil mouse-face nil) t) (1 grep-error-face) (2 grep-error-face nil t)) - ("^.+?-[0-9]+-.*\n" (0 grep-context-face)) - ;; Highlight grep matches and delete markers. - ;; FIXME: Modifying the buffer text from font-lock is a bad idea! - ("\\(\033\\[01;31m\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)" - ;; Refontification does not work after the markers have been - ;; deleted. So we use the font-lock-face property here as Font - ;; Lock does not clear that. - (2 (list 'face nil 'font-lock-face grep-match-face)) - ((lambda (bound)) - (progn - ;; Delete markers with `replace-match' because it updates - ;; the match-data, whereas `delete-region' would render it obsolete. - (syntax-ppss-flush-cache (match-beginning 0)) - (replace-match "" t t nil 3) - (replace-match "" t t nil 1)))) - ("\033\\[[0-9;]*[mK]" - ;; Delete all remaining escape sequences - ((lambda (bound)) - (syntax-ppss-flush-cache (match-beginning 0)) - (replace-match "" t t)))) + ("^.+?-[0-9]+-.*\n" (0 grep-context-face))) "Additional things to highlight in grep output. This gets tacked on the end of the generated expressions.") @@ -491,6 +472,22 @@ (cons msg code)))) (run-hooks 'grep-setup-hook)) +(defun grep-filter () + "Handle match highlighting escape sequences inserted by the grep process. +This function is called from `compilation-filter-hook'." + (save-excursion + (let ((end (point-marker))) + ;; Highlight grep matches and delete marking sequences. + (goto-char compilation-filter-start) + (while (re-search-forward "\033\\[01;31m\\(.*?\\)\033\\[[0-9]*m" end 1) + (replace-match (propertize (match-string 1) + 'face nil 'font-lock-face grep-match-face) + t t)) + ;; Delete all remaining escape sequences + (goto-char compilation-filter-start) + (while (re-search-forward "\033\\[[0-9;]*[mK]" end 1) + (replace-match "" t t))))) + (defun grep-probe (command args &optional func result) (let (process-file-side-effects) (equal (condition-case nil @@ -697,7 +694,8 @@ grep-regexp-alist) (set (make-local-variable 'compilation-process-setup-function) 'grep-process-setup) - (set (make-local-variable 'compilation-disable-input) t)) + (set (make-local-variable 'compilation-disable-input) t) + (add-hook 'compilation-filter-hook 'grep-filter nil t)) ;;;###autoload