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: Re: [PATCH] Fix bookmark-bmenu-list sorting. Date: Fri, 04 Mar 2022 18:41:23 +0100 Message-ID: <87wnh9k43g.fsf@elite.giraud> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40522"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix) Cc: kfogel@red-bean.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 04 19:26:54 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 1nQCdi-000APr-G1 for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Mar 2022 19:26:54 +0100 Original-Received: from localhost ([::1]:43856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQCdh-0005bu-D1 for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Mar 2022 13:26:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQBvo-0006os-Pc for emacs-devel@gnu.org; Fri, 04 Mar 2022 12:41:32 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:20555) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQBvm-0003TD-Tn; Fri, 04 Mar 2022 12:41:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=aK8C7axyKDw2rSEZ j02XS3LttqDNVgrjVRsdNQbSNGM=; h=in-reply-to:date:references:subject: cc:to:from; d=ledu-giraud.fr; b=hOwjYiHjUtsTnFlhs58wj9qBf2OtAsjNYalBQT ZeDonbmvk9JQepZ1+dUTi/kuBKiM+owShDMMmLPvt8ZbTNUIkbwtL0zI6wrPIOAMA+gdne ow1BbeKGQDu4UMeE45SrUDksUFBuvlgfDsNEdMWiziknyvG2AqGDO3ZeWImFqlcBip1FNk 5UDEzw2EpwBTtiX255R3FVVRbSc0Xd68ym7P5opDZs2QTYSYgFLUSf3xEFSscggko70ww0 miPch6eeZJxwBxEQ7QGbTwx5CTDjhqf8Ip/GcNRX21AqVNtWl0V9+qpFO/d43O96OarY9t ElmyeXSyUun4a7Q9WA1V3oFQ== Original-Received: from elite.giraud ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id ae741f7a (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Fri, 4 Mar 2022 18:41:25 +0100 (CET) In-Reply-To: <834k4divrt.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 04 Mar 2022 17:26:30 +0200") 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:286826 Archived-At: 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. -- Manuel Giraud