Let org-agenda-time-grid control if the grid is displayed
commit993dd076fbe1dc62f2297a24a3f6acd8890e1af0
authorChristophe Junke <christophe.junke@inria.fr>
Fri, 25 May 2012 09:40:47 +0000 (25 11:40 +0200)
committerBastien Guerry <bzg@altern.org>
Fri, 25 May 2012 22:19:01 +0000 (26 00:19 +0200)
treebeaa927db3fbcb44ecc45bf9c94beeb1fd1eff72
parentc49a0f9e40110226546dd242fde531aa46ec57c3
Let org-agenda-time-grid control if the grid is displayed

* lisp/org-agenda.el (org-agenda-list): Ensures 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',
 - appends the result to `rtnall',
 - and finally checks the emptiness of the resulting list
   before pretty printing.

TINYCHANGE
lisp/org-agenda.el