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

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

[elpa] externals/denote 7bdfeb7e27 2/9: Use seq-union and seq-difference


From: ELPA Syncer
Subject: [elpa] externals/denote 7bdfeb7e27 2/9: Use seq-union and seq-difference in denote-keywords--combine
Date: Sat, 20 Apr 2024 06:57:48 -0400 (EDT)

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

    Use seq-union and seq-difference in denote-keywords--combine
---
 denote.el | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/denote.el b/denote.el
index 2572ee82d9..1a0fbc98ab 100644
--- a/denote.el
+++ b/denote.el
@@ -2925,18 +2925,11 @@ KEYWORDS are the existing keywords for the underlying 
file.
 This function is an internal implementation function."
   (cond
    ((eq combination-type :add)
-    (denote-keywords-sort
-     (delete-dups
-      (append user-input-keywords keywords))))
-
+    (seq-union keywords user-input-keywords))
    ((eq combination-type :replace)
-    (denote-keywords-sort user-input-keywords))
-
+    user-input-keywords)
    ((eq combination-type :remove)
-    (denote-keywords-sort
-     (dolist (k user-input-keywords keywords)
-       (setq keywords (delete k keywords)))))
-
+    (seq-difference keywords user-input-keywords))
    (t
     (error "Unknown operation in denote-keywords--combine: %s"
            combination-type))))
@@ -2962,7 +2955,8 @@ This function is an internal implementation function."
                  (extension (denote-get-file-extension file))
                  (keywords (split-string (or 
(denote-retrieve-filename-keywords file) "")
                                          "_" :omit-nulls "_"))
-                 (new-keywords (denote-keywords--combine combination-type 
user-input-keywords keywords))
+                 (new-keywords (denote-keywords-sort
+                                (denote-keywords--combine combination-type 
user-input-keywords keywords)))
                  (new-name (denote-format-file-name dir id new-keywords title 
extension signature)))
             (denote-rename-file-and-buffer file new-name)
             (when (denote-file-is-writable-and-supported-p new-name)



reply via email to

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