GNU bug report logs - #76593
31.0.50; mouse-buffer-menu shows two "Shell" submenus with enough *Async Shell Command* and shell-mode buffers

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Wed, 26 Feb 2025 17:18:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Full log


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

From: Visuwesh <visuweshm <at> gmail.com>
To: 76593 <at> debbugs.gnu.org
Subject: Re: bug#76593: 31.0.50; mouse-buffer-menu shows two "Shell"
 submenus with enough *Async Shell Command* and shell-mode buffers
Date: Thu, 27 Feb 2025 15:34:36 +0530
[Message part 1 (text/plain, inline)]
[புதன் பிப்ரவரி 26, 2025] Visuwesh wrote:

> mouse-buffer-menu ends up showing two "Shell" submenus when there are
> enough *Async Shell Command* (major-mode=shell-command-mode) and *shell*
> (major-mode=shell-mode) buffers open.  To reproduce this,
>
>     1. emacs -Q
>     2. Spam M-& sleep 100 three or four times.
>     3. Likewise for C-u M-x shell RET.
>     4. Now, C-<mouse-1> and observe how there are two "Shell" menu
>        items.
>
> To bring back the old behaviour, one can do
>
> diff --git a/lisp/mouse.el b/lisp/mouse.el
> index 1f0ca6a51b6..8caa611277e 100644
> --- a/lisp/mouse.el
> +++ b/lisp/mouse.el
> @@ -2691,6 +2691,7 @@ mouse-buffer-menu-mode-groups
>      ("\\bVM\\b\\|\\bMH\\b\\|Message\\b\\|Mail\\|Group\\|Score\\|Summary\\|Article"
>       . "Mail/News")
>      ("\\<C\\>" . "C")
> +    ("Shell\\'" . "Shell")
>      ("ObjC" . "C")
>      ("Text" . "Text")
>      ("Outline" . "Text")
>
> which consolidates all mode-names that end with "Shell".  Just using
> "Shell" as the regexp erroneously groups sh-script-mode buffers along
> with shell-mode and shell-command-mode buffers.

And here's a proper patch:

[0001-Group-shell-and-shell-command-buffers-under-the-same.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
I went with the regexp \`Shell\' to ensure only major-modes with
`mode-name' "Shell" will be matched.

This bug report was last modified 108 days ago.

Previous Next


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