org-agenda.el (org-agenda-finalize): Only try to draw the habit consistency graph when there is a habit in the buffer

* org-agenda.el (org-agenda-finalize): Only try to draw the
habit consistency graph when there is a habit in the buffer.
This commit is contained in:
Bastien Guerry 2013-01-06 09:14:54 +01:00
parent f1191b86e3
commit cd00d36ca2
1 changed files with 2 additions and 1 deletions

View File

@ -3545,7 +3545,8 @@ generating a new one."
(when org-agenda-entry-text-mode
(org-agenda-entry-text-hide)
(org-agenda-entry-text-show))
(if (functionp 'org-habit-insert-consistency-graphs)
(if (and (functionp 'org-habit-insert-consistency-graphs)
(save-excursion (next-single-property-change (point-min) 'org-habit-p)))
(org-habit-insert-consistency-graphs))
(let ((inhibit-read-only t))
(run-hooks 'org-agenda-finalize-hook))