From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christophe Junke Subject: [PATCH] Let org-agenda-time-grid control if the grid is displayed Date: Sun, 29 Jul 2012 09:56:06 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvOMC-0008MQ-QG for emacs-orgmode@gnu.org; Sun, 29 Jul 2012 03:56:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvOMB-0000Er-R9 for emacs-orgmode@gnu.org; Sun, 29 Jul 2012 03:56:08 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:63126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvOMB-0000E0-Lz for emacs-orgmode@gnu.org; Sun, 29 Jul 2012 03:56:07 -0400 Received: by obhx4 with SMTP id x4so8677182obh.0 for ; Sun, 29 Jul 2012 00:56:06 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * 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. 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 59e55f7..d48a795 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -3891,10 +3891,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.12.rc0.83.g8dd846e