Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

compilation: highlight current error

3 views
Skip to first unread message

Peter Münster

unread,
Jun 27, 2016, 2:32:46 AM6/27/16
to help-gn...@gnu.org
Hi,

I would like the current error in the compilation buffer to be
highlighted. How could this be done please?

TIA for any hints,
--
Peter


Eli Zaretskii

unread,
Jun 27, 2016, 11:42:52 AM6/27/16
to help-gn...@gnu.org
> From: Peter Münster <pml...@free.fr>
> Date: Mon, 27 Jun 2016 08:32:14 +0200
>
> I would like the current error in the compilation buffer to be
> highlighted. How could this be done please?

Turn on the hl-line-mode in the compilation buffer?

Drew Adams

unread,
Jun 27, 2016, 12:01:26 PM6/27/16
to Peter Münster, help-gn...@gnu.org
> I would like the current error in the compilation buffer to be
> highlighted. How could this be done please?

What do you mean by the current error? When you visit an error
using, say `C-x `', doesn't that move the current error line to
the top of the window that lists the errors? Isn't that enough?

Or do you want the current error highlighted in the source code
and not in the compilation buffer?

Peter Münster

unread,
Jun 27, 2016, 12:23:39 PM6/27/16
to help-gn...@gnu.org
On Mon, Jun 27 2016, Drew Adams wrote:

>> I would like the current error in the compilation buffer to be
>> highlighted. How could this be done please?
>
> What do you mean by the current error? When you visit an error
> using, say `C-x `', doesn't that move the current error line to
> the top of the window that lists the errors?

No. The current error line is most times somewhere between the middle
and the bottom of the window.
(I don't know, if that matters:
I have compilation-scroll-output = 'first-error)


> Isn't that enough?

No. When there are several errors, my old eyes don't find immediately the
current one.


> Or do you want the current error highlighted in the source code
> and not in the compilation buffer?

It's already done in the source code (see `next-error-highlight').
I would like the error message in the compilation buffer to be
highlighted.

--
Peter


Peter Münster

unread,
Jun 27, 2016, 12:35:48 PM6/27/16
to help-gn...@gnu.org
On Mon, Jun 27 2016, Eli Zaretskii wrote:

>> I would like the current error in the compilation buffer to be
>> highlighted. How could this be done please?
>
> Turn on the hl-line-mode in the compilation buffer?

Thanks for this hint! There is perhaps a bug: when jumping to the next
error, the highlighted line does not change.

But I've found a work-around:

--8<---------------cut here---------------start------------->8---
(add-hook 'next-error-hook (lambda ()
(with-current-buffer next-error-last-buffer
(hl-line-mode 0)
(hl-line-mode 1))))
--8<---------------cut here---------------end--------------->8---

--
Peter


0 new messages