Commit 61e51fee authored by Stefan Kangas's avatar Stefan Kangas

Base bookmark-bmenu-mode on tabulated-list-mode (Bug#39293)

Rewriting bookmark-bmenu-mode to be based on 'tabulated-list-mode'
allows us to greatly simplify the code in several cases.  In addition,
we get some features for free, such as sorting by column.

The only functional step backwards is that we no longer support the
optional "inline" header line, a bookmark.el-specific feature to have
a header without using 'header-line-format'.  This feature is believed
to be not very useful or widely used.

* lisp/bookmark.el (tabulated-list): Require.
(bookmark-bmenu-mode): Inherit from 'tabulated-list-mode' instead of
'special-mode' and make the necessary changes to support that.
(bookmark-bmenu-mode-map): Inherit from 'tabulated-list-mode-map'
instead of 'special-mode-map'.  Remove now duplicate key bindings.
(bookmark-bmenu--revert): New function to show the bookmark list using
(bookmark-bmenu-list): Simplify by using above new function.
(bookmark-bmenu-bookmark): Adapt to 'tabulated-list-mode'.
(bookmark-bmenu--file-predicate): New functions used by
'tabulated-list-mode' to sort.

(bookmark-bmenu-set-header): Redefine as obsolete function alias for
(bookmark-bmenu-toggle-filenames, bookmark-bmenu-show-filenames)
(bookmark-bmenu-hide-filenames, bookmark-bmenu-mark)
(bookmark-bmenu-mark-all, bookmark-bmenu-unmark-all)
(bookmark-bmenu-delete-all, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-delete-backwards): Simplify now
that we can depend on 'tabulated-list-mode' to do more work.

(bookmark-bmenu-inline-header-height): Declare variables relating to
the now unsupported "inline" header obsolete.
(bookmark-bmenu-execute-deletions): Remove code to handle "inline" header.

* test/lisp/bookmark-tests.el
(bookmark-test-bmenu-unmark, bookmark-test-bmenu-mark): Update tests
for minor changes when using 'tabulated-list-mode'.
parent f532e0c3
Pipeline #7392 failed with stage
in 95 minutes and 54 seconds