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
This commit is contained in:
parent
b6d78a0d80
commit
9034dd6c70
1 changed files with 5 additions and 5 deletions
|
@ -366,6 +366,9 @@ A grep buffer becomes most recent when you select Grep mode in it.
|
||||||
Notice that using \\[next-error] or \\[compile-goto-error] modifies
|
Notice that using \\[next-error] or \\[compile-goto-error] modifies
|
||||||
`compilation-last-buffer' rather than `grep-last-buffer'.")
|
`compilation-last-buffer' rather than `grep-last-buffer'.")
|
||||||
|
|
||||||
|
(defvar grep-match-face 'match
|
||||||
|
"Face name to use for grep matches.")
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defconst grep-regexp-alist
|
(defconst grep-regexp-alist
|
||||||
`((,(concat "^\\(?:"
|
`((,(concat "^\\(?:"
|
||||||
|
@ -389,7 +392,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
|
||||||
(when grep-highlight-matches
|
(when grep-highlight-matches
|
||||||
(let* ((beg (match-end 0))
|
(let* ((beg (match-end 0))
|
||||||
(end (save-excursion (goto-char beg) (line-end-position)))
|
(end (save-excursion (goto-char beg) (line-end-position)))
|
||||||
(mbeg (text-property-any beg end 'font-lock-face 'grep-match-face)))
|
(mbeg (text-property-any beg end 'font-lock-face grep-match-face)))
|
||||||
(when mbeg
|
(when mbeg
|
||||||
(- mbeg beg)))))
|
(- mbeg beg)))))
|
||||||
.
|
.
|
||||||
|
@ -397,7 +400,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
|
||||||
(when grep-highlight-matches
|
(when grep-highlight-matches
|
||||||
(let* ((beg (match-end 0))
|
(let* ((beg (match-end 0))
|
||||||
(end (save-excursion (goto-char beg) (line-end-position)))
|
(end (save-excursion (goto-char beg) (line-end-position)))
|
||||||
(mbeg (text-property-any beg end 'font-lock-face 'grep-match-face))
|
(mbeg (text-property-any beg end 'font-lock-face grep-match-face))
|
||||||
(mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end))))
|
(mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end))))
|
||||||
(when mend
|
(when mend
|
||||||
(- mend beg))))))
|
(- mend beg))))))
|
||||||
|
@ -421,9 +424,6 @@ See `compilation-error-regexp-alist' for format details.")
|
||||||
(defvar grep-error-face 'compilation-error
|
(defvar grep-error-face 'compilation-error
|
||||||
"Face name to use for grep error messages.")
|
"Face name to use for grep error messages.")
|
||||||
|
|
||||||
(defvar grep-match-face 'match
|
|
||||||
"Face name to use for grep matches.")
|
|
||||||
|
|
||||||
(defvar grep-context-face 'shadow
|
(defvar grep-context-face 'shadow
|
||||||
"Face name to use for grep context lines.")
|
"Face name to use for grep context lines.")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue