all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: 70150@debbugs.gnu.org
Subject: bug#70150: Better groups for Buffer-menu-group-by
Date: Tue, 02 Apr 2024 19:44:27 +0300	[thread overview]
Message-ID: <86le5veo7w.fsf@mail.linkov.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 134 bytes --]

Here is a better grouping for Buffer-menu-group-by-mode
that uses the existing mode categorization in
mouse-buffer-menu-mode-groups.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Buffer-menu-group-by-mode.patch --]
[-- Type: text/x-diff, Size: 646 bytes --]

diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index ec5337e3fda..1f7d40c5a14 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -798,7 +805,11 @@ Buffer-menu--pretty-file-name
 	(t "")))
 
 (defun Buffer-menu-group-by-mode (entry)
-  (concat "* " (aref (cadr entry) 5)))
+  (let ((mode (aref (cadr entry) 5)))
+    (concat "* " (or (cdr (seq-find (lambda (group)
+                                      (string-match-p (car group) mode))
+                                    mouse-buffer-menu-mode-groups))
+                     mode))))
 
 (declare-function project-root "project" (project))
 (defun Buffer-menu-group-by-root (entry)

             reply	other threads:[~2024-04-02 16:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 16:44 Juri Linkov [this message]
2024-06-05  6:48 ` bug#70150: Better groups for Buffer-menu-group-by Juri Linkov
2024-06-05 17:08   ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86le5veo7w.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=70150@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.