GNU bug report logs - #71466
30.0.50; Buffer-menu-group-by non-nil resets point when Buffer List is reverted

Previous Next

Package: emacs;

Reported by: Eshel Yaron <me <at> eshelyaron.com>

Date: Mon, 10 Jun 2024 10:26:02 UTC

Severity: normal

Found in version 30.0.50

Fixed in version 30.1

Done: Eshel Yaron <me <at> eshelyaron.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 71466 <at> debbugs.gnu.org (full text, mbox):

From: Eshel Yaron <me <at> eshelyaron.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 71466 <at> debbugs.gnu.org
Subject: Re: bug#71466: 30.0.50; Buffer-menu-group-by non-nil resets point
 when Buffer List is reverted
Date: Mon, 17 Jun 2024 09:40:30 +0200
Hi Juri,

Juri Linkov <juri <at> linkov.net> writes:

>> 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").
>
> The third variant is implemented now.

Works like a charm here, thank you!

>> 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.
>
> For xref I propose a separate patch that keeps point on the same line
> after reverting the xref buffer:

LGTM, but FWIW the situation with xref-revert-buffer is not ideal IMO:
it might be cleaner to leave 'g' bound to the usual revert-buffer and
set revert-buffer-function to (a slightly modified) xref-revert-buffer.
That way xref-revert-buffer wouldn't need to duplicate generic parts of
revert-buffer, such as running revert-buffer-restore-functions.  WDYT?


Eshel




This bug report was last modified 329 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.