GNU bug report logs - #46119
28.0.50; this-error-recenter

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Tue, 26 Jan 2021 21:22:01 UTC

Severity: wishlist

Tags: patch

Found in version 28.0.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 46119 <at> debbugs.gnu.org, uyennhi.qm <at> gmail.com
Subject: bug#46119: 28.0.50; this-error-recenter
Date: Wed, 27 Jan 2021 11:19:19 +0200
> +(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))




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

Previous Next


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