summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2019-09-06 10:47:21 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2019-09-06 10:47:21 +0200
commit124017b6d3c35d8197d10d7b4521368c4c2b17e7 (patch)
tree92f22a4a857c526230dc35f2d20eafd0716d27eb
parent697358605a1c558c1b5b5a68948c8a8c3f9fbce0 (diff)
downloadorg-mode-124017b6d3c35d8197d10d7b4521368c4c2b17e7.tar.gz
Normalize the use of `C-u' in `org-agenda-filter-by-tag'
-rw-r--r--lisp/org-agenda.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index cac760b..0ba42d4 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7725,14 +7725,17 @@ which see."
(org-agenda-filter-show-all-effort))
(org-agenda-finalize))
-(defun org-agenda-filter-by-tag (arg &optional char exclude)
+(defun org-agenda-filter-by-tag (strip &optional char exclude)
"Keep only those lines in the agenda buffer that have a specific tag.
The tag is selected with its fast selection letter, as configured.
-With a `\\[universal-argument]' prefix, exclude the agenda search.
+With a `\\[universal-argument]' prefix, apply the filter negatively, stripping all matches.
-With a `\\[universal-argument] \\[universal-argument]' prefix, filter the literal tag, \
+With a `\\[universal-argument] \\[universal-argument]' prefix, add the new tag to the existing filter
+instead of replacing it.
+
+With a `\\[universal-argument] \\[universal-argument] \\[universal-argument]' prefix, filter the literal tag, \
i.e. don't
filter on all its group members.
@@ -7753,8 +7756,9 @@ also press `-' or `+' to switch between filtering and excluding."
org-tag-alist-for-agenda ""))
(valid-char-list (append '(?\t ?\r ?\\ ?. ?\s ?q)
(string-to-list tag-chars)))
- (exclude (or exclude (equal arg '(4))))
- (expand (not (equal arg '(16))))
+ (exclude (or exclude (equal strip '(4))))
+ (accumulate (equal strip '(16)))
+ (expand (not (equal strip '(64))))
(inhibit-read-only t)
(current org-agenda-tag-filter)
a n tag)
@@ -7805,7 +7809,7 @@ also press `-' or `+' to switch between filtering and excluding."
(setq tag (car a))
(setq org-agenda-tag-filter
(cons (concat (if exclude "-" "+") tag)
- current))
+ (if accumulate current nil)))
(org-agenda-filter-apply org-agenda-tag-filter 'tag expand))
(t (error "Invalid tag selection character %c" char)))))