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
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode