branch: externals/denote
commit f8e5649cb37224782d2f8b5fc679af1dea2f4ee4
Author: Jean-Philippe Gagné Guay <[email protected]>
Commit: Jean-Philippe Gagné Guay <[email protected]>

    Issue error in denote--valid-file-type if denote-file-types is nil
---
 denote.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/denote.el b/denote.el
index 50c970a4e5..01292b525f 100644
--- a/denote.el
+++ b/denote.el
@@ -1936,9 +1936,12 @@ returned."
                ((stringp filetype) (intern filetype))
                ((symbolp filetype) filetype)
                (t (error "The `%s' is neither a string nor a symbol" 
filetype)))))
-    (if (memq type (denote--file-type-keys))
-        type
-      (caar denote-file-types))))
+    (cond ((memq type (denote--file-type-keys))
+           type)
+          ((null denote-file-types)
+           (user-error "At least one file type must be defined in 
`denote-file-types' to create a note"))
+          (t
+           (caar denote-file-types)))))
 
 (defun denote--date-add-current-time (date)
   "Add current time to DATE, if necessary.

Reply via email to