From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.devel Subject: Re: [External] : [emacs bookmark.el] Sorting by last set Date: Thu, 18 Aug 2022 13:19:50 -0500 Message-ID: <87y1vl4do9.fsf@red-bean.com> References: <875ylhvu4k.fsf@red-bean.com> <87a6ar84rn.fsf@elite.giraud> <878rq82r05.fsf@red-bean.com> <87h74voaei.fsf@elite.giraud> <878rpznts7.fsf@elite.giraud> Reply-To: Karl Fogel 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="7834"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Drew Adams , Lars Ingebrigtsen , Stefan Monnier , emacs-devel To: Manuel Giraud Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 18 20:22:11 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 1oOk9i-0001ot-K4 for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Aug 2022 20:22:11 +0200 Original-Received: from localhost ([::1]:50322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oOk9g-0007RI-75 for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Aug 2022 14:22:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOk7X-0006CT-H1 for emacs-devel@gnu.org; Thu, 18 Aug 2022 14:19:55 -0400 Original-Received: from sanpietro.red-bean.com ([45.79.25.59]:47964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOk7V-0000Qi-ST for emacs-devel@gnu.org; Thu, 18 Aug 2022 14:19:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=red-bean.com; s=202005newsp; h=Content-Type:MIME-Version:Message-ID:Date: Reply-To:References:In-Reply-To:Subject:Cc:To:From:Sender: Content-Transfer-Encoding:Content-ID:Content-Description; bh=9ZUE/MmRnWfHFT8342U3JDM3G65RNDhTUOc0HmlnYw8=; t=1660846793; x=1662056393; b=EuefnJB7i238ufW9fxiA50+LBvRtZIqhzlbzeirdRVpUTUO01U5I7S7JNpl02Q170TD1jbs6d6m 0JwGw0Iya3FEQbpqev897lxkP/aDxGAkTZzp6OTZQ6dp/PMk+ltDqfGlD2k0xj/iHrrcIydBTYrZz Te0Qf2uCyTUmN2IUpsqWUz0lz4nIYVZS8AolqzOZo0fYthBOoTme3yxE3z1CBROJmHaaAX9oEI2dR 3Va7UJ/iUgnRJsbyjlylm3BganBt71XKSoh3gbh9NM/20S6vlrjBpkgRewsBfnWqT92IFa+d4aFGN ze13VgJnVqwuAI2JLtlZ1elNQDO6CGyjbCjw==; Original-Received: from [2600:1700:5654:2110:3818:6b31:20b:2bed] (port=49502 helo=tcd) by sanpietro.red-bean.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oOk7T-00DGtF-4W; Thu, 18 Aug 2022 18:19:51 +0000 In-Reply-To: <878rpznts7.fsf@elite.giraud> (Manuel Giraud's message of "Tue, 14 Jun 2022 17:34:16 +0200") Received-SPF: pass client-ip=45.79.25.59; envelope-from=kfogel@red-bean.com; helo=sanpietro.red-bean.com 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:293618 Archived-At: --=-=-= Content-Type: text/plain; format=flowed On 14 Jun 2022, Manuel Giraud wrote: >I hope it is not to late for this but I'd like to have this >modification >pushed. This changes the field name from 'last-modified to >'modified >(the symbol for `bookmark-sort-flag' is kept to 'last-modified). > >I think it make more sense since the "last" in 'last-modified >refers to >the order (ie. the most recently modified will be first). >Afterward, >I'd like to introduce a 'created field too. Manuel, it looks like this change hasn't been pushed yet. I was about to review it, but I noticed there was some commentary in the thread following up to your post. Did you have a revised version of the patch in response to any of the commentary, or should I just review the original patch as you posted it on 14 June 2022? I'll attach the patch below for convenience. Best regards, -Karl --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Change-last-modified-field-name-to-modified.patch >>From 7fe15765e2777d5e001558d6648c7d5f250d34bc Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Tue, 14 Jun 2022 17:22:04 +0200 Subject: [PATCH] Change 'last-modified field name to 'modified * lisp/bookmark.el: change 'last-modified field name to 'modified --- lisp/bookmark.el | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index b0b54e52d8..64b8ee7f5e 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -469,14 +469,14 @@ bookmark-get-handler (bookmark-prop-get bookmark-name-or-record 'handler)) -(defun bookmark-get-last-modified (bookmark-name-or-record) - "Return the last-modified for BOOKMARK-NAME-OR-RECORD, or nil if none." - (bookmark-prop-get bookmark-name-or-record 'last-modified)) +(defun bookmark-get-modified (bookmark-name-or-record) + "Return the modified for BOOKMARK-NAME-OR-RECORD, or nil if none." + (bookmark-prop-get bookmark-name-or-record 'modified)) -(defun bookmark-update-last-modified (bookmark-name-or-record) - "Update the last-modified date of BOOKMARK-NAME-OR-RECORD to the current time." - (bookmark-prop-set bookmark-name-or-record 'last-modified (current-time))) +(defun bookmark-update-modified (bookmark-name-or-record) + "Update the modified date of BOOKMARK-NAME-OR-RECORD to the current time." + (bookmark-prop-set bookmark-name-or-record 'modified (current-time))) (defvar bookmark-history nil @@ -527,8 +527,8 @@ 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) - (let ((tx (bookmark-get-last-modified x)) - (ty (bookmark-get-last-modified y))) + (let ((tx (bookmark-get-modified x)) + (ty (bookmark-get-modified y))) (cond ((null tx) nil) ((null ty) t) (t (time-less-p ty tx))))))) @@ -666,7 +666,7 @@ bookmark-make-record-default (- (point) bookmark-search-size)) nil)))) (position . ,(or posn (point))) - (last-modified . ,(current-time)))) + (modified . ,(current-time)))) ;;; File format stuff @@ -1076,7 +1076,7 @@ bookmark-send-edited-annotation (from-bookmark-list bookmark--annotation-from-bookmark-list) (old-buffer (current-buffer))) (bookmark-set-annotation bookmark-name annotation) - (bookmark-update-last-modified bookmark-name) + (bookmark-update-modified bookmark-name) (setq bookmark-alist-modification-count (1+ bookmark-alist-modification-count)) (message "Annotation updated for \"%s\"" bookmark-name) @@ -1363,7 +1363,7 @@ bookmark-relocate (format "Relocate %s to: " bookmark-name) (file-name-directory bmrk-filename)))))) (bookmark-set-filename bookmark-name newloc) - (bookmark-update-last-modified bookmark-name) + (bookmark-update-modified bookmark-name) (setq bookmark-alist-modification-count (1+ bookmark-alist-modification-count)) (if (bookmark-time-to-save-p) @@ -1426,7 +1426,7 @@ bookmark-rename nil 'bookmark-history)))) (bookmark-set-name old-name final-new-name) - (bookmark-update-last-modified final-new-name) + (bookmark-update-modified final-new-name) (setq bookmark-current-bookmark final-new-name) (bookmark-bmenu-surreptitiously-rebuild-list) (setq bookmark-alist-modification-count -- 2.36.1 --=-=-=--