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: Wed, 27 Jan 2021 11:19:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> +(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")
> +    (funcall next-error-function 0 nil)
> +    (recenter-top-bottom arg)
> +    (pop-to-buffer next-error-last-buffer)))

I wonder why restrict this only to occur and compilation?

Like C-M-v/C-M-S-v and M-PgUp/M-PgDown can scroll up/down other window
in any mode, you can use such code to recenter other window everywhere:

  (with-selected-window (other-window-for-scrolling) (recenter-top-bottom))





reply via email to

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