From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: dmitry@gutov.dev, 71466@debbugs.gnu.org, juri@linkov.net
Subject: bug#71466: 30.0.50; Buffer-menu-group-by non-nil resets point when Buffer List is reverted
Date: Tue, 18 Jun 2024 18:55:46 +0200 [thread overview]
Message-ID: <m11q4unqb1.fsf@dazzs-mbp.home> (raw)
In-Reply-To: <864j9qqpfx.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 18 Jun 2024 17:46:10 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Eshel Yaron <me@eshelyaron.com>
>> Cc: dmitry@gutov.dev, 71466@debbugs.gnu.org, juri@linkov.net
>> Date: Tue, 18 Jun 2024 16:01:40 +0200
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> >> @item g
>> >> -@findex xref-revert-buffer
>> >> -Refresh the contents of the @file{*xref*} buffer
>> >> -(@code{xref-revert-buffer}).
>> >> +Refresh the contents of the @file{*xref*} buffer (@code{revert-buffer}).
>> >> +@xref{Reverting}.
>> >
>> > Why remove the index entry? It needs to be rewritten, not removed.
>>
>> The index entry is for xref-revert-buffer, which we're making obsolete
>> here in favor of revert-buffer, which has its own index entry elsewhere.
>> How do you suggest rewriting it instead?
>
> Like this:
>
> @cindex revert-buffer, in @file{*xref*} buffers
>
> And please move it before "@item g", so that following the index entry
> with 'i' in Info lands on the line showing `g', not the line after it.
OK, thanks.
>> >> -(defun xref-revert-buffer ()
>> >> +(defun xref--revert-buffer (&rest _) ; Ignore `revert-buffer' args.
>> >> "Refresh the search results in the current buffer."
>> >
>> > And I wonder why you preferred a backward-incompatible change to a
>> > backward-compatible one:
>>
>> This is intended to be (basically) fully backward-compatible:
>> xref-revert-buffer becomes an alias of revert-buffer, which does exactly
>> what xref-revert-buffer would do.
>
> Yes, but why not leave xref-revert-buffer alone, under its original
> name?
See below.
>> > leave the function's name alone, and just set up
>> > revert-buffer-function to invoke it. Was this not possible for some
>> > technical reason that evades me?
>>
>> It's possible, and it's more or less what I suggested upthread, but
>> Dmitry correctly noted that this approach (using xref--revert-buffer)
>> improves backward-compatibility in the following sense: users that
>> currently invoke xref-revert-buffer not by pressing 'g', but in some
>> other way, can continue to do so and get the same behavior that now
>> revert-buffer provides when you press 'g'. Since revert-buffer does
>> more than just calling revert-buffer-function (namely, it also runs
>> revert-buffer-restore-functions), making xref-revert-buffer an alias of
>> revert-buffer ensures invoking and xref-revert-buffer and pressing 'g'
>> continues to behave the same.
>
> But the original xref-revert-buffer didn't do all those other things,
> did it? So invoking it directly will be more similar to what that did
> before.
That's right, but revert-buffer-restore-functions makes revert-buffer
more correct because it also restores outline-minor-mode state. So
making xref-revert-buffer an alias of revert-buffer brings this benefit
to users that invoke xref-revert-buffer directly, without duplicating
any revert-buffer code in xref-revert-buffer. Anyway, I trust you and
Dmitry to decide on the preferred solution, let me know I'll and post a
final patch accordingly.
Eshel
next prev parent reply other threads:[~2024-06-18 16:55 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 8:49 bug#71466: 30.0.50; Buffer-menu-group-by non-nil resets point when Buffer List is reverted Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-11 17:05 ` Juri Linkov
2024-06-17 6:35 ` Juri Linkov
2024-06-17 7:40 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-17 12:27 ` Dmitry Gutov
2024-06-17 15:43 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-17 22:24 ` Dmitry Gutov
2024-06-18 7:00 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-18 12:58 ` Eli Zaretskii
2024-06-18 14:01 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-18 14:46 ` Eli Zaretskii
2024-06-18 16:55 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-06-18 17:05 ` Dmitry Gutov
2024-06-18 17:36 ` Eli Zaretskii
2024-06-18 17:47 ` Dmitry Gutov
2024-06-20 16:38 ` Juri Linkov
2024-06-20 17:35 ` Dmitry Gutov
2024-06-24 6:27 ` Juri Linkov
2024-06-24 22:42 ` Dmitry Gutov
2024-06-25 6:54 ` Juri Linkov
2024-06-25 12:54 ` Eli Zaretskii
2024-06-25 23:14 ` Dmitry Gutov
2024-06-26 11:25 ` Eli Zaretskii
2024-06-26 16:56 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-26 18:33 ` Eli Zaretskii
2024-06-26 21:05 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-27 6:39 ` Juri Linkov
2024-06-27 7:19 ` Eli Zaretskii
2024-06-27 0:11 ` Dmitry Gutov
2024-06-17 12:32 ` Dmitry Gutov
2024-06-17 16:31 ` Juri Linkov
2024-06-17 22:16 ` Dmitry Gutov
2024-06-27 6:43 ` Juri Linkov
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=m11q4unqb1.fsf@dazzs-mbp.home \
--to=bug-gnu-emacs@gnu.org \
--cc=71466@debbugs.gnu.org \
--cc=dmitry@gutov.dev \
--cc=eliz@gnu.org \
--cc=juri@linkov.net \
--cc=me@eshelyaron.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.