Allow <> as operator for property regexp matches.

When <> is used as the operator, the comparison test it true if the
regexp does *not* match the value of the property.
This commit is contained in:
Carsten Dominik 2008-04-24 08:47:41 +02:00
parent dd8c0eb4c5
commit 6d72968730
3 changed files with 15 additions and 13 deletions

View File

@ -27,8 +27,8 @@
There are new values for the =:scope= parameter of a clock There are new values for the =:scope= parameter of a clock
table. This can now be =file-with-archives= and table. This can now be =file-with-archives= and
=agenda-with-archives=, in order to collect information not =agenda-with-archives=, in order to collect information not
only from the file org agenda files, but also all archive only from the current file or all agenda files, but also from
files that are currently used by these files. all archive files that are currently used by these files.
*** New operators for property searches *** New operators for property searches
@ -44,12 +44,11 @@
the operator, a string comparison is done: =+PRIORITY<"C".= the operator, a string comparison is done: =+PRIORITY<"C".=
Finally, if the right hand side is enclosed in curly braces, Finally, if the right hand side is enclosed in curly braces,
a regexp match is done: =aaa={regexp}=. You should use only a regexp match is done: =aaa={regexp}=. In this case you
the `=' operator in this case. should use only the `=' or `<>' operators, meaning "does
match" or "does not match", respectively.
This was a simple change and should have been implemented a This was a triggered with a request by Dan Davison.
long time ago - now it was finally triggered by a request
from Dan Davison.
*** Orgtbl radio tables generalized. *** Orgtbl radio tables generalized.

View File

@ -3668,11 +3668,12 @@ and the allowed operators are @samp{<}, @samp{=}, @samp{>}, @samp{<=},
@samp{>=}, and @samp{<>}. If the comparison value is enclosed in double @samp{>=}, and @samp{<>}. If the comparison value is enclosed in double
quotes, a string comparison is done, and the same operators are allowed. If quotes, a string comparison is done, and the same operators are allowed. If
the comparison value is enclosed in curly braces, a regexp match is the comparison value is enclosed in curly braces, a regexp match is
performed. So the search string in the example finds entries tagged performed, with @samp{=} meaning that the regexp matches the property value,
@samp{:work:} but not @samp{:boss:}, which also have a priority value and @samp{<>} meaning that it does not match. So the search string in the
@samp{A}, a @samp{:Coffee:} property with the value @samp{unlimited}, an example finds entries tagged @samp{:work:} but not @samp{:boss:}, which also
@samp{Effort} property that is numerically smaller than 2, and a have a priority value @samp{A}, a @samp{:Coffee:} property with the value
@samp{:With:} property that is matched by the regular expression @samp{unlimited}, an @samp{Effort} property that is numerically smaller than
2, and a @samp{:With:} property that is matched by the regular expression
@samp{Sarah\|Denny}. @samp{Sarah\|Denny}.
You can configure Org mode to use property inheritance during a search, but You can configure Org mode to use property inheritance during a search, but

View File

@ -8814,7 +8814,9 @@ also TODO lines."
(setq gv '(get-text-property (point) 'org-category)) (setq gv '(get-text-property (point) 'org-category))
(setq gv `(org-cached-entry-get nil ,pn))) (setq gv `(org-cached-entry-get nil ,pn)))
(if re-p (if re-p
`(string-match ,pv (or ,gv "")) (if (eq po 'org<>)
`(not (string-match ,pv (or ,gv "")))
`(string-match ,pv (or ,gv "")))
(if str-p (if str-p
`(,po (or ,gv "") ,pv) `(,po (or ,gv "") ,pv)
`(,po (string-to-number (or ,gv "")) `(,po (string-to-number (or ,gv ""))