summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2010-08-20 09:26:08 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2010-08-20 09:26:08 +0200
commit19b0e03f32c6032a60150fc6cb07c6f766cb3f6c (patch)
treee1a83a6a8d39fdcbadb65836168b690434403c6e
parent294d3985441736565ad0e295f28282e5bf4f330e (diff)
downloadorg-mode-19b0e03f32c6032a60150fc6cb07c6f766cb3f6c.tar.gz
Make backslash escape "-" in property matches
* lisp/org.el (org-make-tags-matcher): Read "\\-" as "-" in the tags/property matcher. Ilya Shlyakhter writes: > When doing an agenda tags match for tags or properties with dashes in > their name, the dashes become negation operators: "my-prop>0" means > "entries that have the tag 'my' and do not have a positive property > 'prop'", rather than "entries that have a positive property > 'my-prop'". Is there a way to escape the dashes to get the latter > meaning?
-rw-r--r--lisp/org.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 744fca4..3102d62 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12432,7 +12432,7 @@ also TODO lines."
;; Parse the string and create a lisp form
(let ((match0 match)
- (re (org-re "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL\\([<=>]\\{1,2\\}\\)\\([0-9]+\\)\\|\\([[:alnum:]_]+\\)\\([<>=]\\{1,2\\}\\)\\({[^}]+}\\|\"[^\"]*\"\\|-?[.0-9]+\\(?:[eE][-+]?[0-9]+\\)?\\)\\|[[:alnum:]_@]+\\)"))
+ (re (org-re "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL\\([<=>]\\{1,2\\}\\)\\([0-9]+\\)\\|\\(\\(?:[[:alnum:]_]+\\(?:\\\\-\\)*\\)+\\)\\([<>=]\\{1,2\\}\\)\\({[^}]+}\\|\"[^\"]*\"\\|-?[.0-9]+\\(?:[eE][-+]?[0-9]+\\)?\\)\\|[[:alnum:]_@]+\\)"))
minus tag mm
tagsmatch todomatch tagsmatcher todomatcher kwd matcher
orterms term orlist re-p str-p level-p level-op time-p
@@ -12460,7 +12460,9 @@ also TODO lines."
(setq rest (substring term (match-end 0))
minus (and (match-end 1)
(equal (match-string 1 term) "-"))
- tag (match-string 2 term)
+ tag (save-match-data (replace-regexp-in-string
+ "\\\\-" "-"
+ (match-string 2 term)))
re-p (equal (string-to-char tag) ?{)
level-p (match-end 4)
prop-p (match-end 5)