diff options
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/progmodes/grep.el | 22 |
2 files changed, 26 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e0ed18872f5..6c12d144523 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2005-06-18 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * progmodes/grep.el (grep-regexp-alist): Use backreference at the | ||
| 4 | end of first regexp to limit the match to the position between | ||
| 5 | line number and source line with same separator character as used | ||
| 6 | between file name and line number. In the second regexp limit | ||
| 7 | mouse-face area to file name and line number by adding new group | ||
| 8 | for them and referring it in HYPERLINK arg. | ||
| 9 | (grep-regexp-alist, grep-mode-font-lock-keywords): Use shy group. | ||
| 10 | (grep-mode): Set font-lock-lines-before to 0 to not refontify the | ||
| 11 | previous line where grep markers may be already removed. | ||
| 12 | |||
| 1 | 2005-06-18 Peter Kleiweg <p.c.j.kleiweg@rug.nl> | 13 | 2005-06-18 Peter Kleiweg <p.c.j.kleiweg@rug.nl> |
| 2 | 14 | ||
| 3 | * progmodes/ps-mode.el: Update version and maintainer's email | 15 | * progmodes/ps-mode.el: Update version and maintainer's email |
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 195875842a3..f3657a0a279 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -250,17 +250,20 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies | |||
| 250 | ;; rms: I removed the code to match parens around the line number | 250 | ;; 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. | 251 | ;; 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. | 252 | ;; It causes confusion with a file name that contains a number in parens. |
| 253 | '(("^\\(.+?\\)[: \t]+\ | 253 | '(("^\\(.+?\\)\\([: \t]\\)+\ |
| 254 | \\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\ | 254 | \\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\ |
| 255 | \\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?[: \t]" 1 (2 . 5) (4 . 6)) | 255 | \\(?:-\\(?:\\([0-9]+\\)\\4\\)?\\.?\\([0-9]+\\)?\\)?\\2" |
| 256 | ("^\\(.+?\\)[:(]+\\([0-9]+\\)\\([:)]\\).*?\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\(\033\\[K\\)?\\)" | 256 | 1 (3 . 6) (5 . 7)) |
| 257 | 1 2 | 257 | ("^\\(\\(.+?\\):\\([0-9]+\\):\\).*?\ |
| 258 | \\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\(?:\033\\[K\\)?\\)" | ||
| 259 | 2 3 | ||
| 258 | ;; Calculate column positions (beg . end) of first grep match on a line | 260 | ;; Calculate column positions (beg . end) of first grep match on a line |
| 259 | ((lambda () | 261 | ((lambda () |
| 260 | (setq compilation-error-screen-columns nil) | 262 | (setq compilation-error-screen-columns nil) |
| 261 | (- (match-beginning 5) (match-end 3) 8)) | 263 | (- (match-beginning 5) (match-end 1) 8)) |
| 262 | . | 264 | . |
| 263 | (lambda () (- (match-end 5) (match-end 3) 8)))) | 265 | (lambda () (- (match-end 5) (match-end 1) 8))) |
| 266 | nil 1) | ||
| 264 | ("^Binary file \\(.+\\) matches$" 1 nil nil 1)) | 267 | ("^Binary file \\(.+\\) matches$" 1 nil nil 1)) |
| 265 | "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") | 268 | "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") |
| 266 | 269 | ||
| @@ -293,7 +296,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies | |||
| 293 | (1 compilation-warning-face) | 296 | (1 compilation-warning-face) |
| 294 | (2 compilation-line-face)) | 297 | (2 compilation-line-face)) |
| 295 | ;; Highlight grep matches and delete markers | 298 | ;; Highlight grep matches and delete markers |
| 296 | ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\(\033\\[K\\)?\\)" | 299 | ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\(?:\033\\[K\\)?\\)" |
| 297 | ;; Refontification does not work after the markers have been | 300 | ;; Refontification does not work after the markers have been |
| 298 | ;; deleted. So we use the font-lock-face property here as Font | 301 | ;; deleted. So we use the font-lock-face property here as Font |
| 299 | ;; Lock does not clear that. | 302 | ;; Lock does not clear that. |
| @@ -517,7 +520,10 @@ temporarily highlight in visited source lines." | |||
| 517 | (set (make-local-variable 'compilation-error-face) | 520 | (set (make-local-variable 'compilation-error-face) |
| 518 | grep-hit-face) | 521 | grep-hit-face) |
| 519 | (set (make-local-variable 'compilation-error-regexp-alist) | 522 | (set (make-local-variable 'compilation-error-regexp-alist) |
| 520 | grep-regexp-alist)) | 523 | 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)) | ||
| 521 | 527 | ||
| 522 | ;;;###autoload | 528 | ;;;###autoload |
| 523 | (defun grep-find (command-args) | 529 | (defun grep-find (command-args) |