summaryrefslogtreecommitdiff
path: root/lisp/progmodes/grep.el
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2018-07-09 16:56:47 -0400
committerNoam Postavsky <npostavs@gmail.com>2018-07-12 21:49:50 -0400
commit3eb4603b0d432740ff4e8deb637cca2f35cf5fee (patch)
tree0333e7f6507ec70149cc79758198c002caeb059d /lisp/progmodes/grep.el
parent5cc7c4b48a2d6eca5d14d12b1cd258bf9cabde74 (diff)
downloademacs-3eb4603b0d432740ff4e8deb637cca2f35cf5fee.tar.gz
Match w32 paths in grep sans --null hits (Bug#32051)
* lisp/progmodes/grep.el (grep-regexp-alist): Add an optional part to match paths starting with C: (other drive letters). * test/lisp/progmodes/compile-tests.el (compile-tests--grep-regexp-testcases) (compile-tests--grep-regexp-tricky-testcases) (compile-test-grep-regexps): New tests. (compile--test-error-line): Return `compilation-message'.
Diffstat (limited to 'lisp/progmodes/grep.el')
-rw-r--r--lisp/progmodes/grep.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index da09c900e58..0bfabd5f3fe 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -379,7 +379,9 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
;; to handle weird file names (with colons in them) as
;; well as possible. E.g., use [1-9][0-9]* rather than
;; [0-9]+ so as to accept ":034:" in file names.
- "\\(?1:[^\n:]+?[^\n/:]\\):[\t ]*\\(?2:[1-9][0-9]*\\)[\t ]*:"
+ "\\(?1:"
+ "\\(?:[a-zA-Z]:\\)?" ; Allow "C:..." for w32.
+ "[^\n:]+?[^\n/:]\\):[\t ]*\\(?2:[1-9][0-9]*\\)[\t ]*:"
"\\)")
1 2
;; Calculate column positions (col . end-col) of first grep match on a line