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

    Define denote-sequence-depth function
---
 denote-sequence.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/denote-sequence.el b/denote-sequence.el
index c2ac67eb0e..0a9632efff 100644
--- a/denote-sequence.el
+++ b/denote-sequence.el
@@ -67,6 +67,12 @@ SEQUENCE conforms with `denote-sequence-p'."
   (if (denote-sequence-p sequence)
       (split-string sequence "=" t)
     (error "The sequence `%s' does not pass `denote-sequence-p'" sequence)))
+
+(defun denote-sequence-depth (sequence)
+  "Get the depth of SEQUENCE.
+For example, 1=2=1 is three levels deep."
+  (length (denote-sequence-split sequence)))
+
 (defun denote-sequence-get-all-files ()
   "Return all files in variable `denote-directory' with a sequence.
 A sequence is a Denote signature that conforms with `denote-sequence-p'."

Reply via email to