GNU bug report logs - #32676
[PATCH] Add option to highlight the 'next-error' error message

Previous Next

Package: emacs;

Reported by: Ernesto Alfonso <erjoalgo <at> gmail.com>

Date: Mon, 10 Sep 2018 05:24:02 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Ernesto Alfonso <erjoalgo <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>, Robert Pluim <rpluim <at> gmail.com>, 32676 <at> debbugs.gnu.org
Subject: bug#32676: [PATCH] Add option to highlight the 'next-error' error message
Date: Fri, 16 Oct 2020 11:13:51 +0300
[Message part 1 (text/plain, inline)]
>>> 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:

[next-error-message-extend.patch (text/x-diff, inline)]
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)

This bug report was last modified 4 years and 250 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.