branch: externals/denote-sequence
commit 7e3dd2162eddaecf153cb3f1e248369150b9a574
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Make denote-sequence--sequence-prefix-p only return sequences that match
denote-sequence-scheme
---
denote-sequence.el | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/denote-sequence.el b/denote-sequence.el
index 8bf6c2e606..05d0133e93 100644
--- a/denote-sequence.el
+++ b/denote-sequence.el
@@ -381,14 +381,15 @@ PREFIX is a list of strings containing the components of
the prefix
sequence, as is returned by `denote-sequence-split'.
If PREFIX is nil, return non-nil as if the SEQUENCE has PREFIX."
- (let ((value (denote-sequence-split sequence))
- (depth (length prefix))
- (matched 0))
- (while (and value
- (< matched depth)
- (string-equal (pop value) (nth matched prefix)))
- (setq matched (1+ matched)))
- (= matched depth)))
+ (when (denote-sequence-user-selected-scheme-p sequence)
+ (let ((value (denote-sequence-split sequence))
+ (depth (length prefix))
+ (matched 0))
+ (while (and value
+ (< matched depth)
+ (string-equal (pop value) (nth matched prefix)))
+ (setq matched (1+ matched)))
+ (= matched depth))))
(defun denote-sequence-get-all-files-with-prefix (sequence &optional files)
"Return all files in variable `denote-directory' with prefix SEQUENCE.