Browse Source

TODO keywords: Should be case sensitive

Samuel Wales writes:

>  A lower case version of a todo kw at the beginning of a
>  headline, when in lower case, causes sort to ignore the
>  word.
>
>  Also, setting priority with shift down causes the cookie to
>  be inserted in the wrong place.

Both problems are address in this commit.
Carsten Dominik 16 years ago
parent
commit
6e9fb4550f
2 changed files with 9 additions and 1 deletions
  1. 6 0
      lisp/ChangeLog
  2. 3 1
      lisp/org.el

+ 6 - 0
lisp/ChangeLog

@@ -1,3 +1,9 @@
+2009-04-11  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-sort-entries-or-items): Match TODO keywrds
+	case-sensitively, when sorting.
+	(org-priority): Do not match TODO keywords with wrong case.
+
 2009-04-09  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-feed.el (org-feed-update): Bind the variable

+ 3 - 1
lisp/org.el

@@ -6097,6 +6097,7 @@ WITH-CASE, the sorting considers case as well."
       (narrow-to-region start end)
 
       (let ((dcst (downcase sorting-type))
+	    (case-fold-search nil)
             (now (current-time)))
         (sort-subr
          (/= dcst sorting-type)
@@ -9980,7 +9981,8 @@ ACTION can be `set', `up', `down', or a character."
 	    (replace-match news t t nil 2))
 	(if remove
 	    (error "No priority cookie found in line")
-	  (looking-at org-todo-line-regexp)
+	  (let ((case-fold-search nil))
+	    (looking-at org-todo-line-regexp))
 	  (if (match-end 2)
 	      (progn
 		(goto-char (match-end 2))