From mboxrd@z Thu Jan 1 00:00:00 1970 From: suvayu ali Subject: Re: Including current time in agenda Date: Mon, 6 Dec 2010 23:34:39 +0100 Message-ID: References: <87ei9ulky8.fsf@ucl.ac.uk> 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=53760 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPjeB-00040n-6n for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 17:35:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPje8-0002Kr-S9 for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 17:35:02 -0500 Received: from mail-gy0-f169.google.com ([209.85.160.169]:56869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPje8-0002Kl-LU for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 17:35:00 -0500 Received: by gyg10 with SMTP id 10so21306827gyg.0 for ; Mon, 06 Dec 2010 14:35:00 -0800 (PST) In-Reply-To: <87ei9ulky8.fsf@ucl.ac.uk> 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: Eric S Fraga Cc: org-mode mailing list Hi, On Mon, Dec 6, 2010 at 8:27 PM, Eric S Fraga wrote: > 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")>' =C2=A0or `<%%(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 () >> =C2=A0 "Return current-time if date is today." >> =C2=A0 (when (equal date (calendar-current-date)) >> =C2=A0 =C2=A0 (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! =C2=A0This is great, especially if I ha= ve > > --8<---------------cut here---------------start------------->8--- > *** current time > =C2=A0 =C2=A0:PROPERTIES: > =C2=A0 =C2=A0:CATEGORY: Now =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=96=BA > =C2=A0 =C2=A0: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". =C2=A0Now all I have to > do is get rid of the ":" put after the category string and I have a nice > symmetric time indicator! > I actually tried to set the text properties for the string instead, but looks like org-agenda is ignoring that. (defun jd:org-current-time () "Return current-time if date is today." (when (equal date (calendar-current-date)) (propertize (format-time-string "%H:%M Current time") 'font-lock-face '(:weight bold :foreground "DodgerBlue4" :background "snow")))) --=20 Suvayu Open source is the future. It sets us free.