Browse Source

Fix time extraction when inserting diary entries with `i d'

Carsten Dominik 15 years ago
parent
commit
b79e7790f9
2 changed files with 11 additions and 4 deletions
  1. 6 0
      lisp/ChangeLog
  2. 5 4
      lisp/org-agenda.el

+ 6 - 0
lisp/ChangeLog

@@ -1,3 +1,9 @@
+2010-03-18  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file):
+	Make sure the behavior regarding to extracting time is
+	consistent.
+
 2010-03-17  Stephen Eglen  <stephen@gnu.org>
 
 	* org-agenda.el (org-agenda-insert-diary-extract-time): New

+ 5 - 4
lisp/org-agenda.el

@@ -7105,12 +7105,13 @@ the resulting entry will not be shown.  When TEXT is empty, switch to
 	(insert (format "%%%%(diary-anniversary %s) %s"
 			(calendar-date-string d1 nil t) text))))
      ((eq type 'day)
-      (let*
-	  (fmt time time2
-	       (org-agenda-time-leading-zero t))
+      (let ((org-prefix-has-time t)
+	    (org-agenda-time-leading-zero t)
+	    fmt time time2)
 	(if org-agenda-insert-diary-extract-time
 	    ;; Use org-format-agenda-item to parse text for a time-range and
-	    ;; remove it.  
+	    ;; remove it.  FIXME: This is a hack, we should refactor
+	    ;; that function to make time extraction available separately
 	    (setq fmt (org-format-agenda-item nil text nil nil t)
 		  time (get-text-property 0 'time fmt)
 		  time2 (if (> (length time) 0)