summaryrefslogtreecommitdiff
path: root/org-fc.el
diff options
context:
space:
mode:
authorLeon Rische <leon.rische@me.com>2020-05-24 15:09:22 +0200
committerLeon Rische <leon.rische@me.com>2020-05-24 15:09:22 +0200
commit6087429fdfbec27d79057ac274c862d9d81202d6 (patch)
treebfd41a2771572b8a4600f4cfbde3dc845c8bd300 /org-fc.el
parent40e1ec4a9e3d015de96e013afbb6071348616d8d (diff)
Immediately flatten index returned by awk
Diffstat (limited to 'org-fc.el')
-rw-r--r--org-fc.el43
1 files changed, 22 insertions, 21 deletions
diff --git a/org-fc.el b/org-fc.el
index a1d3503..4e49196 100644
--- a/org-fc.el
+++ b/org-fc.el
@@ -1254,26 +1254,27 @@ ITAGS and LTAGS are strings `\":tag1:tag2:\"'"
(defun org-fc-awk-index-paths (paths)
"Generate a list of all cards and positions in PATHS."
- (mapcar
- (lambda (file)
- (plist-put file :cards
- (mapcar
- (lambda (card)
- (plist-put
- card :tags
- (org-fc--combine-tags
- (plist-get card :inherited-tags)
- (plist-get card :local-tags))))
- (plist-get file :cards))))
- (read
- (shell-command-to-string
- (org-fc-awk--pipe
- (org-fc-awk--find paths)
- (org-fc-awk--xargs
- (org-fc-awk--command
- "awk/index.awk"
- :utils t
- :variables (org-fc-awk--indexer-variables))))))))
+ (org-fc-flatten-index
+ (mapcar
+ (lambda (file)
+ (plist-put file :cards
+ (mapcar
+ (lambda (card)
+ (plist-put
+ card :tags
+ (org-fc--combine-tags
+ (plist-get card :inherited-tags)
+ (plist-get card :local-tags))))
+ (plist-get file :cards))))
+ (read
+ (shell-command-to-string
+ (org-fc-awk--pipe
+ (org-fc-awk--find paths)
+ (org-fc-awk--xargs
+ (org-fc-awk--command
+ "awk/index.awk"
+ :utils t
+ :variables (org-fc-awk--indexer-variables)))))))))
(defun org-fc-awk-stats-reviews ()
"Statistics for all card reviews.
@@ -1344,7 +1345,7 @@ use `(and (type double) (tag \"math\"))'."
((or (null paths) (eq paths 'all)) (setq paths org-fc-directories))
((eq paths 'buffer) (setq paths (list (buffer-file-name))))
((stringp paths) (setq paths (list paths))))
- (org-fc-filter-index (org-fc-flatten-index (org-fc-awk-index-paths paths)) filter)))
+ (org-fc-filter-index (org-fc-awk-index-paths paths) filter)))
(defun org-fc-index-positions (index &optional filter-due)
"Generate a list of non-suspended positions in INDEX.