[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 232bd908ef: Make denote-rename-file and denote-d
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 232bd908ef: Make denote-rename-file and denote-dired-rename-files prompt for signature, if it exists |
Date: |
Sat, 16 Mar 2024 06:57:50 -0400 (EDT) |
branch: externals/denote
commit 232bd908ef633c3de4bfc71fa3dbe0f4f99c9c84
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Make denote-rename-file and denote-dired-rename-files prompt for signature,
if it exists
This is a case where we do not want to unconditionally remove the
signature when 'denote-prompts' does not include a signature prompt.
Signatures only exist in the file name, not any front matter, so we
want to give the user the chance to decide what to do with an existing
one while renaming the file.
Files without a signature are not affected by this change.
---
README.org | 6 ++++++
denote.el | 17 +++++++++++++----
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/README.org b/README.org
index 45de15e847..549e5292e1 100644
--- a/README.org
+++ b/README.org
@@ -1224,6 +1224,12 @@ The command does the same for the =SIGNATURE= prompt,
subject to
~denote-prompts~, by prefilling the minibuffer with the current
signature of =FILE=, if any.
+In interactive use, if =FILE= has a signature, ~denote-rename-file~
+produces a =SIGNATURE= prompt regardless of the value of ~denote-prompts~.
+This way, notes created with the ~denote-signature~ command, or
+equivalent, as a derogation from the norm imposed by ~denote-prompt~,
+do not necessarily lose their signature.
+
Same principle for the =KEYWORDS= prompt: it converts the keywords in
the file name into a comma-separated string and prefills the minibuffer
with it (the =KEYWORDS= prompt accepts more than one keywords, each
diff --git a/denote.el b/denote.el
index e7651e5352..c02c5ba17a 100644
--- a/denote.el
+++ b/denote.el
@@ -2743,9 +2743,14 @@ minibuffer that consists of the current title of FILE.
The
current title is either retrieved from the front matter (such as
the #+title in Org) or from the file name.
-Do the same for the SIGNATURE prompt, subject to `denote-prompts',
-by prefilling the minibuffer with the current signature of FILE,
-if any.
+Do the same for the SIGNATURE prompt, subject to `denote-prompts', by
+prefilling the minibuffer with the current signature of FILE, if any.
+
+In interactive use, if FILE has a signature, produce a SIGNATURE prompt
+regardless of the value of `denote-prompts'. This way, notes created
+with the `denote-signature' command, or equivalent, as a derogation from
+the norm imposed by `denote-prompt', do not necessarily lose their
+signature.
Same principle for the KEYWORDS prompt: convert the keywords in
the file name into a comma-separated string and prefill the
@@ -2834,6 +2839,10 @@ one-by-one, use `denote-dired-rename-files'."
('date
(unless (denote-file-has-identifier-p file)
(aset args 3 (denote-date-prompt))))))
+ (when (denote-file-has-signature-p file)
+ (aset args 2 (denote-signature-prompt
+ (or (denote-retrieve-filename-signature file) "")
+ (format "Rename `%s' with signature (empty to remove)"
file-in-prompt))))
(append (vector file) args nil)))
(let* ((dir (file-name-directory file))
(id (or (denote-retrieve-filename-identifier file)
@@ -2889,7 +2898,7 @@ setting `denote-rename-no-confirm' to a non-nil value)."
(denote-keywords-prompt
(format "Rename `%s' with keywords (empty to
remove)" file-in-prompt)
(denote-convert-file-name-keywords-to-crm (or
(denote-retrieve-filename-keywords file) ""))))))
- (signature (when signature-p
+ (signature (when (or signature-p (denote-file-has-signature-p
file))
(denote-signature-prompt
(or (denote-retrieve-filename-signature file)
"")
(format "Rename `%s' with signature (empty to
remove)" file-in-prompt))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/denote 232bd908ef: Make denote-rename-file and denote-dired-rename-files prompt for signature, if it exists,
ELPA Syncer <=