emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 496e191fc7 2/2: Fix last-modified meaning in bookmark.el


From: Lars Ingebrigtsen
Subject: master 496e191fc7 2/2: Fix last-modified meaning in bookmark.el
Date: Wed, 8 Jun 2022 07:52:12 -0400 (EDT)

branch: master
commit 496e191fc73441a0bee67c04010fed7c7965e25c
Author: Manuel Giraud <manuel@ledu-giraud.fr>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix last-modified meaning in bookmark.el
    
    * lisp/bookmark.el (bookmark-update-last-modified): New function
    to update the last-modified field.
    (bookmark-send-edited-annotation, bookmark-relocate)
    (bookmark-rename): Use `bookmark-update-last-modified' in
    annotations editing, relocation and renaming.
---
 lisp/bookmark.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 849303fac7..b0b54e52d8 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -120,7 +120,7 @@ nil means they will be displayed in LIFO order (that is, 
most
 recently created ones come first, oldest ones come last).
 
 `last-modified' means that bookmarks will be displayed sorted
-from most recently set to least recently set.
+from most recently modified to least recently modified.
 
 Other values means that bookmarks will be displayed sorted by
 bookmark name."
@@ -468,10 +468,17 @@ In other words, return all information but the name."
   "Return the handler function for BOOKMARK-NAME-OR-RECORD, or nil if none."
   (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-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)))
+
+
 (defvar bookmark-history nil
   "The history list for bookmark functions.")
 
@@ -1069,6 +1076,7 @@ Lines beginning with `#' are ignored."
         (from-bookmark-list bookmark--annotation-from-bookmark-list)
         (old-buffer (current-buffer)))
     (bookmark-set-annotation bookmark-name annotation)
+    (bookmark-update-last-modified bookmark-name)
     (setq bookmark-alist-modification-count
           (1+ bookmark-alist-modification-count))
     (message "Annotation updated for \"%s\"" bookmark-name)
@@ -1355,6 +1363,7 @@ after a bookmark was set in it."
                     (format "Relocate %s to: " bookmark-name)
                     (file-name-directory bmrk-filename))))))
     (bookmark-set-filename bookmark-name newloc)
+    (bookmark-update-last-modified bookmark-name)
     (setq bookmark-alist-modification-count
           (1+ bookmark-alist-modification-count))
     (if (bookmark-time-to-save-p)
@@ -1417,6 +1426,7 @@ name."
               nil
               'bookmark-history))))
     (bookmark-set-name old-name final-new-name)
+    (bookmark-update-last-modified final-new-name)
     (setq bookmark-current-bookmark final-new-name)
     (bookmark-bmenu-surreptitiously-rebuild-list)
     (setq bookmark-alist-modification-count



reply via email to

[Prev in Thread] Current Thread [Next in Thread]