summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Rische <leon.rische@me.com>2020-07-12 15:32:29 +0200
committerLeon Rische <leon.rische@me.com>2020-07-12 15:32:29 +0200
commitbb5536ee54366ca9d56fdf6e65091c23902a9030 (patch)
treec27aa75c14df2e95265db820b732aed95643d817
parentd810eb1149af2390daf994a795a299958bf288eb (diff)
Add `org-fc-member-p` function
-rw-r--r--org-fc.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/org-fc.el b/org-fc.el
index 4dddaf8..c688e4a 100644
--- a/org-fc.el
+++ b/org-fc.el
@@ -270,6 +270,14 @@ Used to calculate the time needed for reviewing a card.")
;;; Helper Functions
+(defun org-fc-member-p (path)
+ "Check if PATH is member of one of the `org-fc-directories'."
+ (setq path (expand-file-name path))
+ (and (string= (file-name-extension file) "org")
+ (cl-some
+ (lambda (dir) (string-prefix-p (expand-file-name dir) path))
+ org-fc-directories)))
+
(defun org-fc-noop ()
"Noop-function.")