all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Manuel Giraud <manuel@ledu-giraud.fr>
To: emacs-devel <emacs-devel@gnu.org>
Subject: [PATCH] Fix bookmark-bmenu-list sorting.
Date: Thu, 03 Mar 2022 17:39:45 +0100	[thread overview]
Message-ID: <875yovm1m6.fsf@elite.giraud> (raw)

[-- 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

             reply	other threads:[~2022-03-03 16:39 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 16:39 Manuel Giraud [this message]
2022-03-03 17:41 ` [PATCH] Fix bookmark-bmenu-list sorting 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875yovm1m6.fsf@elite.giraud \
    --to=manuel@ledu-giraud.fr \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.