forked from mirrors/org-mode
Modified the new agenda tag filtering command.
This commit is contained in:
parent
5b740fb681
commit
ba2e31dad0
|
@ -38,17 +38,22 @@
|
|||
agenda view with respect to a tag. This command is executed
|
||||
with the =/= key in the agenda. You will be prompted for a
|
||||
tag selection key, and all entries that do not contain or
|
||||
inherit the corresponding tag will be removed from the agenda
|
||||
view. With a prefix argument, the complementary filter is
|
||||
applied: entries that do have the tag will be removed.
|
||||
Narrowing the search results down with several successive
|
||||
filtering operations is possible.
|
||||
inherit the corresponding tag will be hidden. With a prefix
|
||||
argument, the complementary filter is applied: entries that
|
||||
do have the tag will be hidden.
|
||||
|
||||
Note that this only removes the entries from the agenda
|
||||
buffer, but it does not modify the query. Therefore, the =r=
|
||||
and =g= keys will restore the original agenda buffer.
|
||||
This operation only hides lines in the agenda buffer. It
|
||||
does not initiate a new search and therefore is very fast.
|
||||
|
||||
This functionality was John Wiegleys idea and is a simpler
|
||||
If you press TAB at the tag selection prompt, you will be
|
||||
switched to a completion interface to select a tag. This is
|
||||
useful in particular when you want to select a tag that does
|
||||
not have a direct access character.
|
||||
|
||||
A double =/ /= will restore the original agenda view by
|
||||
unhiding any hidden lines.
|
||||
|
||||
This functionality was John Wiegley's idea. It is a simpler
|
||||
implementation of some of the query-editing features proposed
|
||||
and implemented some time ago by Christopher League (see the
|
||||
file contrib/lisp/org-interactive-query.el).
|
||||
|
|
|
@ -102,7 +102,7 @@ Some more information about this can be found in the [[http://orgmode.org/worg/o
|
|||
** Reference card
|
||||
- Download the [[file:orgcard.pdf][Refcard]] for org-mode
|
||||
- Kyle Sherman has created a [[file:orgcard.txt][text version]] of the reference card
|
||||
(Org version 6.06).
|
||||
(Org version 6.07).
|
||||
** The FAQ
|
||||
- The [[http://orgmode.org/worg/org-faq.php][Org Mode FAQ]] is user-editable and is maintained by the [[http://orgmode.org/worg/][Worg
|
||||
project]].
|
||||
|
|
|
@ -5806,9 +5806,12 @@ that entry would be in the original buffer (taken from a property, from a
|
|||
@kindex /
|
||||
@item /
|
||||
Filter the current agenda view with respect to a tag. You will be prompted
|
||||
for a tag selection letter and all entries that do not contain this tag will
|
||||
be removed from the agenda display. When called with prefix arg, remove the
|
||||
entries that @emph{do} have the tag.
|
||||
for a tag selection letter. Pressing @key{TAB} at that prompt will offer use
|
||||
completion to select a tag (including any tags that do not have a selection
|
||||
character). The command then hides all entries that do not contain or
|
||||
inherit this tag. When called with prefix arg, remove the entries that
|
||||
@emph{do} have the tag. A second @kbd{/} at the prompt will unhide any
|
||||
hidden entries.
|
||||
|
||||
@kindex [
|
||||
@kindex ]
|
||||
|
|
|
@ -612,7 +612,7 @@ after ``{\tt :}'', and dictionary words elsewhere.
|
|||
\key{find stuck projects}{C-c a \#$^1$}
|
||||
\key{show timeline of current org file}{C-c a L$^1$}
|
||||
\key{configure custom commands}{C-c a C$^1$}
|
||||
\key{configure stuck projects}{C-c a !$^1$}
|
||||
%\key{configure stuck projects}{C-c a !$^1$}
|
||||
\key{agenda for date at cursor}{C-c C-o}
|
||||
|
||||
{\bf Commands available in an agenda buffer}
|
||||
|
@ -637,6 +637,7 @@ after ``{\tt :}'', and dictionary words elsewhere.
|
|||
\key{toggle display of logbook entries}{l}
|
||||
\key{toggle inclusion of archived trees/files}{v / C-u v}
|
||||
\key{refresh agenda buffer with any changes}{r / g}
|
||||
\key{filter with repect to a tag}{/}
|
||||
\key{save all org-mode buffers}{s}
|
||||
\key{display next/previous day,week,...}{RIGHT/LEFT}
|
||||
\key{goto today}{.}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
================================================================================
|
||||
Org-Mode Reference Card (for version 6.06)
|
||||
Org-Mode Reference Card (for version 6.07)
|
||||
================================================================================
|
||||
|
||||
================================================================================
|
||||
|
@ -358,6 +358,7 @@ toggle time grid for daily schedule G
|
|||
toggle display of logbook entries l
|
||||
toggle inclusion of archived trees/files v / C-u v}
|
||||
refresh agenda buffer with any changes r / g
|
||||
filter agenda with repect to a tag /
|
||||
save all org-mode buffers s
|
||||
display the next/previous day, week,... RIGHT/LEFT
|
||||
goto today .
|
||||
|
|
|
@ -4085,25 +4085,49 @@ The tag is selected with its fast selection letter, as configured.
|
|||
With prefix argument STRIP, remove all lines that do have the tag."
|
||||
(interactive "P")
|
||||
(let (char a tag (inhibit-read-only t))
|
||||
(message "Tag selection character [%s]"
|
||||
(mapconcat
|
||||
(lambda (x) (if (cdr x) (char-to-string (cdr x)) ""))
|
||||
org-tag-alist-for-agenda ""))
|
||||
(setq char (read-char-exclusive))
|
||||
(unless (setq a (rassoc char org-tag-alist-for-agenda))
|
||||
(error "invalid tag selection character %c" char))
|
||||
(setq tag (car a))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (not (eobp))
|
||||
(if (get-text-property (point) 'org-marker)
|
||||
(progn
|
||||
(setq tags (get-text-property (point) 'tags))
|
||||
(if (or (and (member tag tags) strip)
|
||||
(and (not (member tag tags)) (not strip)))
|
||||
(delete-region (point) (1+ (point-at-eol)))
|
||||
(beginning-of-line 2)))
|
||||
(beginning-of-line 2))))))
|
||||
(message "Select tag [%s], [TAB] to complete, [/] to restore: "
|
||||
(mapconcat
|
||||
(lambda (x) (if (cdr x) (char-to-string (cdr x)) ""))
|
||||
org-tag-alist-for-agenda ""))
|
||||
(setq char (read-char))
|
||||
(when (equal char ?\t)
|
||||
(unless (local-variable-p 'org-global-tags-completion-table)
|
||||
(org-set-local 'org-global-tags-completion-table
|
||||
(org-global-tags-completion-table)))
|
||||
(let ((completion-ignore-case t))
|
||||
(setq tag (completing-read
|
||||
"Tag: " org-global-tags-completion-table))))
|
||||
(cond
|
||||
((equal char ?/) (org-agenda-filter-by-tag-show-all))
|
||||
((or (setq a (rassoc char org-tag-alist-for-agenda))
|
||||
(and tag (setq a (cons tag nil))))
|
||||
(org-agenda-filter-by-tag-show-all)
|
||||
(setq tag (car a))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (not (eobp))
|
||||
(if (get-text-property (point) 'org-marker)
|
||||
(progn
|
||||
(setq tags (get-text-property (point) 'tags))
|
||||
(if (or (and (member tag tags) strip)
|
||||
(and (not (member tag tags)) (not strip)))
|
||||
(org-agenda-filter-by-tag-hide-line))
|
||||
(beginning-of-line 2))
|
||||
(beginning-of-line 2)))))
|
||||
(t (error "Invalid tag selection character %c" char)))))
|
||||
|
||||
(defvar org-agenda-filter-overlays nil)
|
||||
|
||||
(defun org-agenda-filter-by-tag-hide-line ()
|
||||
(let (ov)
|
||||
(setq ov (org-make-overlay (point-at-bol) (1+ (point-at-eol))))
|
||||
(org-overlay-put ov 'invisible t)
|
||||
(org-overlay-put ov 'type 'tags-filter)
|
||||
(push ov org-agenda-filter-overlays)))
|
||||
|
||||
(defun org-agenda-filter-by-tag-show-all ()
|
||||
(mapc 'org-delete-overlay org-agenda-filter-overlays)
|
||||
(setq org-agenda-filter-overlays nil))
|
||||
|
||||
(defun org-agenda-manipulate-query-add ()
|
||||
"Manipulate the query by adding a search term with positive selection.
|
||||
|
|
Loading…
Reference in New Issue