From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov 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, 11 Jun 2024 20:05:51 +0300 Organization: LINKOV.NET Message-ID: <86tthzwgsw.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36202"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 71466@debbugs.gnu.org To: Eshel Yaron Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 11 19:10:30 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 1sH50w-0009AC-5f for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 Jun 2024 19:10:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sH50Z-0001YG-Dz; Tue, 11 Jun 2024 13:10:07 -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 1sH50W-0001Wz-RS for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2024 13:10:04 -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 1sH50W-000384-Ij for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2024 13:10:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sH50U-0005tH-RM for bug-gnu-emacs@gnu.org; Tue, 11 Jun 2024 13:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Jun 2024 17:10: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.171812580122622 (code B ref 71466); Tue, 11 Jun 2024 17:10:02 +0000 Original-Received: (at 71466) by debbugs.gnu.org; 11 Jun 2024 17:10:01 +0000 Original-Received: from localhost ([127.0.0.1]:36179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sH50S-0005so-P7 for submit@debbugs.gnu.org; Tue, 11 Jun 2024 13:10:01 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:46519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sH50O-0005sD-7S for 71466@debbugs.gnu.org; Tue, 11 Jun 2024 13:09:56 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 7603740003; Tue, 11 Jun 2024 17:09:31 +0000 (UTC) In-Reply-To: (Eshel Yaron's message of "Mon, 10 Jun 2024 10:49:18 +0200") X-GND-Sasl: juri@linkov.net 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:287102 Archived-At: > I noticed a certain issue with the new Buffer-menu-group-by option: when > grouping is enabled, reverting the Buffer List buffer may move point > back to the beginning on the buffer. This is especially problematic > when auto-revert-mode is involved. Consider: > > 1. emacs -Q > 2. (setq global-auto-revert-non-file-buffers t) > 3. M-x global-auto-revert-mode RET > 4. (setq Buffer-menu-group-by '(Buffer-menu-group-by-mode)) > 5. M-x list-buffers > 6. Navigate to some heading in the Buffer List buffer, any heading > besides the first. > 7. Wait (or think) for 5 seconds. > 8. Auto-revert kicks in and point moves back to the beginning > of the buffer. Thanks for the request, this definitely should be improved. > Without grouping, reverting the Buffer List (manually or via > global-auto-revert-mode) keeps point in place. When point is on an entry, then 'tabulated-list-print' moves point to the entry with the same ID. However, what ID to prefer for outline heading lines is not quite clear. Possible variants: 1. The simplest way would be to remember the position of point or the line number. But this is not quite reliable when new entries are inserted before. 2. Remembering the outline heading line as a string and searching for it afterwards would be ambiguous when there are more headings with the same string. For example, when at the top level there are project names, and at the second level mode names repeated for every project. 3. To remember a complete path like outline-hidden-headings-paths does, e.g. '("Project1 name" "Mode2 name"). But this will not handle modes that don't use tabulated-list. For example, reverting an xref buffer with outlines now restores visibility of outlines, but doesn't restore point. OTOH, maybe it's not responsibility of outline-minor-mode to restore point when it's not on a heading line. 4. To remember some context before and after point, then after reverting search context with 'rear-context-string' and 'front-context-string'.