emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Including current time in agenda


From: Suvayu Ali
Subject: Re: [Orgmode] Including current time in agenda
Date: Mon, 06 Dec 2010 15:30:48 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc13 Lightning/1.0b3pre Thunderbird/3.1.6

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]