diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 310bbfbbd..5f583d236 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2008-09-13 Carsten Dominik + * org-agenda.el (org-agenda-todayp): New function. + (org-agenda-get-deadlines, org-agenda-get-scheduled): Use + `org-agenda-todayp'. + * org.el (org-insert-heading-respect-content) (org-insert-todo-heading-respect-content): New commands. (org-insert-heading-respect-content): New option. diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index cb02c9a47..0b46e2e09 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -3379,7 +3379,7 @@ the documentation of `org-diary'." (format "mouse-2 or RET jump to org file %s" (abbreviate-file-name buffer-file-name)))) (regexp org-deadline-time-regexp) - (todayp (equal date (calendar-current-date))) ; DATE bound by calendar + (todayp (org-agenda-todayp date)) ; DATE bound by calendar (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar d2 diff dfrac wdays pos pos1 category tags ee txt head face s upcomingp donep timestr) @@ -3468,7 +3468,7 @@ FRACTION is what fraction of the head-warning time has passed." (format "mouse-2 or RET jump to org file %s" (abbreviate-file-name buffer-file-name)))) (regexp org-scheduled-time-regexp) - (todayp (equal date (calendar-current-date))) ; DATE bound by calendar + (todayp (org-agenda-todayp date)) ; DATE bound by calendar (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar d2 diff pos pos1 category tags ee txt head pastschedp donep face timestr s) @@ -5366,6 +5366,17 @@ belonging to the \"Work\" category." (message "No event to add") (message "Added %d event%s for today" cnt (if (> cnt 1) "s" ""))))) +(defun org-agenda-todayp (date) + "Does DATE mean today, when considering `org-extend-today-until'?" + (let (today h) + (if (listp date) (setq date (calendar-absolute-from-gregorian date))) + (setq today (calendar-absolute-from-gregorian (calendar-current-date))) + (setq h (nth 2 (decode-time (current-time)))) + (or (and (>= h org-extend-today-until) + (= date today)) + (and (< h org-extend-today-until) + (= date (1- today)))))) + (provide 'org-agenda) ;; arch-tag: 77f7565d-7c4b-44af-a2df-9f6f7070cff1