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

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

[elpa] externals/denote b05ea22a11 05/39: Add private function to normal


From: ELPA Syncer
Subject: [elpa] externals/denote b05ea22a11 05/39: Add private function to normalise denote-prompts
Date: Mon, 11 Jul 2022 00:57:40 -0400 (EDT)

branch: externals/denote
commit b05ea22a11eed5fc59b240c9f853045828d4319d
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Add private function to normalise denote-prompts
---
 denote.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/denote.el b/denote.el
index 46862e4e85..0d9af67b5d 100644
--- a/denote.el
+++ b/denote.el
@@ -693,6 +693,20 @@ Optional DEFAULT-TITLE is used as the default value."
 
 ;;;;; The `denote' command
 
+(defun denote--prompts ()
+  "Normalize value of `denote-prompts'.
+Return a list with `title' and `keywords' as its elements if its
+value (i) is not a list (ii) is nil, (iii) does not contain the
+appropriate symbols, per `denote--prompt-symbols'."
+  (let* ((prompts denote-prompts)
+         (symbols denote--prompt-symbols)
+         (common (seq-intersection prompts symbols)))
+    (if (or (not (listp prompts))
+            (null prompts)
+            (null common))
+        '(title keywords)
+      common)))
+
 ;;;###autoload
 (defun denote (&optional title keywords type date subdir)
   "Create a new note with the appropriate metadata and file name.



reply via email to

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