From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix bookmark-bmenu-list sorting. Date: Fri, 04 Mar 2022 21:37:14 +0200 Message-ID: <83v8wth5lh.fsf@gnu.org> References: <875yovm1m6.fsf@elite.giraud> <87v8wvkk64.fsf@red-bean.com> <83v8wuj3v0.fsf@gnu.org> <87tucewgu7.fsf@red-bean.com> <83lexqi3z9.fsf@gnu.org> <87tuceuo4b.fsf@red-bean.com> <83czj2hrdv.fsf@gnu.org> <87a6e5lui6.fsf@elite.giraud> <837d99j10x.fsf@gnu.org> <874k4dlpeg.fsf@elite.giraud> <834k4divrt.fsf@gnu.org> <87wnh9k43g.fsf@elite.giraud> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27272"; mail-complaints-to="usenet@ciao.gmane.io" Cc: kfogel@red-bean.com, emacs-devel@gnu.org To: Manuel Giraud Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 04 20:52:04 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 1nQDy7-0006vZ-S7 for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Mar 2022 20:52:04 +0100 Original-Received: from localhost ([::1]:44132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQDy6-0004jz-IE for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Mar 2022 14:52:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQDju-0003Hr-G8 for emacs-devel@gnu.org; Fri, 04 Mar 2022 14:37:24 -0500 Original-Received: from [2001:470:142:3::e] (port=57344 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQDjt-0004QX-1P; Fri, 04 Mar 2022 14:37:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=w5z1Bh7jo7ah+7PxqVkE8CCH4q89PA3GdqMmfaCYgV8=; b=TUxEsqLfkFG9 cng+8kLDj9WbRPW03Oj/Ykp+j6BgAAMIdi8g+7v+xhpEKxkrRT3wJUNx0ckPp7nWWz04SvSvKG80N 9wthceX/faoIcsEnCYj2Nl7hgmIlZrTBmw47yJ87vinvoJhQAH4lcZD01aysVf3w1Hzww6ca3Ifb0 b7lsP1aK15VtFYhNp+PKXPxT7oCdxT9J4JSHklsvrsjefvCuIjYaJUzvYSU7Zh0cjr33ASjrUuUHQ yvOOWwZfSGp5wVZ1o8KoJGdeiAKC+MYG4iSzd6D4xGO1K/4ZL70/oRwuWE8v1enuE6NntU4fQuF3i GfCt4i7RnP1t9g84a0rxeQ==; Original-Received: from [87.69.77.57] (port=3782 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQDjs-000689-FI; Fri, 04 Mar 2022 14:37:20 -0500 In-Reply-To: <87wnh9k43g.fsf@elite.giraud> (message from Manuel Giraud on Fri, 04 Mar 2022 18:41:23 +0100) 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:286827 Archived-At: > From: Manuel Giraud > Cc: kfogel@red-bean.com, emacs-devel@gnu.org > Date: Fri, 04 Mar 2022 18:41:23 +0100 > > Eli Zaretskii writes: > > [...] > > > One more question: your patch included this part: > > > >> 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)) > > > > Why is that needed? > > It is needed because the 'entries' list is constructed by iterating over > 'bookmark-alist' and pushing new element to it. So in the end, 'entries' > is in the exact reverse order of 'bookmark-alist'. > > As it seems intended that 'bookmark-alist' is ordered with most recent > bookmark at the beginning, I tried to keep this order in the "Bookmark > List" buffer. Thanks. Let's install this on master. We can consider backporting to the emacs-28 branch after Emacs 28.1 is released.