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

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

[elpa] externals/denote adf8c6fdc8 02/33: Update denote-create-* command


From: ELPA Syncer
Subject: [elpa] externals/denote adf8c6fdc8 02/33: Update denote-create-* commands to respect `denote-prompts`
Date: Wed, 14 Feb 2024 06:57:46 -0500 (EST)

branch: externals/denote
commit adf8c6fdc8d49b0c5957d949f14a7a3f504d1c46
Author: Vedang Manerikar <ved.manerikar@gmail.com>
Commit: Vedang Manerikar <ved.manerikar@gmail.com>

    Update denote-create-* commands to respect `denote-prompts`
    
    This commit modifies the following functions:
    
    - `denote-type`
    - `denote-date`
    - `denote-subdirectory`
    - `denote-template`
    - `denote-signature`
    
    Instead of overwriting the value of `denote-prompts`, this change adds
    the specific symbol to the existing value of `denote-prompts`.
---
 denote.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/denote.el b/denote.el
index c3e5cb52ca..2d1d505184 100644
--- a/denote.el
+++ b/denote.el
@@ -2249,6 +2249,10 @@ With optional PROMPT-TEXT use it instead of a generic 
prompt."
 (defalias 'denote-create-note 'denote
   "Alias for `denote' command.")
 
+(defun denote--add-prompts (additional-prompts)
+  "Add all the elements in the ADDITIONAL-PROMPTS list to `denote-prompts'."
+  (seq-union denote-prompts additional-prompts))
+
 ;;;###autoload
 (defun denote-type ()
   "Create note while prompting for a file type.
@@ -2257,7 +2261,7 @@ This is the equivalent to calling `denote' when 
`denote-prompts'
 is set to \\='(file-type title keywords)."
   (declare (interactive-only t))
   (interactive)
-  (let ((denote-prompts '(file-type title keywords)))
+  (let ((denote-prompts (denote--add-prompts '(file-type))))
     (call-interactively #'denote)))
 
 (defalias 'denote-create-note-using-type 'denote-type
@@ -2276,7 +2280,7 @@ This is the equivalent to calling `denote' when 
`denote-prompts'
 is set to \\='(date title keywords)."
   (declare (interactive-only t))
   (interactive)
-  (let ((denote-prompts '(date title keywords)))
+  (let ((denote-prompts (denote--add-prompts '(date))))
     (call-interactively #'denote)))
 
 (defalias 'denote-create-note-using-date 'denote-date
@@ -2293,7 +2297,7 @@ This is equivalent to calling `denote' when 
`denote-prompts' is
 set to \\='(subdirectory title keywords)."
   (declare (interactive-only t))
   (interactive)
-  (let ((denote-prompts '(subdirectory title keywords)))
+  (let ((denote-prompts (denote--add-prompts '(subdirectory))))
     (call-interactively #'denote)))
 
 (defalias 'denote-create-note-in-subdirectory 'denote-subdirectory
@@ -2311,7 +2315,7 @@ This is equivalent to calling `denote' when 
`denote-prompts' is
 set to \\='(template title keywords)."
   (declare (interactive-only t))
   (interactive)
-  (let ((denote-prompts '(template title keywords)))
+  (let ((denote-prompts (denote--add-prompts '(template))))
     (call-interactively #'denote)))
 
 (defalias 'denote-create-note-with-template 'denote-template
@@ -2325,7 +2329,7 @@ This is the equivalent to calling `denote' when 
`denote-prompts'
 is set to \\='(signature title keywords)."
   (declare (interactive-only t))
   (interactive)
-  (let ((denote-prompts '(signature title keywords)))
+  (let ((denote-prompts (denote--add-prompts '(signature))))
     (call-interactively #'denote)))
 
 (defalias 'denote-create-note-using-signature 'denote-signature



reply via email to

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