bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46119: 28.0.50; this-error-recenter


From: Tino Calancha
Subject: bug#46119: 28.0.50; this-error-recenter
Date: Mon, 1 Feb 2021 19:45:45 +0100 (CET)



On Mon, 1 Feb 2021, Juri Linkov wrote:

Actually everything is much simpler.  The hint is in the default value
of 'xref-after-jump-hook' that contains 'recenter' by default.
So when you customize 'xref-after-jump-hook' to the value:

 (recenter-top-bottom xref-pulse-momentarily)

you can use 'C-o' to recenter another window from xref buffer,
exactly like 'C-l' does for the selected window.

The same way you can add:

 (add-hook 'next-error-hook 'recenter-top-bottom)

then use 'C-o' in any next-error capable buffer (compilation, occur, ...)
to recenter its corresponding window exactly like you want.

Thank you, that's nice. I still see superior adding a new command for 2 resons.

- I like to provide the binding by default to the users; same as we do with `n' or `p' to navigate the matches without selecting the buffer. It is quite convenient.

- The hook above doesn't accept a prefix. With the original proposal I can do:
2 l ; scroll the current displayed match at the second line.
This become handy when you want to inspect the context of the match.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]