summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Rische <leon.rische@me.com>2020-07-03 14:57:01 +0200
committerLeon Rische <leon.rische@me.com>2020-07-03 14:57:01 +0200
commitaf7b174f4ba5211c3307b9797d9eb64d06707f01 (patch)
tree46c5dee9748c7432aec9501c4c3df29d0e17daa7
parent23312e4eb456df67eea5954d5aa206fad300d59d (diff)
Add a scope argument to `org-fc-map-cards`
-rw-r--r--org-fc.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/org-fc.el b/org-fc.el
index a9797a6..0f18ed9 100644
--- a/org-fc.el
+++ b/org-fc.el
@@ -1142,11 +1142,17 @@ Only parent headings of the current heading remain visible."
;;; Updating Cards
-(defun org-fc-map-cards (fn)
- "Call FN for each flashcard headline in the current buffer.
-FN is called with point at the headline and no arguments."
+(defun org-fc-map-cards (fn &optional scope)
+ "Call FN for each flashcard headline in SCOPE.
+FN is called with point at the headline and no arguments.
+If SCOPE is nil, it defaults to the full buffer.
+Other useful values are:
+- tree
+- region"
(org-map-entries
- (lambda () (if (org-fc-entry-p) (funcall fn)))))
+ (lambda () (if (org-fc-entry-p) (funcall fn)))
+ nil
+ scope))
;;;###autoload
(defun org-fc-update ()