From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud Newsgroups: gmane.emacs.devel Subject: [PATCH] Fix bookmark-bmenu-list sorting. Date: Thu, 03 Mar 2022 17:39:45 +0100 Message-ID: <875yovm1m6.fsf@elite.giraud> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15989"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 03 17:41:18 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nPoVx-0003x3-GK for ged-emacs-devel@m.gmane-mx.org; Thu, 03 Mar 2022 17:41:17 +0100 Original-Received: from localhost ([::1]:55102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPoVw-0005Mw-78 for ged-emacs-devel@m.gmane-mx.org; Thu, 03 Mar 2022 11:41:16 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPoUZ-00049b-Ez for emacs-devel@gnu.org; Thu, 03 Mar 2022 11:39:51 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:38994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPoUX-0006kV-DD for emacs-devel@gnu.org; Thu, 03 Mar 2022 11:39:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=g3k3ZZmciXdbzwnk NixS2G/zC9Lx3cf0J6s3xik6EO8=; h=date:subject:to:from; d=ledu-giraud.fr; b=Xnexui/KaYLZfBUDyr9eHZ7E5pmVe3HVGFLSjxx4kx1A2dn3RT V9pLgB/6o9z8X3ymVc/ghjPIJJzej0+plZeWwxVQoPnl3np76GfAEMeA6ujgRpVWvgWz79 tzqS8/w0RH+0Ys0M5GoOIvVDik3qRJY+FIauCo04gYxF+KEFAfM8uk0b/nEEQApdaV9ocM BIr+Ab4G3TeQXrXeN0LapQnSfxq+EAM7ZeOObvknNjIrbtyt7dsHsvHkfQKiHMPyADnJhx q865JXHWOEKSc0ieamONKmV8JQBhmcsUYKphbdph5kcWF95PrG+lnhKUzP9GO3tvMuXYcC PXkTTPI6zvWQ== Original-Received: from elite.giraud ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 22829d20 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Thu, 3 Mar 2022 17:39:45 +0100 (CET) Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286791 Archived-At: --=-=-= Content-Type: text/plain Hi, Here is a patch that I think fix the default `bookmark-bmenu-list' sorting when `bookmark-sort-flag' is nil. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-bookmark-bmenu-list-sorting.patch >From e9ace5a7c965b725b003c910f6608d0bb7e3aaa5 Mon Sep 17 00:00:00 2001 From: Manuel Giraud 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 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=--