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: Fri, 25 May 2012 14:33:37 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=e89a8f6432c2dde3d704c0db931f Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXtiG-0007KV-6F for emacs-orgmode@gnu.org; Fri, 25 May 2012 08:33:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXtiB-00081S-3L for emacs-orgmode@gnu.org; Fri, 25 May 2012 08:33:47 -0400 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:60567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXtiA-00080o-Sr for emacs-orgmode@gnu.org; Fri, 25 May 2012 08:33:43 -0400 Received: by ggm4 with SMTP id 4so886945ggm.0 for ; Fri, 25 May 2012 05:33:38 -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 --e89a8f6432c2dde3d704c0db931f Content-Type: text/plain; charset=ISO-8859-1 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 rtnall 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index cfd3e25..eebb66f 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -3886,10 +3886,11 @@ 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 + (append 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 --e89a8f6432c2dde3d704c0db931f Content-Type: text/x-patch; charset=US-ASCII; name="0001-Let-org-agenda-time-grid-control-if-the-grid-is-disp.patch" Content-Disposition: attachment; filename="0001-Let-org-agenda-time-grid-control-if-the-grid-is-disp.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h2n8e9bm0 RnJvbSA1YjFiMDYwM2FjNzJmODQ4MmMwMzU5NmE0ZGFkY2M2NjkyODUyNTAzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBDaHJpc3RvcGhlIEp1bmtlIDxjaHJpc3RvcGhlLmp1bmtlQGlu cmlhLmZyPgpEYXRlOiBGcmksIDI1IE1heSAyMDEyIDExOjQwOjQ3ICswMjAwClN1YmplY3Q6IFtQ QVRDSF0gTGV0IG9yZy1hZ2VuZGEtdGltZS1ncmlkIGNvbnRyb2wgaWYgdGhlIGdyaWQgaXMgZGlz cGxheWVkCgoqIGxpc3Avb3JnLWFnZW5kYS5lbCAob3JnLWFnZW5kYS1saXN0KTogZW5zdXJlcyB0 aGF0IHRoZQpsaXN0IHJldHVybmVkIGJ5IG9yZy1hZ2VuZGEtYWRkLXRpbWUtZ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