From dcd313e66d2e2291485ca9eab8b719f36391fd9b Mon Sep 17 00:00:00 2001 From: Ilya Shlyakhter Date: Wed, 21 Mar 2012 19:49:07 -0400 Subject: [PATCH] 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. --- org-contacts.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/org-contacts.el b/org-contacts.el index bdd9996..b6d9e50 100644 --- a/org-contacts.el +++ b/org-contacts.el @@ -143,7 +143,8 @@ This overrides `org-email-link-description-format' if set." (defun org-contacts-filter (&optional name-match tags-match) "Search for a contact maching NAME-MATCH and TAGS-MATCH. If both match values are nil, return all contacts." - (let ((tags-matcher + (let* (todo-only + (tags-matcher (if tags-match (cdr (org-make-tags-matcher tags-match)) t)) @@ -161,7 +162,8 @@ If both match values are nil, return all contacts." (error "File %s is no in `org-mode'" file)) (org-scan-tags '(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) (org-with-point-at marker (add-to-list 'result