Patch attached. Original problem was that org-map-entries for
MYPROP2/! was not limiting itself to TODO entries, even though
org-tags-view for the same matcher was.
lisp/org.el (org-scan-tags): Require todo-only argument, and document
that it should be the same one set by org-make-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.
From 3feb2edd3a705811824348546f4edad2f595f8bb Mon Sep 17 00:00:00 2001
From: Ilya Shlyakhter ilya_...@alum.mit.edu
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 org-make-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.
---
contrib/lisp/org-contacts.el |6 --
lisp/org-clock.el|1 +
lisp/org-crypt.el| 16 +--
lisp/org.el | 44 --
4 files changed, 49 insertions(+), 18 deletions(-)
diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index bdd9996..b6d9e50 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/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
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 46d9af8..5fca941 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2441,6 +2441,7 @@ TIME: The sum of all time spend in this tree, in
minutes. This time
(tags (plist-get params :tags))
(properties (plist-get params :properties))
(inherit-property-p (plist-get params :inherit-props))
+todo-only
(matcher (if tags (cdr (org-make-tags-matcher tags
cc range-text st p time level hdl props tsp tbl)
diff --git a/lisp/org-crypt.el b/lisp/org-crypt.el
index f60c61e..7e7ba30 100644
--- a/lisp/org-crypt.el
+++ b/lisp/org-crypt.el
@@ -237,16 +237,20 @@ See `org-crypt-disable-auto-save'.
(defun org-encrypt-entries ()
Encrypt all top-level entries in the current buffer.
(interactive)
- (org-scan-tags
- 'org-encrypt-entry
- (cdr (org-make-tags-matcher org-crypt-tag-matcher
+ (let (todo-only)
+(org-scan-tags
+ 'org-encrypt-entry
+ (cdr (org-make-tags-matcher org-crypt-tag-matcher))
+ todo-only)))
(defun org-decrypt-entries ()
Decrypt all entries in the current buffer.
(interactive)
- (org-scan-tags
- 'org-decrypt-entry
- (cdr