mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
* lisp/buff-menu.el (Buffer-menu-group-sort-by): New defcustom.
(list-buffers--refresh): Use Buffer-menu-group-sort-by instead of the hard-coded function (bug#70150). (Buffer-menu-group-sort-alphabetically): New function as an option for 'Buffer-menu-group-sort-by'. (list-buffers-noselect): Remove setting outline-minor-mode-use-buttons to 'in-margins' that it not required for this feature to work correctly. * lisp/emacs-lisp/tabulated-list.el (tabulated-list-groups-sort): Add optional argument 'level'.
This commit is contained in:
parent
979365eef2
commit
9cd182dae8
2 changed files with 22 additions and 9 deletions
|
|
@ -929,14 +929,15 @@ where every string is an outline heading at increasing level of deepness."
|
|||
(cl-pushnew entry (gethash path hash))))
|
||||
(trie-get tree nil))))
|
||||
|
||||
(defun tabulated-list-groups-sort (tree sort-function)
|
||||
(defun tabulated-list-groups-sort (tree sort-function &optional level)
|
||||
"Sort TREE using the sort function SORT-FUN."
|
||||
(unless level (setq level 1))
|
||||
(mapcar (lambda (elt)
|
||||
(if (vectorp (cdr elt))
|
||||
elt
|
||||
(cons (car elt) (tabulated-list-groups-sort
|
||||
(cdr elt) sort-function))))
|
||||
(funcall sort-function tree)))
|
||||
(cdr elt) sort-function (1+ level)))))
|
||||
(funcall sort-function tree level)))
|
||||
|
||||
(defun tabulated-list-groups-flatten (tree)
|
||||
"Flatten multi-level TREE to single level."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue