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

    Make denote-sequence-file-prompt err if there are no sequence notes
---
 denote-sequence.el | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/denote-sequence.el b/denote-sequence.el
index 388764cd64..13c577906a 100644
--- a/denote-sequence.el
+++ b/denote-sequence.el
@@ -193,15 +193,16 @@ Return selected type as a symbol."
 (defun denote-sequence-file-prompt ()
   "Prompt for file with sequence in variable `denote-directory'.
 A sequence is a Denote signature that conforms with `denote-sequence-p'."
-  (let* ((relative-files (mapcar 
#'denote-get-file-name-relative-to-denote-directory
-                                 (denote-sequence-get-all-files)))
-         (prompt "Select FILE with sequence: ")
-         (input (completing-read
-                 prompt
-                 (denote--completion-table 'file relative-files)
-                 nil :require-match
-                 nil 'denote-sequence-file-history)))
-    (concat (denote-directory) input)))
+  (if-let* ((relative-files (mapcar 
#'denote-get-file-name-relative-to-denote-directory
+                                      (denote-sequence-get-all-files)))
+              (prompt "Select FILE with sequence: ")
+              (input (completing-read
+                      prompt
+                      (denote--completion-table 'file relative-files)
+                      nil :require-match
+                      nil 'denote-sequence-file-history)))
+      (concat (denote-directory) input)
+    (error "There are no sequence notes in the `denote-directory'")))
 
 ;;;###autoload
 (defun denote-sequence (type &optional sequence)

Reply via email to