Mass rename of keywords #605
-
I’m trying to change a keyword for many files, and it’s not great to do it manually. Do you have a suggestion on how to do it for a bunch of files? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I have written a function to replace a single tag, but I’m wondering what is the best way to apply it to my whole denote collection: (defun my-denote-replace-keyword (old new file)
(let* ((old-keywords (denote-extract-keywords-from-path file))
(keywords (cons new (delete old old-keywords)))
(denote-rename-confirmations nil))
(denote-rename-file file 'keep-current keywords 'keep-current 'keep-current))) |
Beta Was this translation helpful? Give feedback.
-
Maybe this can be done with the command
What I would do for a common case is:
Otherwise, your custom function looks like a step in the right direction. Check how we do it for many files in |
Beta Was this translation helpful? Give feedback.
-
Thank you for the suggestion, it works great. I used the I noticed a small shortcoming, though: as the files are renamed, their name change and I ended up with errors of the form |
Beta Was this translation helpful? Give feedback.
Maybe this can be done with the command
denote-dired-rename-marked-files-with-keywords
?What I would do for a common case is:
denote-dired
and search for_KEYWORD
.t
(dired-toggle-marks
) to mark all the matching files.denote-dired-rename-marked-files-with-keywords
on them.Otherwise, your custom function looks like a step in the right direction. Check how we do it for many files in
denote-dire…