From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Hotlist agenda view: how to simplify its expression?
Date: Fri, 09 Aug 2013 16:56:20 +0200 [thread overview]
Message-ID: <867gfu3obv.fsf@somewhere.org> (raw)
Hello,
Suppose I want a convenient way to see my most important tasks, the ones
which:
- are due soon (in the next 7 days), or
- have a high priority (#A), or
- are FLAGGED.
If I don't mind having the entries mixed, this is quite simple and short:
#+begin_src emacs-lisp
(add-to-list 'org-agenda-custom-commands
'("H" "Hotlist"
tags-todo "DEADLINE<=\"<+1w>\"|PRIORITY=\"A\"|FLAGGED"
((org-agenda-todo-ignore-scheduled 'future))) t)
#+end_src
Though, if I want 3 different blocks (in the above order) with *no repetition*
of entries, I need to write such a monster expression:
#+begin_src emacs-lisp
(add-to-list 'org-agenda-custom-commands
'("I" "Hotlist"
((tags-todo "DEADLINE<=\"<+1w>\""
((org-agenda-overriding-header "Due in next 7 days")))
(tags-todo "PRIORITY=\"A\"+DEADLINE=\"\"|PRIORITY=\"A\"+DEADLINE>\"<+1w>\""
((org-agenda-overriding-header "High priority")))
(tags-todo "FLAGGED+PRIORITY=\"\"+DEADLINE=\"\"|FLAGGED+PRIORITY=\"\"+DEADLINE>\"<+1w>\"|FLAGGED+PRIORITY<>\"A\"+DEADLINE=\"\"|FLAGGED+PRIORITY<>\"A\"+DEADLINE>\"<+1w>\""
((org-agenda-overriding-header "Starred"))))
((org-agenda-todo-ignore-scheduled 'future))) t)
#+end_src
Do you see a way to optimize it (make it shorter)? On the problems relies in
the fact that the inverse of
DEADLINE<="<+1w>"
is
DEADLINE=""|DEADLINE>"<+1w>"
that is 2 tests to be done.
The same applies for the priorities: the inverse of
PRIORITY=\"A\"
is
PRIORITY=""|PRIORITY<>"A"
Hence, an exponential number of checks every time you want to remove
duplicated entries (which would have been displayed in the previous block):
you double the number of subexpressions in the next block...
Any better idea?
Best regards,
Seb
--
Sebastien Vauban
next reply other threads:[~2013-08-09 14:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-09 14:56 Sebastien Vauban [this message]
2013-08-09 15:54 ` Hotlist agenda view: how to simplify its expression? Jonathan Leech-Pepin
2013-08-12 11:58 ` Sebastien Vauban
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=867gfu3obv.fsf@somewhere.org \
--to=sva-news-d0wtavr13harg/idocfnwg@public.gmane.org \
--cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.