Browse Source

org.el: Allow lowercase "#+category" and "#+begin:" dynamic blocks

* org.el (org-refresh-category-properties)
(org-find-dblock, org-dblock-start-re, org-dblock-end-re):
Allow lowercase "#+category" and "#+begin:" dynamic blocks.
Bastien Guerry 13 years ago
parent
commit
f926d9019b
1 changed files with 7 additions and 6 deletions
  1. 7 6
      lisp/org.el

+ 7 - 6
lisp/org.el

@@ -8698,7 +8698,8 @@ call CMD."
 
 
 (defun org-refresh-category-properties ()
 (defun org-refresh-category-properties ()
   "Refresh category text properties in the buffer."
   "Refresh category text properties in the buffer."
-  (let ((inhibit-read-only t)
+  (let ((case-fold-search t)
+	(inhibit-read-only t)
 	(def-cat (cond
 	(def-cat (cond
 		  ((null org-category)
 		  ((null org-category)
 		   (if buffer-file-name
 		   (if buffer-file-name
@@ -11158,20 +11159,20 @@ this is used for the GOTO interface."
 (defun org-find-dblock (name)
 (defun org-find-dblock (name)
   "Find the first dynamic block with name NAME in the buffer.
   "Find the first dynamic block with name NAME in the buffer.
 If not found, stay at current position and return nil."
 If not found, stay at current position and return nil."
-  (let (pos)
+  (let ((case-fold-search t) pos)
     (save-excursion
     (save-excursion
       (goto-char (point-min))
       (goto-char (point-min))
-      (setq pos (and (re-search-forward (concat "^[ \t]*#\\+BEGIN:[ \t]+" name "\\>")
-					nil t)
+      (setq pos (and (re-search-forward
+		      (concat "^[ \t]*#\\+\\(?:BEGIN\\|begin\\):[ \t]+" name "\\>") nil t)
 		     (match-beginning 0))))
 		     (match-beginning 0))))
     (if pos (goto-char pos))
     (if pos (goto-char pos))
     pos))
     pos))
 
 
 (defconst org-dblock-start-re
 (defconst org-dblock-start-re
-  "^[ \t]*#\\+BEGIN:[ \t]+\\(\\S-+\\)\\([ \t]+\\(.*\\)\\)?"
+  "^[ \t]*#\\+\\(?:BEGIN\\|begin\\):[ \t]+\\(\\S-+\\)\\([ \t]+\\(.*\\)\\)?"
   "Matches the start line of a dynamic block, with parameters.")
   "Matches the start line of a dynamic block, with parameters.")
 
 
-(defconst org-dblock-end-re "^[ \t]*#\\+END\\([: \t\r\n]\\|$\\)"
+(defconst org-dblock-end-re "^[ \t]*#\\+\\(?:END\\|end\\)\\([: \t\r\n]\\|$\\)"
   "Matches the end of a dynamic block.")
   "Matches the end of a dynamic block.")
 
 
 (defun org-create-dblock (plist)
 (defun org-create-dblock (plist)