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: Tue, 14 Jun 2022 17:34:16 +0200 Message-ID: <878rpznts7.fsf@elite.giraud> References: <875ylhvu4k.fsf@red-bean.com> <87a6ar84rn.fsf@elite.giraud> <878rq82r05.fsf@red-bean.com> <87h74voaei.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="16047"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix) Cc: Karl Fogel , Lars Ingebrigtsen , Stefan Monnier , emacs-devel To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 14 17:35:46 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 1o18a0-0003xB-Mz for ged-emacs-devel@m.gmane-mx.org; Tue, 14 Jun 2022 17:35:44 +0200 Original-Received: from localhost ([::1]:55754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o18Zz-00086q-Cq for ged-emacs-devel@m.gmane-mx.org; Tue, 14 Jun 2022 11:35:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o18Yu-0007OC-Gl for emacs-devel@gnu.org; Tue, 14 Jun 2022 11:34:36 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:26381) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o18Yg-00087C-UN for emacs-devel@gnu.org; Tue, 14 Jun 2022 11:34:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=RxDXMDErffoGVyhP gFBUgwq4YNZpSBCYc1QGvg8j5kU=; h=in-reply-to:date:references:subject: cc:to:from; d=ledu-giraud.fr; b=ZmBjq0TpodJj9qfstpt353YUdvqbIcSqOS50hJ TbnwfEkA//XwrFP3DZy4juobOZUxDmZtBPbQgajWBbj3ZQ2vwsTbR+bAXUQJHC68PUY85a 2pmPwckWc3pc3L7HpRWOt0T1zTDT0gW4eohtaQI36yqmhJeAa/v4wmddxFQPhNeT1hE5zU yUZlnvo7ID/f3F4UFVl/bBB2vHXi/nqz+06iPQiVfSlSvfuf1qA9QMgrU2YwB79EV2BRGZ QfVAwg+O4Iat9WNLqQPqNtZXII2HxLuMlgw55Yisd6RZnqjFa3WnsZhhbdSvwyQ70kemTK 56dIJLUojfSsQNI1UW3o4kGw== Original-Received: from elite.giraud ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 70de2ca8 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 Jun 2022 17:34:17 +0200 (CEST) In-Reply-To: <87h74voaei.fsf@elite.giraud> (Manuel Giraud's message of "Wed, 08 Jun 2022 09:57:09 +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:291181 Archived-At: --=-=-= Content-Type: text/plain Hi all, 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. Best regards, --=-=-= Content-Type: text/x-patch 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 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=--