250 |
;; rms: I removed the code to match parens around the line number |
;; rms: I removed the code to match parens around the line number |
251 |
;; because it causes confusion and so we will find out if anyone needs it. |
;; because it causes confusion and so we will find out if anyone needs it. |
252 |
;; It causes confusion with a file name that contains a number in parens. |
;; It causes confusion with a file name that contains a number in parens. |
253 |
'(("^\\(.+?\\)[: \t]+\ |
'(("^\\(.+?\\)\\([: \t]\\)+\ |
254 |
\\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\ |
\\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\ |
255 |
\\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?[: \t]" 1 (2 . 5) (4 . 6)) |
\\(?:-\\(?:\\([0-9]+\\)\\4\\)?\\.?\\([0-9]+\\)?\\)?\\2" |
256 |
("^\\(.+?\\)[:(]+\\([0-9]+\\)\\([:)]\\).*?\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\(\033\\[K\\)?\\)" |
1 (3 . 6) (5 . 7)) |
257 |
1 2 |
("^\\(\\(.+?\\):\\([0-9]+\\):\\).*?\ |
258 |
|
\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\(?:\033\\[K\\)?\\)" |
259 |
|
2 3 |
260 |
;; Calculate column positions (beg . end) of first grep match on a line |
;; Calculate column positions (beg . end) of first grep match on a line |
261 |
((lambda () |
((lambda () |
262 |
(setq compilation-error-screen-columns nil) |
(setq compilation-error-screen-columns nil) |
263 |
(- (match-beginning 5) (match-end 3) 8)) |
(- (match-beginning 5) (match-end 1) 8)) |
264 |
. |
. |
265 |
(lambda () (- (match-end 5) (match-end 3) 8)))) |
(lambda () (- (match-end 5) (match-end 1) 8))) |
266 |
|
nil 1) |
267 |
("^Binary file \\(.+\\) matches$" 1 nil nil 1)) |
("^Binary file \\(.+\\) matches$" 1 nil nil 1)) |
268 |
"Regexp used to match grep hits. See `compilation-error-regexp-alist'.") |
"Regexp used to match grep hits. See `compilation-error-regexp-alist'.") |
269 |
|
|
296 |
(1 compilation-warning-face) |
(1 compilation-warning-face) |
297 |
(2 compilation-line-face)) |
(2 compilation-line-face)) |
298 |
;; Highlight grep matches and delete markers |
;; Highlight grep matches and delete markers |
299 |
("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\(\033\\[K\\)?\\)" |
("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\(?:\033\\[K\\)?\\)" |
300 |
;; Refontification does not work after the markers have been |
;; Refontification does not work after the markers have been |
301 |
;; deleted. So we use the font-lock-face property here as Font |
;; deleted. So we use the font-lock-face property here as Font |
302 |
;; Lock does not clear that. |
;; Lock does not clear that. |
520 |
(set (make-local-variable 'compilation-error-face) |
(set (make-local-variable 'compilation-error-face) |
521 |
grep-hit-face) |
grep-hit-face) |
522 |
(set (make-local-variable 'compilation-error-regexp-alist) |
(set (make-local-variable 'compilation-error-regexp-alist) |
523 |
grep-regexp-alist)) |
grep-regexp-alist) |
524 |
|
;; Set `font-lock-lines-before' to 0 to not refontify the previous |
525 |
|
;; line where grep markers may be already removed. |
526 |
|
(set (make-local-variable 'font-lock-lines-before) 0)) |
527 |
|
|
528 |
;;;###autoload |
;;;###autoload |
529 |
(defun grep-find (command-args) |
(defun grep-find (command-args) |