mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 18:36:26 +00:00
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>
This commit is contained in:
parent
46f3f4c626
commit
c9ac8f6956
|
@ -15699,8 +15699,9 @@ strings."
|
||||||
props))
|
props))
|
||||||
(when specific (throw 'exit props)))
|
(when specific (throw 'exit props)))
|
||||||
(when (or (not specific) (string= specific "TODO"))
|
(when (or (not specific) (string= specific "TODO"))
|
||||||
|
(let ((case-fold-search nil))
|
||||||
(when (and (looking-at org-todo-line-regexp) (match-end 2))
|
(when (and (looking-at org-todo-line-regexp) (match-end 2))
|
||||||
(push (cons "TODO" (org-match-string-no-properties 2)) props))
|
(push (cons "TODO" (org-match-string-no-properties 2)) props)))
|
||||||
(when specific (throw 'exit props)))
|
(when specific (throw 'exit props)))
|
||||||
(when (or (not specific) (string= specific "PRIORITY"))
|
(when (or (not specific) (string= specific "PRIORITY"))
|
||||||
(when (looking-at org-priority-regexp)
|
(when (looking-at org-priority-regexp)
|
||||||
|
|
|
@ -3320,7 +3320,7 @@ Paragraph<point>"
|
||||||
(equal "* H"
|
(equal "* H"
|
||||||
(org-test-with-temp-text "* TODO H"
|
(org-test-with-temp-text "* TODO H"
|
||||||
(cdr (assoc "ITEM" (org-entry-properties))))))
|
(cdr (assoc "ITEM" (org-entry-properties))))))
|
||||||
;; Get "TODO" property.
|
;; Get "TODO" property. TODO keywords are case sensitive.
|
||||||
(should
|
(should
|
||||||
(equal "TODO"
|
(equal "TODO"
|
||||||
(org-test-with-temp-text "* TODO H"
|
(org-test-with-temp-text "* TODO H"
|
||||||
|
@ -3332,6 +3332,9 @@ Paragraph<point>"
|
||||||
(should-not
|
(should-not
|
||||||
(org-test-with-temp-text "* H"
|
(org-test-with-temp-text "* H"
|
||||||
(assoc "TODO" (org-entry-properties nil "TODO"))))
|
(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.
|
;; Get "PRIORITY" property.
|
||||||
(should
|
(should
|
||||||
(equal "A"
|
(equal "A"
|
||||||
|
|
Loading…
Reference in a new issue