org-agenda.el: Fix bug: do not bypass `org-agenda-timerange-leaders'

* org-agenda.el (org-agenda-get-timestamps): Check if the item
is an habit when formatting it with `org-agenda-format-item'.
(org-agenda-get-blocks): Fix bug: don't assume the item is an
habit when formatting with `org-agenda-format-item'.

Thanks to George McNinch for reporting this.
This commit is contained in:
Bastien Guerry 2012-10-01 17:53:39 +02:00
parent 1df9907b50
commit 1dd42283b7
1 changed files with 4 additions and 3 deletions

View File

@ -5133,12 +5133,13 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
"\\|\\(<%%\\(([^>\n]+)\\)>\\)"))
marker hdmarker deadlinep scheduledp clockp closedp inactivep
donep tmp priority category category-pos ee txt timestr tags
b0 b3 e3 head todo-state end-of-match show-all warntime)
b0 b3 e3 head todo-state end-of-match show-all warntime habitp)
(goto-char (point-min))
(while (setq end-of-match (re-search-forward regexp nil t))
(setq b0 (match-beginning 0)
b3 (match-beginning 3) e3 (match-end 3)
todo-state (save-match-data (ignore-errors (org-get-todo-state)))
habitp (and (functionp 'org-is-habit-p) (org-is-habit-p))
show-all (or (eq org-agenda-repeating-timestamp-show-all t)
(member todo-state
org-agenda-repeating-timestamp-show-all)))
@ -5190,7 +5191,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
(setq txt (org-agenda-format-item
(if inactivep org-agenda-inactive-leader nil)
head category tags timestr
remove-re t)))
remove-re habitp)))
(setq priority (org-get-priority txt))
(org-add-props txt props
'org-marker marker 'org-hd-marker hdmarker)
@ -5848,7 +5849,7 @@ FRACTION is what fraction of the head-warning time has passed."
(concat "<" start-time ">"))
((= d2 d0)
(concat "<" end-time ">")))
remove-re t))))
remove-re))))
(org-add-props txt props
'org-marker marker 'org-hd-marker hdmarker
'type "block" 'date date