]> git.eshelyaron.com Git - emacs.git/commit
Add tabulated-list-groups and Buffer-menu-group-by (bug#69305)
authorJuri Linkov <juri@linkov.net>
Thu, 29 Feb 2024 17:50:04 +0000 (19:50 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 2 Mar 2024 06:31:54 +0000 (07:31 +0100)
commit1e48f1f09df911572e57cd624eddc6616cc5eefd
tree679f1d77eee10235bf383f70ef8ffdfdeb115979
parent5776cb3943eea602b10f4eb39efe40ac7af3b5e6
Add tabulated-list-groups and Buffer-menu-group-by (bug#69305)

* doc/lispref/modes.texi (Tabulated List Mode):
Add defvar tabulated-list-groups.

* lisp/buff-menu.el (Buffer-menu-group-by): New defcustom.
(Buffer-menu-unmark-all-buffers): Use tabulated-list-get-entry
to check whether the current line contains an entry.
(list-buffers-noselect): Enable outline-minor-mode
for tabulated-list-groups.
(list-buffers--refresh): When Buffer-menu-group-by is non-nil,
set tabulated-list-groups.
(Buffer-menu-group-by-mode, Buffer-menu-group-by-root):
New functions.

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-groups):
New buffer-local variable.
(tabulated-list-print-fake-header): Add distinct overlay
property 'fake-header'.
(tabulated-list-header-overlay-p): Filter out overlays that
don't have the property 'fake-header'.
(tabulated-list-print): Use the variable 'tabulated-list-groups'
to sort entries in groups separately.
(tabulated-list-print-entries): New function factored out from
'tabulated-list-print'.

* test/lisp/emacs-lisp/tabulated-list-tests.el (tabulated-list-groups):
New test.

(cherry picked from commit 8305d0e0c909a5dd91a21cc1daea6298aae9eda7)
doc/lispref/modes.texi
etc/NEWS
lisp/buff-menu.el
lisp/emacs-lisp/tabulated-list.el
test/lisp/emacs-lisp/tabulated-list-tests.el