branch: externals/denote
commit c654d2922ac3c7e0a55db7ff846a5004a7ab54c1
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    Bind keywords with let in batch rename
    
    This was it produces the user-error outright if there are no marked
    files.  Before, the prompt would come too early.
---
 denote-dired.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/denote-dired.el b/denote-dired.el
index 26b9487e29..8781d9aec4 100644
--- a/denote-dired.el
+++ b/denote-dired.el
@@ -417,7 +417,7 @@ For per-file-type front matter, refer to the variables:
 
 ;; REVIEW 2022-07-16: This is a proof-of-concept
 ;;;###autoload
-(defun denote-dired-batch-rename (keywords)
+(defun denote-dired-batch-rename ()
   "DEV NOTE 2022-07-16: proof of concept---help flesh it out.
 
 Rename marked files in Dired using the following pattern:
@@ -439,11 +439,12 @@ Rename marked files in Dired using the following pattern:
 
 Batch renaming ignores files that comply with Denote's
 file-naming scheme."
-  (interactive (list (denote--keywords-prompt)) dired-mode)
+  (interactive nil dired-mode)
   (if-let ((marks (dired-get-marked-files)))
       (progn
         (dolist (file marks)
-          (let* ((dir (file-name-directory file))
+          (let* ((keywords (denote--keywords-prompt))
+                 (dir (file-name-directory file))
                  (title (file-name-sans-extension (file-name-nondirectory 
file)))
                  (extension (file-name-extension file t))
                  (new-name (denote--format-file

Reply via email to