From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suvayu Ali Subject: Re: Including current time in agenda Date: Mon, 06 Dec 2010 15:30:48 +0100 Message-ID: <4CFCF398.1080106@gmail.com> References: <66E55A24-B92C-4C28-BFDD-30D9A7F38515@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=53509 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPc5d-0005Kj-VI for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 09:30:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPc5c-0001ue-II for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 09:30:53 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:52314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPc5c-0001u9-CO for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 09:30:52 -0500 Received: by bwz16 with SMTP id 16so18135525bwz.0 for ; Mon, 06 Dec 2010 06:30:50 -0800 (PST) In-Reply-To: <66E55A24-B92C-4C28-BFDD-30D9A7F38515@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: Carsten Dominik Cc: Julien Danjou , org-mode mailing list 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. 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.