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 18:55:46 +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> <864j9qqpfx.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="39575"; 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 18:56:15 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 1sJc7z-000A32-NF for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Jun 2024 18:56:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJc7m-0006tP-Lm; Tue, 18 Jun 2024 12:56: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 1sJc7k-0006s0-7c for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2024 12:56:01 -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 1sJc7j-0007qd-VR for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2024 12:55:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sJc7m-0006R2-8r for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2024 12:56: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 16:56: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.171872975524719 (code B ref 71466); Tue, 18 Jun 2024 16:56:02 +0000 Original-Received: (at 71466) by debbugs.gnu.org; 18 Jun 2024 16:55:55 +0000 Original-Received: from localhost ([127.0.0.1]:45658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJc7e-0006Qb-U8 for submit@debbugs.gnu.org; Tue, 18 Jun 2024 12:55:55 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:47354 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJc7c-0006QP-3D for 71466@debbugs.gnu.org; Tue, 18 Jun 2024 12:55:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1718729748; bh=CQAAEzetNin4UEw+LTS9GDewWXB7eW4FoegtK97oZXQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=v8VGGyaFNeKaqjkFyVoNjGOK+5Stn9l6mSbRB5K6SVa69DIRT/HZh4p3fKNU1oHT2 pwQY3F3vNpG/Cfa6TKe0sWN6osUkX8r+EytMsxtHN9mrw+aNT9nA7mGvwvaHv0z3YN lenAkFkcWe48T7KbSFA2I0OlYevluIdik2EauiLjkk5+DpgPg4HRneW3u5vZllDGM+ S2XpKIlR8Z/ZabNZ6TGQBsXg2sY/fJ2z0LkB365/yX4dvyArhSkJvCuaiULi6Cy1FU U4MvGE+Dc0t4G+Q30S6bJZVKa7bKdkUHu6dTosX4x3fnSo//pxiTAW3YRrNs/tqD62 zh0ufZyPgaRDw== In-Reply-To: <864j9qqpfx.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 18 Jun 2024 17:46:10 +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:287445 Archived-At: Eli Zaretskii writes: >> From: Eshel Yaron >> Cc: dmitry@gutov.dev, 71466@debbugs.gnu.org, juri@linkov.net >> Date: Tue, 18 Jun 2024 16:01:40 +0200 >> >> Eli Zaretskii 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