GNU bug report logs - #45848
27.1; Buffers menu opens wrong buffer

Previous Next

Package: emacs;

Reported by: joseph <at> cauldrondevelopment.com

Date: Wed, 13 Jan 2021 23:20:01 UTC

Severity: normal

Found in version 27.1

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 45848 <at> debbugs.gnu.org, joseph <at> cauldrondevelopment.com
Subject: bug#45848: 27.1; Buffers menu opens wrong buffer
Date: Mon, 09 May 2022 16:17:28 +0200
martin rudalics <rudalics <at> gmx.at> writes:

>> In recent versions of GTK Emacs with multiple frames open, selecting the
>> top buffer from the Buffers menu often opens the wrong buffer.  Upon
>> returning to the Buffers menu, the top item has changed to the one that
>> actually opened.  Selecting the desired file from the menu again opens the
>> correct file as expected.

I'm unable to reproduce this, but:

>> I belive the problem is that the Buffers menu opens before the frame focus
>> changes causing the wrong Buffers list to display for the frame.

When clicking on the Buffers menu without selecting the frame first, the
menu first displays the buffers in one order, and then
menu-bar-update-buffers is triggered, and then the order rearranges
itself, which is disturbing.

So menu-bar-update-hook is called too late -- after opening the menu
instead of before.  (Or perhaps called at the right time, but before the
frame is selected...)

> This means that
> conceptually the menu will show the same list regardless from where you
> invoke it unless that invoking step itself changes the global buffer
> list beforehand.  Now selecting a frame is one way to change it, popping
> up a menu from the menu bar should not change it.
>
> So the first issue we'd have to resolve is what the "correct Buffers
> menu" is.

I'm not sure, either.  It just lists things in `buffer-list' order, and
selecting a different frame will select a new window, and therefor a new
buffer, so switching frames will alter the order...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 38 days ago.

Previous Next


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