From: Tino Calancha <tino.calancha@gmail.com>
To: Juri Linkov <juri@jurta.org>
Cc: 46119@debbugs.gnu.org, uyennhi.qm@gmail.com
Subject: bug#46119: 28.0.50; this-error-recenter
Date: Tue, 02 Feb 2021 22:16:05 +0100 [thread overview]
Message-ID: <87r1lyqiga.fsf@gmail.com> (raw)
In-Reply-To: <87v9baafyp.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 02 Feb 2021 19:05:10 +0200")
Juri Linkov <juri@jurta.org> writes:
>> * 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.
Right, my bad. Ok, I will use S-M-C-l then.
>> * lisp/simple.el (this-error-recenter): New command.
>
> Wouldn't a better name be recenter-current-error
> since existing name is compilation-current-error?
Agreed.
>> +(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.
OK
>> + (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.
I must set the buffer with the locus current, otherwise `recenter' rises
an error:
(defun recenter-current-error (&optional arg)
"Recenter the current displayed error in the `next-error' buffer."
(interactive "P")
(save-selected-window
(let ((next-error-highlight next-error-highlight-no-select)
(display-buffer-overriding-action
'(nil (inhibit-same-window . t))))
(next-error 0)
(set-buffer (window-buffer))
(recenter-top-bottom arg))))
next prev parent reply other threads:[~2021-02-02 21:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-26 21:21 bug#46119: 28.0.50; this-error-recenter Tino Calancha
2021-01-27 9:19 ` Juri Linkov
2021-01-30 15:01 ` Tino Calancha
2021-01-30 18:40 ` Juri Linkov
2021-01-30 20:41 ` Tino Calancha
2021-01-31 9:29 ` Juri Linkov
2021-01-31 15:56 ` Tino Calancha
2021-01-31 21:43 ` Juri Linkov
2021-02-01 17:19 ` Juri Linkov
2021-02-01 18:45 ` Tino Calancha
2021-02-02 17:04 ` Juri Linkov
2021-02-02 21:10 ` Tino Calancha
2021-02-01 19:17 ` Tino Calancha
2021-02-02 17:05 ` Juri Linkov
2021-02-02 21:16 ` Tino Calancha [this message]
2021-02-03 8:58 ` Juri Linkov
2021-02-03 13:03 ` Tino Calancha
2021-02-03 17:39 ` Juri Linkov
2021-02-07 15:56 ` Tino Calancha
2021-01-28 6:38 ` Richard Stallman
2021-01-30 14:50 ` Tino Calancha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r1lyqiga.fsf@gmail.com \
--to=tino.calancha@gmail.com \
--cc=46119@debbugs.gnu.org \
--cc=juri@jurta.org \
--cc=uyennhi.qm@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.