[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#32676: [PATCH] Add option to highlight the 'next-error' error messag
From: |
Juri Linkov |
Subject: |
bug#32676: [PATCH] Add option to highlight the 'next-error' error message |
Date: |
Fri, 16 Oct 2020 11:13:51 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
>>> Is there a different variable that should be used instead?
>>
>> I can't find another variable. Maybe a new variable should be created,
>> with a name like next-error-current.
>
> Re-reading the code, we don't really need the variable at all. The call
> to the highlighting function has been moved into the C-x ` command,
> after all, so we already know what buffer to use, and where point is.
>
> So I've now changed this to just highlight the current line in the
> "error buffer", which seems to work fine in the couple of use cases I
> tried.
Simplicity is the hallmark of truth :-)
Surprisingly, this feature works everywhere, even in diff-mode.
But when using next-error on an empty line in diff-mode, its highlighting
is too short to notice - only 1 character wide. Maybe the next-error-message
face should extend to the end of the window like hl-line-mode face does?
I tried to add the attribute ':extend t' to the next-error-message face,
but it has no effect. Maybe because currently highlighting is not added
to the trailing newline. Indeed, with this patch it works:
diff --git a/lisp/simple.el b/lisp/simple.el
index bd19969341..97f6d4837e 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -125,7 +125,7 @@ next-error-message-highlight
:version "28.1")
(defface next-error-message
- '((t (:inherit highlight)))
+ '((t (:inherit highlight :extend t)))
"Face used to highlight the current error message in the `next-error'
buffer."
:group 'next-error
:version "28.1")
@@ -484,7 +484,7 @@ next-error-message-highlight
(with-current-buffer error-buffer
(when next-error--message-highlight-overlay
(delete-overlay next-error--message-highlight-overlay))
- (let ((ol (make-overlay (line-beginning-position) (line-end-position))))
+ (let ((ol (make-overlay (line-beginning-position) (1+
(line-end-position)))))
;; do not override region highlighting
(overlay-put ol 'priority -50)
(overlay-put ol 'face 'next-error-message)