unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Fix bookmark-bmenu-list sorting.
@ 2022-03-03 16:39 Manuel Giraud
  2022-03-03 17:41 ` Karl Fogel
  0 siblings, 1 reply; 31+ messages in thread
From: Manuel Giraud @ 2022-03-03 16:39 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 114 bytes --]

Hi,

Here is a patch that I think fix the default `bookmark-bmenu-list'
sorting when `bookmark-sort-flag' is nil.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-bookmark-bmenu-list-sorting.patch --]
[-- Type: text/x-patch, Size: 1438 bytes --]

From e9ace5a7c965b725b003c910f6608d0bb7e3aaa5 Mon Sep 17 00:00:00 2001
From: Manuel Giraud <manuel@ledu-giraud.fr>
Date: Thu, 3 Mar 2022 17:32:13 +0100
Subject: [PATCH] Fix bookmark-bmenu-list sorting.

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 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 2751731817..80fb1cdfc7 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1819,7 +1819,7 @@ bookmark-bmenu--revert
                        (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-bmenu-mode
           ,@(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))
-- 
2.35.1


[-- Attachment #3: Type: text/plain, Size: 18 bytes --]

-- 
Manuel Giraud

^ permalink raw reply related	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2022-04-26  7:51 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03 16:39 [PATCH] Fix bookmark-bmenu-list sorting Manuel Giraud
2022-03-03 17:41 ` Karl Fogel
2022-03-03 18:19   ` Eli Zaretskii
2022-03-04  3:13     ` Karl Fogel
2022-03-04  7:14       ` Eli Zaretskii
2022-03-04  8:18         ` Karl Fogel
2022-03-04 11:46           ` Eli Zaretskii
2022-03-04 13:25             ` Manuel Giraud
2022-03-04 13:33               ` Eli Zaretskii
2022-03-04 15:15                 ` Manuel Giraud
2022-03-04 15:26                   ` Eli Zaretskii
2022-03-04 17:41                     ` Manuel Giraud
2022-03-04 19:37                       ` Eli Zaretskii
2022-03-07  3:32                         ` Karl Fogel
2022-03-07  9:21                           ` Manuel Giraud
2022-03-20 23:40                             ` Karl Fogel
2022-03-21  7:54                               ` Manuel Giraud
2022-03-21 14:14                                 ` Karl Fogel
2022-04-20 18:09                             ` [PATCH] Improve sorting in the bookmark list buffer Karl Fogel
2022-04-20 19:02                               ` Eli Zaretskii
2022-04-20 19:49                                 ` Karl Fogel
2022-04-24 17:30                                 ` Karl Fogel
2022-04-24 18:13                                   ` Eli Zaretskii
2022-04-24 19:10                                     ` Karl Fogel
2022-04-25  9:35                                       ` Manuel Giraud
2022-04-25 17:50                                         ` Karl Fogel
2022-04-26  7:51                                           ` Manuel Giraud
2022-03-07 13:12                           ` [PATCH] Fix bookmark-bmenu-list sorting Eli Zaretskii
2022-03-07 19:03                             ` Karl Fogel
2022-03-07  5:17                         ` Karl Fogel
2022-03-04  8:34         ` Manuel Giraud

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).