emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] Let org-agenda-time-grid control if the grid is displayed


From: Christophe Junke
Subject: [O] [PATCH] Let org-agenda-time-grid control if the grid is displayed
Date: Fri, 25 May 2012 14:50:04 +0200

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,
 - and finally checks the emptiness of the resulting list
   before pretty printing.

My previous patch had a bug (no need to append), please
do not consider it. I apologize for the noise.

TINYCHANGE
---
 lisp/org-agenda.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index cfd3e25..de555c0 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -3886,10 +3886,10 @@ given in `org-agenda-start-on-weekday'."
            (put-text-property s (1- (point)) 'org-day-cnt day-cnt)
            (when todayp
              (put-text-property s (1- (point)) 'org-today t))
+           (setq rtnall
+                 (org-agenda-add-time-grid-maybe rtnall ndays todayp))
            (if rtnall (insert ;; all entries
-                       (org-finalize-agenda-entries
-                        (org-agenda-add-time-grid-maybe
-                         rtnall ndays todayp))
+                       (org-finalize-agenda-entries rtnall)
                        "\n"))
            (put-text-property s (1- (point)) 'day d)
            (put-text-property s (1- (point)) 'org-day-cnt day-cnt))))
-- 
1.7.10.2.484.gcd07cc5

Attachment: 0001-Let-org-agenda-time-grid-control-if-the-grid-is-disp.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]