diff options
| author | Trevor Spiteri | 2019-01-14 23:10:34 +0100 |
|---|---|---|
| committer | Eli Zaretskii | 2019-01-19 09:51:20 +0200 |
| commit | 9034dd6c703975e9da3a269b84d8b756b997a4d8 (patch) | |
| tree | 0efbf12020d681efd3f22091d1c00d5f93a17904 | |
| parent | b6d78a0d8019a92f94ce3fc41ddb0886f8b70d85 (diff) | |
| download | emacs-9034dd6c703975e9da3a269b84d8b756b997a4d8.tar.gz emacs-9034dd6c703975e9da3a269b84d8b756b997a4d8.zip | |
Fix cursor column positioning on Grep hits
* lisp/progmodes/grep.el (grep-match-face): Move before first
use, to avoid byte-compilation warning.
(grep-regexp-alist): Don't quote grep-match-face. (Bug#34068)
Copyright-paperwork-exempt: yes
| -rw-r--r-- | lisp/progmodes/grep.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index df8cb3da7ef..8b9a2d86c75 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -366,6 +366,9 @@ A grep buffer becomes most recent when you select Grep mode in it. | |||
| 366 | Notice that using \\[next-error] or \\[compile-goto-error] modifies | 366 | Notice that using \\[next-error] or \\[compile-goto-error] modifies |
| 367 | `compilation-last-buffer' rather than `grep-last-buffer'.") | 367 | `compilation-last-buffer' rather than `grep-last-buffer'.") |
| 368 | 368 | ||
| 369 | (defvar grep-match-face 'match | ||
| 370 | "Face name to use for grep matches.") | ||
| 371 | |||
| 369 | ;;;###autoload | 372 | ;;;###autoload |
| 370 | (defconst grep-regexp-alist | 373 | (defconst grep-regexp-alist |
| 371 | `((,(concat "^\\(?:" | 374 | `((,(concat "^\\(?:" |
| @@ -389,7 +392,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies | |||
| 389 | (when grep-highlight-matches | 392 | (when grep-highlight-matches |
| 390 | (let* ((beg (match-end 0)) | 393 | (let* ((beg (match-end 0)) |
| 391 | (end (save-excursion (goto-char beg) (line-end-position))) | 394 | (end (save-excursion (goto-char beg) (line-end-position))) |
| 392 | (mbeg (text-property-any beg end 'font-lock-face 'grep-match-face))) | 395 | (mbeg (text-property-any beg end 'font-lock-face grep-match-face))) |
| 393 | (when mbeg | 396 | (when mbeg |
| 394 | (- mbeg beg))))) | 397 | (- mbeg beg))))) |
| 395 | . | 398 | . |
| @@ -397,7 +400,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies | |||
| 397 | (when grep-highlight-matches | 400 | (when grep-highlight-matches |
| 398 | (let* ((beg (match-end 0)) | 401 | (let* ((beg (match-end 0)) |
| 399 | (end (save-excursion (goto-char beg) (line-end-position))) | 402 | (end (save-excursion (goto-char beg) (line-end-position))) |
| 400 | (mbeg (text-property-any beg end 'font-lock-face 'grep-match-face)) | 403 | (mbeg (text-property-any beg end 'font-lock-face grep-match-face)) |
| 401 | (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) | 404 | (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) |
| 402 | (when mend | 405 | (when mend |
| 403 | (- mend beg)))))) | 406 | (- mend beg)))))) |
| @@ -421,9 +424,6 @@ See `compilation-error-regexp-alist' for format details.") | |||
| 421 | (defvar grep-error-face 'compilation-error | 424 | (defvar grep-error-face 'compilation-error |
| 422 | "Face name to use for grep error messages.") | 425 | "Face name to use for grep error messages.") |
| 423 | 426 | ||
| 424 | (defvar grep-match-face 'match | ||
| 425 | "Face name to use for grep matches.") | ||
| 426 | |||
| 427 | (defvar grep-context-face 'shadow | 427 | (defvar grep-context-face 'shadow |
| 428 | "Face name to use for grep context lines.") | 428 | "Face name to use for grep context lines.") |
| 429 | 429 | ||