* new tag query parser [4/5] -- a few ``illuminating'' examples
@ 2012-08-16 4:02 Christopher Genovese
0 siblings, 0 replies; only message in thread
From: Christopher Genovese @ 2012-08-16 4:02 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2331 bytes --]
#+TITLE: New Tag Query Parser: A Few Illuminating Examples
This post is structured as an org file with the example commands listed
within.
Copy this to a buffer and try the commands below on that buffer.
* Preliminaries Point 207
The Point # labels on the headings give the point values for the
beginning of the heading. To make this accurate, we need to
standardize tag placemnet. Using M-: or equivalent means,
execute the following in this buffer:
#+begin_src emacs-lisp
(set (make-local-variable 'org-tags-column) -80)
(set (make-local-variable 'org-todo-keywords)
'((sequence "TODO" "WAIT" "DONE")))
#+end_src
If necessary, do C-u C-c on a headline to realign the tags.
* Parenthesized Expressions Point 714
:feature:
Fully parenthesized expressions are allowed in the tag query strings.
A - selector before the parenthesized expression acts as a logical
not. These expressions can include an old-style /!? todo-query string
as well, which extends to the closing paren.
** TODO Paren Examples Point 1057
:example:paren:
+ (org-map-entries 'point "(example&HEADING={^Paren}/TODO)")
+ (org-map-entries 'point "HEADING={Paren} & -(extra | LEVEL = 1)")
+ (org-map-entries 'point "(feature | LEVEL == 2)({^p}/WAIT|TODO)")
The first two should give 1057, the third (1057 1492).
* Another Point 1411
:extra:
** WAIT This is not a feature example Point 1492
:pretend:
** We can manipulate and combine whole expressions Point 1573
+ (org-map-entries 'point "-(feature&LEVEL=2)")
+ (org-map-entries 'point "-(feature|LEVEL==2)|{^$}")
Note that inheritance can affects the tag matches; it might
be nice to be able to distinguish this in searches.
Note also that the original matcher fails silently here.
* Braces and Spaces AAA Point 1921
:feature:
** DONE Just a marker AAAAAA Point 2002
** TODO Simple Examples AAAA Point 2042
:example:syntax:
+ (org-map-entries 'point "example & TODO <> \"DONE\")
+ (org-map-entries 'point "example/!")
+ (org-map-entries 'point "example | HEADING = { A\\{{3,4\\}}[^A]}")
+ Allows = or == for equality operator.
** [#A] Ok Point 2338
** [#B] This is fast Point 2360
+ (org-map-entries 'point "PRIORITY=\"B\"")
Many more examples are available in the test suite. Do C-u M-x
run-tag-query-tests
to see them.
[-- Attachment #2: Type: text/html, Size: 8123 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-08-16 4:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-16 4:02 new tag query parser [4/5] -- a few ``illuminating'' examples Christopher Genovese
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).