Let `org-agenda-time-grid' control if the grid is displayed.
commit9dae6f04b12c8e38c8dcfc71e3a1a2ce6e63bf99
authorChristophe Junke <junke.christophe@gmail.com>
Sun, 29 Jul 2012 07:56:06 +0000 (29 09:56 +0200)
committerBastien Guerry <bzg@altern.org>
Tue, 7 Aug 2012 21:44:08 +0000 (7 23:44 +0200)
treeec42af79ec9c3c093981457cad846ced45d9b28b
parent179f5e484a9ab3e09fcaf28f5f17969848b285b1
Let `org-agenda-time-grid' control if the grid is displayed.

* org-agenda.el (org-agenda-list): Ensure that the
list returned by `org-agenda-add-time-grid-maybe' is appended
to `rtnall' before checking if the latter is emtpy.

In the case where rtnall is empty (no item for current day), we do not
call org-agenda-add-time-grid-maybe.  This seems bogus because that
function is already computing whether the time grid must be included,
and does so according to the user's preferences.

In particular, the `org-agenda-time-grid' variable has a
'require-timed' parameter controlling the visibility of the time grid.

So, this patch :

 - removes the premature check for rtnall being empty,
 - inconditionally calls org-agenda-add-time-grid-maybe,
 - and finally checks the emptiness of the resulting list
   before pretty printing.

TINYCHANGE
lisp/org-agenda.el