Browse Source

Use `org-scheduled-string' to find the scheduled date

John Wiegley 15 years ago
parent
commit
c2caedcf53
3 changed files with 9 additions and 2 deletions
  1. 7 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-habit.el
  3. 1 1
      lisp/org.el

+ 7 - 0
lisp/ChangeLog

@@ -1,5 +1,12 @@
 2009-10-22  John Wiegley  <jwiegley@gmail.com>
 
+	* org.el (org-get-repeat): Change so that this function can be
+	called with either `org-scheduled-string' or
+	`org-deadline-string'.
+
+	* org-habit.el (org-habit-parse-todo): Use `org-scheduled-string'
+	to find the scheduled date.
+
 	* org-clock.el (org-clock-auto-clock-resolution): Renamed
 	`org-clock-disable-clock-resolution', since negatives don't sound
 	good in customization variables.

+ 1 - 1
lisp/org-habit.el

@@ -159,7 +159,7 @@ This list represents a \"habit\" for the rest of this module."
     (if pom (goto-char pom))
     (assert (org-is-habit-p (point)))
     (let* ((scheduled (org-get-scheduled-time (point)))
-	   (scheduled-repeat (org-get-repeat "SCHEDULED"))
+	   (scheduled-repeat (org-get-repeat org-scheduled-string))
 	   (sr-days (org-habit-duration-to-days scheduled-repeat))
 	   (end (org-entry-end-position))
 	   closed-dates deadline dr-days)

+ 1 - 1
lisp/org.el

@@ -10055,7 +10055,7 @@ Returns the new TODO keyword, or nil if no state change should occur."
     (save-excursion
       (org-back-to-heading t)
       (and (re-search-forward (if tagline
-				  (concat tagline ":[^:]+" org-repeat-re)
+				  (concat tagline "\\s-*" org-repeat-re)
 				org-repeat-re)
 			      (org-entry-end-position) t)
 	   (match-string-no-properties 1)))))