all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#70150: Better groups for Buffer-menu-group-by
@ 2024-04-02 16:44 Juri Linkov
  0 siblings, 0 replies; only message in thread
From: Juri Linkov @ 2024-04-02 16:44 UTC (permalink / raw)
  To: 70150

[-- 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)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-02 16:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-02 16:44 bug#70150: Better groups for Buffer-menu-group-by Juri Linkov

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.