Implement context filtering for agenda commands and capture templates.
commitd378c7b41b4cf8d50510d7d9121197993122c95c
authorBastien Guerry <bzg@altern.org>
Thu, 23 Aug 2012 09:08:47 +0000 (23 11:08 +0200)
committerBastien Guerry <bzg@altern.org>
Thu, 23 Aug 2012 09:08:47 +0000 (23 11:08 +0200)
tree78a851f43979f9ddfa61ae3d26dec4d855394e8a
parent6dedecf8062c753e6f575c5aca2922365c7d13cc
Implement context filtering for agenda commands and capture templates.

* org.el (org-contextualize-agenda-or-capture)
(org-rule-validate): New functions, implement context
filtering for agenda commands and capture templates.

* org-agenda.el (org-agenda-custom-commands-contexts): New
option.
(org-agenda): Use it.

* org-capture.el (org-capture-templates-contexts): New option.
(org-capture-select-template): Use it.

* org.texi (Templates in contexts): Document the new option
`org-capture-templates-contexts'.
(Storing searches): Document the new option
`org-agenda-custom-commands-contexts'.

This idea comes from Sylvain Rousseau, who implemented a similar
feature with org-context.el: https://github.com/thisirs/org-context

This implementation is a bit simpler and more general.  Simpler
because it relies on existing templates, no need to define other
contextual ones.  More general because contexts can be defined
wrt files and modes.

Thanks *very much* to Sylvain for paving the way -- certainly a
great addition to Org.
doc/org.texi
lisp/org-agenda.el
lisp/org-capture.el
lisp/org.el