Tags/properties matcher: Fixed issues with todo-only matches

lisp/org.el (org-scan-tags): Require todo-only argument, and document
that it should be the same one set by make-org-tags-matcher.
Fix documentation to explain that todo-only is really
not-done-todo-only.

(org-make-tags-matcher): If todo part of matcher starts with /!,
matcher now always checks that the TODO keyword is present and
is a not-done state.  This matters e.g. for org-map-entries
which unlike org-scan-tags does not do its own separate todo-only
filtering.  Added docs to explain matcher dependencies.

(org-map-entries): Make sure todo-only is correctly passed from
org-make-tags-matcher to org-scan-tags.

* lisp/org-clock.el: (org-clock-get-table-data): Make sure todo-only
does not leak when it is set by make-org-tags-macher.

* lisp/org-crypt.el: (org-encrypt-entries, org-decrypt-entries): Make
sure todo-only is correctly passed from org-make-tags-matcher to
org-scan-tags.

* contrib/lisp/contacts.el: (org-contacts-filter) : Make sure todo-only
is correctly passed from org-make-tags-matcher to org-scan-tags.
This commit is contained in:
Ilya Shlyakhter 2012-03-21 19:49:07 -04:00 committed by Bastien Guerry
parent c297cb009f
commit dcd313e66d

View file

@ -143,7 +143,8 @@ This overrides `org-email-link-description-format' if set."
(defun org-contacts-filter (&optional name-match tags-match) (defun org-contacts-filter (&optional name-match tags-match)
"Search for a contact maching NAME-MATCH and TAGS-MATCH. "Search for a contact maching NAME-MATCH and TAGS-MATCH.
If both match values are nil, return all contacts." If both match values are nil, return all contacts."
(let ((tags-matcher (let* (todo-only
(tags-matcher
(if tags-match (if tags-match
(cdr (org-make-tags-matcher tags-match)) (cdr (org-make-tags-matcher tags-match))
t)) t))
@ -161,7 +162,8 @@ If both match values are nil, return all contacts."
(error "File %s is no in `org-mode'" file)) (error "File %s is no in `org-mode'" file))
(org-scan-tags (org-scan-tags
'(add-to-list 'markers (set-marker (make-marker) (point))) '(add-to-list 'markers (set-marker (make-marker) (point)))
`(and ,contacts-matcher ,tags-matcher ,name-matcher)))) `(and ,contacts-matcher ,tags-matcher ,name-matcher)
todo-only)))
(dolist (marker markers result) (dolist (marker markers result)
(org-with-point-at marker (org-with-point-at marker
(add-to-list 'result (add-to-list 'result