Browse Source

Match TODO keywords case-sensitively

Samuel Wales writes:

> I found three places where the lowercase version of a todo
> kw is treated specially in the latest org.  For example,
>
>  * todo this is lowercase
>
> First, in the agenda, they have a special face.
>
> Second, when inserting an id link, they are removed.
>
> Third, when printing the olpath, they are removed.  To
> reproduce, place point at bol on 5 and press the spacebar.
> I expect todo to be in the olpath, but it is not.
>
> Thanks.
>
>
> Samuel
>
>
> * 1
> *** 2
> ***** here are some keywords i like
> ******* todo
> ********* 5
Carsten Dominik 15 years ago
parent
commit
7062a88410
4 changed files with 16 additions and 4 deletions
  1. 9 0
      lisp/ChangeLog
  2. 1 0
      lisp/org-agenda.el
  3. 1 0
      lisp/org-id.el
  4. 5 4
      lisp/org.el

+ 9 - 0
lisp/ChangeLog

@@ -1,5 +1,14 @@
 2009-12-16  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-agenda.el (org-agenda-highlight-todo): Match TODO keywords
+	case sensitively.
+
+	* org-id.el (org-id-store-link): Match TODO keywords case
+	sensitively.
+
+	* org.el (org-heading-components, org-get-outline-path)
+	(org-display-outline-path): Match TODO keywords case sensitively.
+
 	* org-latex.el (org-export-as-latex): Ignore read-only
 	properties.
 

+ 1 - 0
lisp/org-agenda.el

@@ -4832,6 +4832,7 @@ HH:MM."
 
 (defun org-agenda-highlight-todo (x)
   (let ((org-done-keywords org-done-keywords-for-agenda)
+	(case-fold-search nil)
 	 re pl)
     (if (eq x 'line)
 	(save-excursion

+ 1 - 0
lisp/org-id.el

@@ -576,6 +576,7 @@ optional argument MARKERP, return the position as a new marker."
   "Store a link to the current entry, using its ID."
   (interactive)
   (let* ((link (org-make-link "id:" (org-id-get-create)))
+	 (case-fold-search nil)
 	 (desc (save-excursion
 		 (org-back-to-heading t)
 		 (or (and (looking-at org-complex-heading-regexp)

+ 5 - 4
lisp/org.el

@@ -6180,7 +6180,7 @@ This is a list with the following elements:
 - the tags string, or nil."
   (save-excursion
     (org-back-to-heading t)
-    (if (looking-at org-complex-heading-regexp)
+    (if (let (case-fold-search) (looking-at org-complex-heading-regexp))
 	(list (length (match-string 1))
 	      (org-reduced-level (length (match-string 1)))
 	      (org-match-string-no-properties 2)
@@ -9157,7 +9157,7 @@ avoiding backtracing."
 	(prog1
 	    (delq nil (append org-olpa nil))
 	  (aset org-olpa level heading)))
-    (let (rtn)
+    (let (rtn case-fold-search)
       (save-excursion
 	(save-restriction
 	  (widen)
@@ -9207,8 +9207,9 @@ such as the file name."
 (defun org-display-outline-path (&optional file current)
   "Display the current outline path in the echo area."
   (interactive "P")
-  (let ((bfn (buffer-file-name (buffer-base-buffer)))
-	(path (and (org-mode-p) (org-get-outline-path))))
+  (let* ((bfn (buffer-file-name (buffer-base-buffer)))
+	 (case-fold-search nil)
+	 (path (and (org-mode-p) (org-get-outline-path))))
     (if current (setq path (append path
 				   (save-excursion
 				     (org-back-to-heading t)