Browse Source

org-list: org-keyword-time-regexp might be nil in other major modes

* lisp/org-list.el (org-toggle-checkbox): build value of
  org-keyword-time-regexp instead of using it directly, as it's
  buffer-local, and function might be called outside Org.
Nicolas Goaziou 8 years ago
parent
commit
d9c5b384f8
1 changed files with 10 additions and 5 deletions
  1. 10 5
      lisp/org-list.el

+ 10 - 5
lisp/org-list.el

@@ -81,14 +81,15 @@
 (require 'org-macs)
 (require 'org-compat)
 
+(defvar org-M-RET-may-split-line)
 (defvar org-blank-before-new-entry)
-(defvar org-complex-heading-regexp)
+(defvar org-clock-string)
+(defvar org-closed-string)
+(defvar org-deadline-string)
 (defvar org-description-max-indent)
-(defvar org-drawer-regexp)
 (defvar org-drawers)
-(defvar org-M-RET-may-split-line)
 (defvar org-odd-levels-only)
-(defvar org-outline-regexp)
+(defvar org-scheduled-string)
 (defvar org-ts-regexp)
 (defvar org-ts-regexp-both)
 
@@ -2076,7 +2077,11 @@ in subtree, ignoring drawers."
 	   (drawer-re (concat "^[ \t]*:\\("
 			      (mapconcat 'regexp-quote org-drawers "\\|")
 			      "\\):[ \t]*$"))
-	   (keyword-re (concat "^[ \t]*" org-keyword-time-regexp))
+	   (keyword-re (concat "^[ \t]*\\<\\(" org-scheduled-string
+			       "\\|" org-deadline-string
+			       "\\|" org-closed-string
+			       "\\|" org-clock-string "\\)"
+			       " *[[<]\\([^]>]+\\)[]>]"))
 	   (orderedp (org-entry-get nil "ORDERED"))
 	   (bounds
 	    ;; In a region, start at first item in region