emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/denote b5810569fe 10/17: Refactor denote--find-first-un


From: ELPA Syncer
Subject: [elpa] externals/denote b5810569fe 10/17: Refactor denote--find-first-unused-id
Date: Thu, 23 Nov 2023 00:58:02 -0500 (EST)

branch: externals/denote
commit b5810569fe083aa6d6caf23e6b325e64ae698e8c
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>

    Refactor denote--find-first-unused-id
---
 denote.el | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/denote.el b/denote.el
index f1e73e0959..3b54bba581 100644
--- a/denote.el
+++ b/denote.el
@@ -1650,12 +1650,10 @@ It checks files in variable `denote-directory' and 
active buffer files."
   "Return the first unused id starting at ID from USED-IDS.
 USED-IDS is a hash-table of all used IDs.  If ID is already used,
 increment it 1 second at a time until an available id is found."
-  (let ((time (date-to-time id)))
-    (while (gethash
-            (format-time-string denote-id-format time)
-            used-ids)
-      (setq time (time-add time 1)))
-    (format-time-string denote-id-format time)))
+  (let ((current-id id))
+    (while (gethash current-id used-ids)
+      (setq current-id (format-time-string denote-id-format (time-add 
(date-to-time current-id) 1))))
+    current-id))
 
 (make-obsolete 'denote-barf-duplicate-id nil "2.1.0")
 



reply via email to

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