From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Including current time in agenda Date: Mon, 06 Dec 2010 19:27:10 +0000 Message-ID: <87ei9ulky8.fsf@ucl.ac.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=49776 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPhQS-0005Ka-7Y for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 15:12:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPhQQ-00011f-VR for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 15:12:44 -0500 Received: from vscane-b.ucl.ac.uk ([144.82.108.141]:48784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPhQQ-00011L-R5 for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 15:12:42 -0500 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: org-mode mailing list Julien Danjou writes: > 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. > > I think this is what you want? Julien, many thanks for proving me wrong! This is great, especially if I have --8<---------------cut here---------------start------------->8--- *** current time :PROPERTIES: :CATEGORY: Now =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=96=BA :END: %%(jd:org-current-time) --8<---------------cut here---------------end--------------->8--- and change your "Current time" string to "=E2=97=84=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94". Now all I have to do is get rid of the ":" put after the category string and I have a nice symmetric time indicator! (I'm using unicode/utf characters in case the dashes and arrow heads don't come through) --=20 : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1 : using Org-mode version 7.3 (release_7.3.213.g1ce0)