summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien <bzg@gnu.org>2017-12-29 18:18:14 +0100
committerBastien <bzg@gnu.org>2017-12-29 18:18:14 +0100
commit8983ac917b1ca1b46697a5d27655e4ef71fa6537 (patch)
treedc8005522bc869a4f27c85393c37d36b1fb07f35
parent144451143a2ed727b775c4f78999bcdcdb0b82dc (diff)
downloadorg-mode-8983ac917b1ca1b46697a5d27655e4ef71fa6537.tar.gz
org-colview: Allow to filter by tags/property when capturing colview
* org-colview.el (org-columns--capture-view): New argument "match" to filter out unmatched entries. (org-dblock-write:columnview): Use the new argument. Thanks to Thierry Stoehr for proposing this.
-rw-r--r--lisp/org-colview.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 5fcd4cb..9189976 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -1325,7 +1325,7 @@ and variances (respectively) of the individual estimates."
;;; Dynamic block for Column view
-(defun org-columns--capture-view (maxlevel skip-empty format local)
+(defun org-columns--capture-view (maxlevel match skip-empty format local)
"Get the column view of the current buffer.
MAXLEVEL sets the level limit. SKIP-EMPTY tells whether to skip
@@ -1360,7 +1360,8 @@ other rows. Each row is a list of fields, as strings, or
(or (null r) (and has-item (= (length r) 1)))))
(push (cons (org-reduced-level (org-current-level)) (nreverse row))
table)))))
- (and maxlevel (format "LEVEL<=%d" maxlevel))
+ (or (and maxlevel (format "LEVEL<=%d" maxlevel))
+ (and match match))
(and local 'tree)
'archive 'comment)
(org-columns-quit)
@@ -1398,6 +1399,7 @@ PARAMS is a property list of parameters:
:indent When non-nil, indent each ITEM field according to its level.
:vlines When t, make each column a colgroup to enforce vertical lines.
:maxlevel When set to a number, don't capture headlines below this level.
+:match When set to a string, use this as a tags/property match filter.
:skip-empty-rows
When t, skip rows where all specifiers other than ITEM are empty.
:format When non-nil, specify the column view format to use."
@@ -1423,6 +1425,7 @@ PARAMS is a property list of parameters:
(org-with-wide-buffer
(when view-pos (goto-char view-pos))
(org-columns--capture-view (plist-get params :maxlevel)
+ (plist-get params :match)
(plist-get params :skip-empty-rows)
(plist-get params :format)
view-pos))))))