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: [External] : [emacs bookmark.el] Sorting by last set Date: Wed, 01 Jun 2022 15:45:54 +0200 Message-ID: <87v8tkbip9.fsf@elite.giraud> References: <877d6b88pz.fsf@elite.giraud> <875ylv6j58.fsf@elite.giraud> <87o7zngcgf.fsf@gnus.org> <87k0a93g4z.fsf@elite.giraud> <87y1yp1vnw.fsf@elite.giraud> <877d69lyt2.fsf@red-bean.com> <87ilpsd0hv.fsf@gnus.org> <87tu9c1c0k.fsf@elite.giraud> <87leuo12fh.fsf@elite.giraud> <87zgj38ds1.fsf@gnus.org> <875ylr15nm.fsf@elite.giraud> <8735gv6rim.fsf@gnus.org> <871qwf14ef.fsf@elite.giraud> <878rqm54kc.fsf@gnus.org> <87czfvjcbx.fsf@elite.giraud> <878rqh5z2v.fsf@gnus.org> 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="30177"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix) Cc: Manuel Giraud , Stefan Monnier , Karl Fogel , Drew Adams , emacs-devel To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 01 15:47:03 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 1nwOgg-0007Vr-N0 for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Jun 2022 15:47:02 +0200 Original-Received: from localhost ([::1]:39640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwOgf-0001bn-1J for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Jun 2022 09:47:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwOfg-0000w9-GV for emacs-devel@gnu.org; Wed, 01 Jun 2022 09:46:00 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:6802) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwOfe-0003xG-C1 for emacs-devel@gnu.org; Wed, 01 Jun 2022 09:46:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=gMqUhQg/PdhLq+35 nK++huVmFZczNevmVMvko/Fg19o=; h=in-reply-to:date:references:subject: cc:to:from; d=ledu-giraud.fr; b=zHuDZfaKxCtjgZhVIZIZi0yFppjiBnrWm2GSj6 hdhGjk37P4QGlfJ8ju8VoNL/aOzlZtlw6tYvIR2dEehGA+ttBWNQlXPr0q4x+pw72v8y26 coX4FmOxvrnpZEMIoVU5iQlYVbArT6eax9Is9V6lxUbS+DWjt4b0hCYL4+sWQd1L8FLXSv 0WfBrx5JXmXLuaMDRI9fITuXhk4I8oRU+CpcudjpxLn+5tbNPTxk9efGi1grKJU+a/B1h2 8w8TYZw2AZ6Q9Tjp4ToDaUGFC6JSkaz2qIwCqldtpQkrfhjWnRMnxsjKqDAR1Jo0ONHAWt aWZ4Kt0o2ZTG65ZFgBk+O6LA== Original-Received: from elite.giraud ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 81c4bf57 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 1 Jun 2022 15:45:55 +0200 (CEST) In-Reply-To: <878rqh5z2v.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 31 May 2022 20:36:24 +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:290510 Archived-At: --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Thanks; pushed to Emacs 29 (with some whitespace and naming changes to > make it fit our conventions). Sorry, here is two issues I found. The first is a typo in a docstring. The second sorts bookmark entries without a last-modified field at the end when `bookmark-sort-flag' is 'last-modified: I think it would help transitioning. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-typo-in-bookmark.el.patch >From e6fabc074c85d403e4644388af231c5db4fcc8dd Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Wed, 1 Jun 2022 14:43:58 +0200 Subject: [PATCH 1/2] typo in bookmark.el --- lisp/bookmark.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 8e251e9de8..6f7dcc7f0e 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -120,7 +120,7 @@ bookmark-sort-flag recently created ones come first, oldest ones come last). `last-modified' means that bookmarks will be displayed sorted -from most recently set to last recently set. +from most recently set to least recently set. Other values means that bookmarks will be displayed sorted by bookmark name." -- 2.36.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-place-bookmarks-without-last-modified-at-the-end.patch >From d2601de9c8a3c7c9eeaa6547bdc6d1387fbbe78e Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Wed, 1 Jun 2022 15:30:19 +0200 Subject: [PATCH 2/2] place bookmarks without last-modified at the end --- lisp/bookmark.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 6f7dcc7f0e..849303fac7 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -520,8 +520,11 @@ bookmark-maybe-sort-alist (sort copy (lambda (x y) (string-lessp (car x) (car y))))) ((eq bookmark-sort-flag 'last-modified) (sort copy (lambda (x y) - (time-less-p (bookmark-get-last-modified y) - (bookmark-get-last-modified x))))) + (let ((tx (bookmark-get-last-modified x)) + (ty (bookmark-get-last-modified y))) + (cond ((null tx) nil) + ((null ty) t) + (t (time-less-p ty tx))))))) (t copy)))) (defun bookmark-completing-read (prompt &optional default) -- 2.36.0 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=--