]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bookmark-bmenu-list sorting.
authorManuel Giraud <manuel@ledu-giraud.fr>
Thu, 3 Mar 2022 16:32:13 +0000 (17:32 +0100)
committerKarl Fogel <kfogel@red-bean.com>
Mon, 7 Mar 2022 05:14:30 +0000 (23:14 -0600)
Do not sort bookmarks in `bookmark-bmenu-list' if `bookmark-sort-flag'
is nil.

Also, make the default order of bookmark-bmenu-list be the LIFO order
defined in `bookmark-sort-flag's documentation.

lisp/bookmark.el

index 27517318171b5370645e6801f4c336ae6ce2a368..80fb1cdfc781bb434aa974bfb1ac6627f02116fc 100644 (file)
@@ -1819,7 +1819,7 @@ Don't affect the buffer ring order."
                        (list location))])
               entries)))
     (tabulated-list-init-header)
-    (setq tabulated-list-entries entries))
+    (setq tabulated-list-entries (reverse entries)))
   (tabulated-list-print t))
 
 ;;;###autoload
@@ -1907,7 +1907,8 @@ Bookmark names preceded by a \"*\" have annotations.
           ,@(if bookmark-bmenu-toggle-filenames
                 '(("File" 0 bookmark-bmenu--file-predicate)))])
   (setq tabulated-list-padding bookmark-bmenu-marks-width)
-  (setq tabulated-list-sort-key '("Bookmark" . nil))
+  (when bookmark-sort-flag
+    (setq tabulated-list-sort-key '("Bookmark" . nil)))
   (add-hook 'tabulated-list-revert-hook #'bookmark-bmenu--revert nil t)'
   (setq revert-buffer-function 'bookmark-bmenu--revert)
   (tabulated-list-init-header))