summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-08-09 23:56:57 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-08-09 23:56:57 +0200
commitc9ac8f6956446ad196f4d1f2b8ac0f58993379aa (patch)
tree4a04c8ebfbcd0a0811842ce518755bb763c95a7e
parent46f3f4c626d6dfe48c0101e3c994a929b542ba77 (diff)
downloadorg-mode-c9ac8f6956446ad196f4d1f2b8ac0f58993379aa.tar.gz
Fix false positives in TODO keywords
* lisp/org.el (org-entry-properties): Make sure case is meaningful when matching a TODO keyword. * testing/lisp/test-org.el (test-org/entry-properties): Add test. Reported-by: Samuel Wales <samologist@gmail.com> <http://permalink.gmane.org/gmane.emacs.orgmode/99756>
-rwxr-xr-xlisp/org.el5
-rw-r--r--testing/lisp/test-org.el5
2 files changed, 7 insertions, 3 deletions
diff --git a/lisp/org.el b/lisp/org.el
index b4ce10e..f2e1b99 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15699,8 +15699,9 @@ strings."
props))
(when specific (throw 'exit props)))
(when (or (not specific) (string= specific "TODO"))
- (when (and (looking-at org-todo-line-regexp) (match-end 2))
- (push (cons "TODO" (org-match-string-no-properties 2)) props))
+ (let ((case-fold-search nil))
+ (when (and (looking-at org-todo-line-regexp) (match-end 2))
+ (push (cons "TODO" (org-match-string-no-properties 2)) props)))
(when specific (throw 'exit props)))
(when (or (not specific) (string= specific "PRIORITY"))
(when (looking-at org-priority-regexp)
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index f558eaf..3a156b8 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -3320,7 +3320,7 @@ Paragraph<point>"
(equal "* H"
(org-test-with-temp-text "* TODO H"
(cdr (assoc "ITEM" (org-entry-properties))))))
- ;; Get "TODO" property.
+ ;; Get "TODO" property. TODO keywords are case sensitive.
(should
(equal "TODO"
(org-test-with-temp-text "* TODO H"
@@ -3332,6 +3332,9 @@ Paragraph<point>"
(should-not
(org-test-with-temp-text "* H"
(assoc "TODO" (org-entry-properties nil "TODO"))))
+ (should-not
+ (org-test-with-temp-text "* todo H"
+ (assoc "TODO" (org-entry-properties nil "TODO"))))
;; Get "PRIORITY" property.
(should
(equal "A"