Hi,

On Mon, Dec 6, 2010 at 8:27 PM, Eric S Fraga <e.fr...@ucl.ac.uk> wrote:
> Julien Danjou <jul...@danjou.info> 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 ——————►
>    :END:
> %%(jd:org-current-time)
> --8<---------------cut here---------------end--------------->8---
>
> and change your "Current time" string to "◄——————".  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 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"))))

-- 
Suvayu

Open source is the future. It sets us free.

_______________________________________________
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

Reply via email to