From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Including current time in agenda Date: Mon, 6 Dec 2010 15:45:52 +0100 Message-ID: <2EDC548D-2EB1-41A0-9E3E-24A9606639E6@gmail.com> References: <66E55A24-B92C-4C28-BFDD-30D9A7F38515@gmail.com> <4CFCF398.1080106@gmail.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=54451 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPcKE-0004bm-FN for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 09:45:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPcKC-0005Tn-QK for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 09:45:58 -0500 Received: from mail-fx0-f41.google.com ([209.85.161.41]:35304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPcKC-0005TV-LG for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 09:45:56 -0500 Received: by fxm13 with SMTP id 13so10386234fxm.0 for ; Mon, 06 Dec 2010 06:45:55 -0800 (PST) In-Reply-To: <4CFCF398.1080106@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Suvayu Ali Cc: Julien Danjou , org-mode mailing list On Dec 6, 2010, at 3:30 PM, Suvayu Ali wrote: > Hi Julien, > > On 06/12/10 03:03 PM, Carsten Dominik wrote: >> On Dec 6, 2010, at 2:38 PM, Julien Danjou wrote: >> >>> On Mon, Dec 06 2010, suvayu ali wrote: >>>> So far my attempts have been some variation of `<%%(format-time- >>>> string >>>> "%H%M")>' or `<%%(diary-entry-time ...)>'. Am I approaching this >>>> the >>>> wrong way? Is this not supported by the diary library? >>>> >>>> Thanks for any thoughts/suggestions. >>> >>> (defun jd:org-current-time () >>> "Return current-time if date is today." >>> (when (equal date (calendar-current-date)) >>> (format-time-string "%H:%M Current time" (current-time)))) >>> >>> And use %%(jd:org-current-time) in an entry. >> >> Wow, I overlooked this possibility. Great. > > That is exactly the information I want to have, but this only > inserts an > entry in today's agenda without any timestamps. This does actually fully work for me, so something in your setup must cause a problem. Have you changed the configuration for the time grid? - Carsten > > I think the problem, as Eric explained earlier, is that the diary sexp > method only expects t or nil. So the string your function returns is > treated as true and a corresponding entry is inserted in the agenda > buffer for today. I think I would still need to insert the current > time > in the time-grid as Carsten suggested earlier. > > A weakly related question, how does one check/debug diary sexps? > Evaluating in the scratch buffer always gives me a "void variable > date" > error. Replacing `date' with `(calendar-current-date)' however works > fine in the scratch buffer. > > Thanks for all the suggestions. :) > > -- > Suvayu > > Open source is the future. It sets us free. - Carsten