emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christophe Junke <junke.christophe@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Let org-agenda-time-grid control if the grid is displayed
Date: Sun, 29 Jul 2012 09:56:06 +0200	[thread overview]
Message-ID: <CAFDFyRgyKWo4CDpgNfToM-e9do1LKu3P-jZP--nL7ELsPY2HYg@mail.gmail.com> (raw)

* 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

             reply	other threads:[~2012-07-29  7:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-29  7:56 Christophe Junke [this message]
2012-08-07 21:44 ` [PATCH] Let org-agenda-time-grid control if the grid is displayed Bastien
  -- strict thread matches above, loose matches on Subject: below --
2012-05-25 12:33 Christophe Junke
2012-05-25 12:50 ` Christophe Junke
2012-05-25 22:20   ` Bastien
2012-05-26  2:14     ` Matt Lundin
2012-05-26  4:27       ` Bastien
2012-05-28 16:02         ` Matt Lundin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFDFyRgyKWo4CDpgNfToM-e9do1LKu3P-jZP--nL7ELsPY2HYg@mail.gmail.com \
    --to=junke.christophe@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).