branch: externals/denote
commit d3b1be0732054d2ae7ec73b8473bd7ab4949cb95
Author: Jean-Philippe Gagné Guay <jeanphilippe...@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe...@gmail.com>

    Use default symbol as default value for denote-use-keywords
    
    nil is the empty list and can be a valid value for denote-use-keywords
---
 README.org | 2 +-
 denote.el  | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index d3e9a803a9..c03c549baa 100644
--- a/README.org
+++ b/README.org
@@ -5108,7 +5108,7 @@ The following sections cover the specifics.
 #+findex: denote-use-keywords
 + Function ~denote-use-keywords~ :: The keywords to be used in a note
   creation command. See the documentation of ~denote~ for acceptable
-  values. This variable is ignored if nil. Only ever ~let~ bind this,
+  values. This variable is ignored if ~default~. Only ever ~let~ bind this,
   otherwise the title will always be the same and the title prompt
   will be skipped.
 
diff --git a/denote.el b/denote.el
index 9f16c50609..d2482f7399 100644
--- a/denote.el
+++ b/denote.el
@@ -2812,10 +2812,10 @@ is ignored if nil.
 Only ever `let' bind this, otherwise the title will always be the same
 and the title prompt will be skipped.")
 
-(defvar denote-use-keywords nil
+(defvar denote-use-keywords 'default
   "The keywords to be used in a note creation command.
 See the documentation of `denote' for acceptable values.  This variable
-is ignored if nil.
+is ignored if `default'.
 
 Only ever `let' bind this, otherwise the keywords will always be the same
 and the keywords prompt will be skipped.")
@@ -2881,7 +2881,7 @@ instead."
                                  (buffer-substring-no-properties
                                   (region-beginning)
                                   (region-end)))))))
-        ('keywords (unless denote-use-keywords
+        ('keywords (when (eq denote-use-keywords 'default)
                      (setq keywords (denote-keywords-prompt))))
         ('file-type (unless denote-use-file-type
                       (setq file-type (denote-file-type-prompt))))
@@ -2905,7 +2905,7 @@ If a `denote-use-*' variable is set for a data, its value 
is used
 instead of that of the parameter."
   (let* (;; Handle the `denote-use-*' variables
          (title (or denote-use-title title))
-         (keywords (or denote-use-keywords keywords))
+         (keywords (if (eq denote-use-keywords 'default) keywords 
denote-use-keywords))
          (file-type (or denote-use-file-type file-type))
          (directory (or denote-use-directory directory))
          (date (or denote-use-date date))

Reply via email to