branch: externals/denote-sequence commit 93bcebc7ca3731e86808fb99d2c05e6901d938e4 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Make denote-sequence--get-start return "1" when there is no sequence and the scheme is alphanumeric Otherwise we cannot create the first parent when we are getting started. --- denote-sequence.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/denote-sequence.el b/denote-sequence.el index 4679fc6986..9f8ca68348 100644 --- a/denote-sequence.el +++ b/denote-sequence.el @@ -517,9 +517,11 @@ optional PREPEND-DELIMITER is non-nil, prepend the equals sign to the number if `denote-sequence-scheme' is numeric." (pcase denote-sequence-scheme ('numeric (if prepend-delimiter "=1" "1")) - ('alphanumeric (if (denote-sequence--alphanumeric-partial-p (substring sequence -1)) - "1" - "a")))) + ('alphanumeric + (cond + ((null sequence) "1") + ((and sequence (denote-sequence--alphanumeric-partial-p (substring sequence -1))) "1") + (t "a"))))) (defun denote-sequence--get-new-parent (&optional sequences) "Return a new to increment largest among sequences.