From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71466: 30.0.50; Buffer-menu-group-by non-nil resets point when Buffer List is reverted Date: Tue, 18 Jun 2024 16:01:40 +0200 Message-ID: References: <86tthzwgsw.fsf@mail.linkov.net> <86msnkyt7c.fsf@mail.linkov.net> <30404984-e7ac-4f92-a194-06438dbf2d03@gutov.dev> <867cemquey.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25566"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: dmitry@gutov.dev, 71466@debbugs.gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 18 16:02:25 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sJZPl-0006Om-8B for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Jun 2024 16:02:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJZPN-0004dV-JE; Tue, 18 Jun 2024 10:02:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJZPL-0004d1-QE for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2024 10:02:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJZPL-0002zA-Hi for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2024 10:01:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sJZPO-0004Lc-4f for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2024 10:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Jun 2024 14:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71466 X-GNU-PR-Package: emacs Original-Received: via spool by 71466-submit@debbugs.gnu.org id=B71466.171871931316696 (code B ref 71466); Tue, 18 Jun 2024 14:02:02 +0000 Original-Received: (at 71466) by debbugs.gnu.org; 18 Jun 2024 14:01:53 +0000 Original-Received: from localhost ([127.0.0.1]:43805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJZPE-0004LC-L5 for submit@debbugs.gnu.org; Tue, 18 Jun 2024 10:01:53 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:36408 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJZP8-0004Kz-W6 for 71466@debbugs.gnu.org; Tue, 18 Jun 2024 10:01:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1718719303; bh=1K1bMb/BnMtwgZsKUxni43JDuAuP77I6s30Cqg5XHJE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=E6z4OoH/DX5KJaidy8hVTJOIttpypuvUSDSZScy1zf15tPfzRFnfl+fBOnGahc3qL S7VtKrlGCezZBXAhL+y5pPXPjbgtUNYop9NnlOAdQKA+2lc0BuP67QFuUPhKrGFQ+C NIH+fZVBUfD44O70W4vwd3VjKoUyhHNUSjisMXPwHqgVu1OnslxGA4fJkuy98R+0LK 7uFUC52KQFV+gccdKLmSVsIxIrW+MRnZSUj7+XRnhRPh08hYx3sImZOyFD+cb6aSAx tOmgYsv8XP0DaDMPrvp676FZOjq+TBhY9nbniN9tjacKEUDO5mkWv4uGBiljySagHx mNd//MooSaFFQ== In-Reply-To: <867cemquey.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 18 Jun 2024 15:58:45 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287440 Archived-At: Hi Eli, Eli Zaretskii writes: >> Cc: 71466@debbugs.gnu.org, Juri Linkov >> Date: Tue, 18 Jun 2024 09:00:38 +0200 >> From: Eshel Yaron via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> @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? >> +** Xref >> + >> +*** 'xref-revert-buffer' is obsolete, prefer 'revert-buffer' instead. >> +The former is now an alias of the latter. The Xref results buffer sets > > Please use "The Xref buffer". "The Xref results buffer" reads > awkwardly, and there actually is no such thing as "Xref results". All right, will do. >> @@ -1011,6 +1010,7 @@ xref--xref-buffer-mode >> #'xref--imenu-extract-index-name) >> (setq-local add-log-current-defun-function >> #'xref--add-log-current-defun) >> + (setq-local revert-buffer-function #'xref--revert-buffer) >> (setq-local outline-minor-mode-cycle t) >> (setq-local outline-minor-mode-use-buttons 'insert) >> (setq-local outline-search-function >> @@ -1273,22 +1273,16 @@ xref--show-common-initialize >> xref--original-window-intent (assoc-default 'display-action alist)) >> (setq xref--fetcher fetcher))) >> >> -(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. > 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. Eshel