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

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

[elpa] externals/denote 0844cfb98a 07/14: Rework denote-dired-rename-mar


From: ELPA Syncer
Subject: [elpa] externals/denote 0844cfb98a 07/14: Rework denote-dired-rename-marked-files
Date: Sun, 17 Jul 2022 02:57:29 -0400 (EDT)

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

    Rework denote-dired-rename-marked-files
---
 denote-dired.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/denote-dired.el b/denote-dired.el
index 2a8b3b9d98..09673da018 100644
--- a/denote-dired.el
+++ b/denote-dired.el
@@ -422,11 +422,11 @@ Rename marked files in Dired using the following pattern:
 Batch renaming ignores files that comply with Denote's
 file-naming scheme."
   (interactive nil dired-mode)
-  (if-let ((marks (dired-get-marked-files)))
+  (if-let ((marks (dired-get-marked-files))
+           (keywords (denote--keywords-prompt)))
       (progn
         (dolist (file marks)
-          (let* ((keywords (denote--keywords-prompt))
-                 (dir (file-name-directory file))
+          (let* ((dir (file-name-directory file))
                  (id (denote-dired--file-name-id file))
                  (title (or (denote-retrieve--value-title file)
                             (file-name-sans-extension
@@ -434,8 +434,8 @@ file-naming scheme."
                  (extension (file-name-extension file t))
                  (new-name (denote--format-file
                             dir id keywords (denote--sluggify title) 
extension)))
-            (unless (denote--only-note-p file)
-              (rename-file (file-name-nondirectory file) new-name))))
+            (when (denote--only-note-p file)
+              (rename-file file new-name))))
         (revert-buffer))
     (user-error "No marked files; aborting")))
 



reply via email to

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