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: Juri Linkov
Subject: bug#46119: 28.0.50; this-error-recenter
Date: Tue, 02 Feb 2021 19:05:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> I am posting now the approach using two new commands:
>
>     * lisp/window.el (recenter-other-window): New command.
>     Bind recenter-other-window to M-C-l.

M-C-l can't be used because M-C-l is already bound to 'reposition-window'.
Only S-M-C-l is free.

>     * lisp/simple.el (this-error-recenter): New command.

Wouldn't a better name be recenter-current-error
since existing name is compilation-current-error?

> +(defun this-error-recenter (&optional arg)
> +  "Recenter the current displayed error in the `next-error' buffer."
> +  (interactive "P")
> +  (if (not (or (eq major-mode 'occur-mode) (derived-mode-p 
> 'compilation-mode)))
> +      (user-error "This command is for *Occur* or *Grep* buffers")

This is bad restriction that needs to be removed.

> +    (funcall next-error-function 0 nil)
> +    (recenter-top-bottom arg)
> +    (pop-to-buffer next-error-last-buffer)))

`(pop-to-buffer next-error-last-buffer)' has problems
and should be replaced with `save-selected-window'.

Please see the commit 072b4c679dfd5528e74849cad18246730a991933
and bug#32607 for explanations.





reply via email to

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