emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Including current time in agenda
@ 2010-12-06  6:49 suvayu ali
  2010-12-06 11:47 ` Eric S Fraga
  2010-12-06 13:38 ` Julien Danjou
  0 siblings, 2 replies; 32+ messages in thread
From: suvayu ali @ 2010-12-06  6:49 UTC (permalink / raw)
  To: org-mode mailing list

Hi,

I have been attempting this for a few days now. I want to have an
entry for the current time in today's agenda. That way I can keep
track of how much time I have left until my next appointment.

So far what ever I try, it shows up as an entry without a timestamp as
shown below.

Monday      6 December 2010 W49
               8:00...... ----------------
              10:00...... ----------------
              12:00...... ----------------
              14:00...... ----------------
  thoughts:   15:30-17:30 W' meeting
              16:00...... ----------------
              18:00...... ----------------
              20:00...... ----------------
  thoughts:   Currrent time
  thoughts:   TODO Hostel Room Change


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.

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06  6:49 Including current time in agenda suvayu ali
@ 2010-12-06 11:47 ` Eric S Fraga
  2010-12-06 11:55   ` suvayu ali
  2010-12-06 13:38 ` Julien Danjou
  1 sibling, 1 reply; 32+ messages in thread
From: Eric S Fraga @ 2010-12-06 11:47 UTC (permalink / raw)
  To: suvayu ali; +Cc: org-mode mailing list

suvayu ali <fatkasuvayu+linux@gmail.com> writes:

> Hi,
>
> I have been attempting this for a few days now. I want to have an
> entry for the current time in today's agenda. That way I can keep
> track of how much time I have left until my next appointment.
>
> So far what ever I try, it shows up as an entry without a timestamp as
> shown below.
>
> Monday      6 December 2010 W49
>                8:00...... ----------------
>               10:00...... ----------------
>               12:00...... ----------------
>               14:00...... ----------------
>   thoughts:   15:30-17:30 W' meeting
>               16:00...... ----------------
>               18:00...... ----------------
>               20:00...... ----------------
>   thoughts:   Currrent time
>   thoughts:   TODO Hostel Room Change
>
>
> 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.

If I understand things correctly, Emacs Diary expressions simply return
t or nil to indicate whether an entry should be displayed for the
particular date.  They do not return a string and, more to the point,
they do not take the time into account.  In Emacs Diary, the time has to
be part of the text outside the sexp.

However, it would be nice if the agenda view could highlight the current
time, much as it is possible to highlight the current day in a week
view, for instance... so this could be a good "feature request"!  I have
no idea how hard it would be to implement, mind you...

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.3 (release_7.3.211.g6388.dirty)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 11:47 ` Eric S Fraga
@ 2010-12-06 11:55   ` suvayu ali
  2010-12-06 12:08     ` Eric S Fraga
  0 siblings, 1 reply; 32+ messages in thread
From: suvayu ali @ 2010-12-06 11:55 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: org-mode mailing list

Hi Eric,

On Mon, Dec 6, 2010 at 12:47 PM, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
> suvayu ali <fatkasuvayu+linux@gmail.com> writes:
>
>> Hi,
>>
>> I have been attempting this for a few days now. I want to have an
>> entry for the current time in today's agenda. That way I can keep
>> track of how much time I have left until my next appointment.
>>
>> So far what ever I try, it shows up as an entry without a timestamp as
>> shown below.
>>
>> Monday      6 December 2010 W49
>>                8:00...... ----------------
>>               10:00...... ----------------
>>               12:00...... ----------------
>>               14:00...... ----------------
>>   thoughts:   15:30-17:30 W' meeting
>>               16:00...... ----------------
>>               18:00...... ----------------
>>               20:00...... ----------------
>>   thoughts:   Currrent time
>>   thoughts:   TODO Hostel Room Change
>>
>>
>> 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.
>
> If I understand things correctly, Emacs Diary expressions simply return
> t or nil to indicate whether an entry should be displayed for the
> particular date.  They do not return a string and, more to the point,
> they do not take the time into account.  In Emacs Diary, the time has to
> be part of the text outside the sexp.
>

Thank you for clarifying that. I was incorrectly expecting it returns
a text. Should have checked more closely.

> However, it would be nice if the agenda view could highlight the current
> time, much as it is possible to highlight the current day in a week
> view, for instance... so this could be a good "feature request"!  I have
> no idea how hard it would be to implement, mind you...
>

Would you have any idea where I could look to get started with
implementing something like this?

> --
> : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
> : using Org-mode version 7.3 (release_7.3.211.g6388.dirty)
>

Thanks a lot for your response.

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 11:55   ` suvayu ali
@ 2010-12-06 12:08     ` Eric S Fraga
  2010-12-06 12:27       ` suvayu ali
  2010-12-06 13:00       ` Carsten Dominik
  0 siblings, 2 replies; 32+ messages in thread
From: Eric S Fraga @ 2010-12-06 12:08 UTC (permalink / raw)
  To: suvayu ali; +Cc: org-mode mailing list

suvayu ali <fatkasuvayu+linux@gmail.com> writes:

> Hi Eric,
>
> On Mon, Dec 6, 2010 at 12:47 PM, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:

[...]

>> However, it would be nice if the agenda view could highlight the current
>> time, much as it is possible to highlight the current day in a week
>> view, for instance... so this could be a good "feature request"!  I have
>> no idea how hard it would be to implement, mind you...
>>
>
> Would you have any idea where I could look to get started with
> implementing something like this?

Sorry, not a clue.  All I can suggest is you look at org-agenda.el.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.3 (release_7.3.211.g6388.dirty)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 12:08     ` Eric S Fraga
@ 2010-12-06 12:27       ` suvayu ali
  2010-12-06 13:00       ` Carsten Dominik
  1 sibling, 0 replies; 32+ messages in thread
From: suvayu ali @ 2010-12-06 12:27 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: org-mode mailing list

On Mon, Dec 6, 2010 at 1:08 PM, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
>> Would you have any idea where I could look to get started with
>> implementing something like this?
>
> Sorry, not a clue.  All I can suggest is you look at org-agenda.el.
>

Okay thanks. I'll see what I can find out, if I do succeed this would
be my first contribution. :)

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 12:08     ` Eric S Fraga
  2010-12-06 12:27       ` suvayu ali
@ 2010-12-06 13:00       ` Carsten Dominik
  2010-12-06 13:10         ` suvayu ali
  1 sibling, 1 reply; 32+ messages in thread
From: Carsten Dominik @ 2010-12-06 13:00 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: org-mode mailing list


On Dec 6, 2010, at 1:08 PM, Eric S Fraga wrote:

> suvayu ali <fatkasuvayu+linux@gmail.com> writes:
>
>> Hi Eric,
>>
>> On Mon, Dec 6, 2010 at 12:47 PM, Eric S Fraga <e.fraga@ucl.ac.uk>  
>> wrote:
>
> [...]
>
>>> However, it would be nice if the agenda view could highlight the  
>>> current
>>> time, much as it is possible to highlight the current day in a week
>>> view, for instance... so this could be a good "feature request"!   
>>> I have
>>> no idea how hard it would be to implement, mind you...
>>>
>>
>> Would you have any idea where I could look to get started with
>> implementing something like this?
>
> Sorry, not a clue.  All I can suggest is you look at org-agenda.el.

Take a look at the function org-agenda-add-time-grid-maybe.

There is a loop over the gridtimes.  Just before the

    (while (setq time (pop gridtimes))

you could add something like

           (setq time (format-time-string "%H%M"))
   	  (push (org-format-agenda-item
		 nil "--- now --- now --- now --- now --- now --- " "" nil
		 (concat (substring time 0 -2) ":" (substring time -2)))
		new)
	  (put-text-property
	   2 (length (car new)) 'face 'org-time-grid (car new))

You may still play with the string to be used (here "now --- now  
--- ..."),
you might want to add a different face, and the whole thing should be  
configurable
with some variable - plenty of work and testing left for you :)

- Carsten

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 13:00       ` Carsten Dominik
@ 2010-12-06 13:10         ` suvayu ali
  0 siblings, 0 replies; 32+ messages in thread
From: suvayu ali @ 2010-12-06 13:10 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: org-mode mailing list

On Mon, Dec 6, 2010 at 2:00 PM, Carsten Dominik
<carsten.dominik@gmail.com> wrote:
>
> On Dec 6, 2010, at 1:08 PM, Eric S Fraga wrote:
>
>> suvayu ali <fatkasuvayu+linux@gmail.com> writes:
>>
>>> Hi Eric,
>>>
>>> On Mon, Dec 6, 2010 at 12:47 PM, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
>>
>> [...]
>>
>>>> However, it would be nice if the agenda view could highlight the current
>>>> time, much as it is possible to highlight the current day in a week
>>>> view, for instance... so this could be a good "feature request"!  I have
>>>> no idea how hard it would be to implement, mind you...
>>>>
>>>
>>> Would you have any idea where I could look to get started with
>>> implementing something like this?
>>
>> Sorry, not a clue.  All I can suggest is you look at org-agenda.el.
>
> Take a look at the function org-agenda-add-time-grid-maybe.
>
> There is a loop over the gridtimes.  Just before the
>
>   (while (setq time (pop gridtimes))
>
> you could add something like
>
>          (setq time (format-time-string "%H%M"))
>          (push (org-format-agenda-item
>                 nil "--- now --- now --- now --- now --- now --- " "" nil
>                 (concat (substring time 0 -2) ":" (substring time -2)))
>                new)
>          (put-text-property
>           2 (length (car new)) 'face 'org-time-grid (car new))
>
> You may still play with the string to be used (here "now --- now --- ..."),
> you might want to add a different face, and the whole thing should be
> configurable
> with some variable - plenty of work and testing left for you :)
>

Thanks a lot Carsten! I'll post back to the list in case I succeed or
if I get stuck. :)

> - Carsten
>
>



-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06  6:49 Including current time in agenda suvayu ali
  2010-12-06 11:47 ` Eric S Fraga
@ 2010-12-06 13:38 ` Julien Danjou
  2010-12-06 14:03   ` Carsten Dominik
                     ` (2 more replies)
  1 sibling, 3 replies; 32+ messages in thread
From: Julien Danjou @ 2010-12-06 13:38 UTC (permalink / raw)
  To: suvayu ali; +Cc: org-mode mailing list


[-- Attachment #1.1: Type: text/plain, Size: 635 bytes --]

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 Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 13:38 ` Julien Danjou
@ 2010-12-06 14:03   ` Carsten Dominik
  2010-12-06 14:30     ` Suvayu Ali
  2010-12-06 15:39   ` Matt Lundin
  2010-12-06 19:27   ` Eric S Fraga
  2 siblings, 1 reply; 32+ messages in thread
From: Carsten Dominik @ 2010-12-06 14:03 UTC (permalink / raw)
  To: Julien Danjou; +Cc: org-mode mailing list


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.

- Carsten

>
> I think this is what you want?
>
> -- 
> Julien Danjou
> // ᐰ <julien@danjou.info>   http://julien.danjou.info
> _______________________________________________
> 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

- Carsten

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 14:03   ` Carsten Dominik
@ 2010-12-06 14:30     ` Suvayu Ali
  2010-12-06 14:45       ` Carsten Dominik
                         ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Suvayu Ali @ 2010-12-06 14:30 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Julien Danjou, org-mode mailing list

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.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 14:30     ` Suvayu Ali
@ 2010-12-06 14:45       ` Carsten Dominik
  2010-12-06 14:53         ` Suvayu Ali
  2010-12-06 14:59       ` Rémi Vanicat
  2010-12-06 15:13       ` Julien Danjou
  2 siblings, 1 reply; 32+ messages in thread
From: Carsten Dominik @ 2010-12-06 14:45 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: Julien Danjou, org-mode mailing list


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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 14:45       ` Carsten Dominik
@ 2010-12-06 14:53         ` Suvayu Ali
  2010-12-06 14:56           ` Carsten Dominik
  0 siblings, 1 reply; 32+ messages in thread
From: Suvayu Ali @ 2010-12-06 14:53 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Julien Danjou, org-mode mailing list

Hi Carsten,

On 06/12/10 03:45 PM, Carsten Dominik wrote:
> 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?
>

No I haven't changed anything yet.

In my agenda file I have an entry like this,

* Currrent time
   <%%(jd:org-current-time)>

After I start Emacs I evaluate Julien's function in the scratch buffer,
then I call `org-agenda' with `C-c a a'. This gives me an agenda buffer
with the following entries.

Monday      6 December 2010 W49
                8:00...... ----------------
               10:00...... ----------------
               12:00...... ----------------
               14:00...... ----------------
   thoughts:   15:30-17:30 W' meeting
               16:00...... ----------------
               18:00...... ----------------
               20:00...... ----------------
   thoughts:   Currrent time
   thoughts:   TODO Hostel Room Change

> - Carsten


-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 14:53         ` Suvayu Ali
@ 2010-12-06 14:56           ` Carsten Dominik
  0 siblings, 0 replies; 32+ messages in thread
From: Carsten Dominik @ 2010-12-06 14:56 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: Julien Danjou, org-mode mailing list


On Dec 6, 2010, at 3:53 PM, Suvayu Ali wrote:

> Hi Carsten,
>
> On 06/12/10 03:45 PM, Carsten Dominik wrote:
>> 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?
>>
>
> No I haven't changed anything yet.
>
> In my agenda file I have an entry like this,
>
> * Currrent time
>  <%%(jd:org-current-time)>

This is not correct.

Use this instead, in any of your agenda files:

* Currrent time
   :PROPERTIES:
   :CATEGORY: NOW
   :END:

%%(jd:org-current-time)

HTH

- Carsten



>
> After I start Emacs I evaluate Julien's function in the scratch  
> buffer,
> then I call `org-agenda' with `C-c a a'. This gives me an agenda  
> buffer
> with the following entries.
>
> Monday      6 December 2010 W49
>               8:00...... ----------------
>              10:00...... ----------------
>              12:00...... ----------------
>              14:00...... ----------------
>  thoughts:   15:30-17:30 W' meeting
>              16:00...... ----------------
>              18:00...... ----------------
>              20:00...... ----------------
>  thoughts:   Currrent time
>  thoughts:   TODO Hostel Room Change
>
>> - Carsten
>
>
> -- 
> Suvayu
>
> Open source is the future. It sets us free.

- Carsten

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 14:30     ` Suvayu Ali
  2010-12-06 14:45       ` Carsten Dominik
@ 2010-12-06 14:59       ` Rémi Vanicat
  2010-12-06 15:10         ` suvayu ali
  2010-12-06 15:13       ` Julien Danjou
  2 siblings, 1 reply; 32+ messages in thread
From: Rémi Vanicat @ 2010-12-06 14:59 UTC (permalink / raw)
  To: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

>>>
>>> (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.

you need to put the %%(jd:org-current-time) at the beginning of line,
with no space before it whatsoever.
-- 
Rémi Vanicat

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Re: Including current time in agenda
  2010-12-06 14:59       ` Rémi Vanicat
@ 2010-12-06 15:10         ` suvayu ali
  0 siblings, 0 replies; 32+ messages in thread
From: suvayu ali @ 2010-12-06 15:10 UTC (permalink / raw)
  To: Rémi Vanicat; +Cc: emacs-orgmode, Carsten Dominik

Hi Rémi and Carsten,

On Mon, Dec 6, 2010 at 3:59 PM, Rémi Vanicat <vanicat@debian.org> wrote:
> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
>
>>>>
>>>> (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.
>
> you need to put the %%(jd:org-current-time) at the beginning of line,
> with no space before it whatsoever.

Thank you all, everything works as expected now. :)

> --
> Rémi Vanicat
>

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 14:30     ` Suvayu Ali
  2010-12-06 14:45       ` Carsten Dominik
  2010-12-06 14:59       ` Rémi Vanicat
@ 2010-12-06 15:13       ` Julien Danjou
  2010-12-06 15:28         ` Suvayu Ali
  2 siblings, 1 reply; 32+ messages in thread
From: Julien Danjou @ 2010-12-06 15:13 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: org-mode mailing list, Carsten Dominik


[-- Attachment #1.1: Type: text/plain, Size: 308 bytes --]

On Mon, Dec 06 2010, Suvayu Ali wrote:

> That is exactly the information I want to have, but this only inserts an
> entry in today's agenda without any timestamps.

You are wrong. It does insert an entry with a timestamp.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 15:13       ` Julien Danjou
@ 2010-12-06 15:28         ` Suvayu Ali
  0 siblings, 0 replies; 32+ messages in thread
From: Suvayu Ali @ 2010-12-06 15:28 UTC (permalink / raw)
  To: Julien Danjou, org-mode mailing list

Hi Julien,

On 06/12/10 04:13 PM, Julien Danjou wrote:
> On Mon, Dec 06 2010, Suvayu Ali wrote:
>
>> That is exactly the information I want to have, but this only inserts an
>> entry in today's agenda without any timestamps.
>
> You are wrong. It does insert an entry with a timestamp.
>

Sorry for the confusion, I was using it incorrectly. Carsten and Rémi 
corrected my mistake.

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 13:38 ` Julien Danjou
  2010-12-06 14:03   ` Carsten Dominik
@ 2010-12-06 15:39   ` Matt Lundin
  2010-12-12  8:30     ` Carsten Dominik
  2010-12-06 19:27   ` Eric S Fraga
  2 siblings, 1 reply; 32+ messages in thread
From: Matt Lundin @ 2010-12-06 15:39 UTC (permalink / raw)
  To: suvayu ali; +Cc: org-mode mailing list

Julien Danjou <julien@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.
>

This is great! I've been grateful for all the creative uses people have
found for diary expressions recently (weather, current time, etc.).

Best,
Matt

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 13:38 ` Julien Danjou
  2010-12-06 14:03   ` Carsten Dominik
  2010-12-06 15:39   ` Matt Lundin
@ 2010-12-06 19:27   ` Eric S Fraga
  2010-12-06 22:34     ` suvayu ali
  2 siblings, 1 reply; 32+ messages in thread
From: Eric S Fraga @ 2010-12-06 19:27 UTC (permalink / raw)
  To: suvayu ali; +Cc: org-mode mailing list

Julien Danjou <julien@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'm using unicode/utf characters in case the dashes and arrow heads
don't come through)

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.3 (release_7.3.213.g1ce0)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Including current time in agenda
  2010-12-06 19:27   ` Eric S Fraga
@ 2010-12-06 22:34     ` suvayu ali
  2010-12-08 23:46       ` [PATCH] sexp can set its face (was: Including current time in agenda) Łukasz Stelmach
  0 siblings, 1 reply; 32+ messages in thread
From: suvayu ali @ 2010-12-06 22:34 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: org-mode mailing list

Hi,

On Mon, Dec 6, 2010 at 8:27 PM, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
> Julien Danjou <julien@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.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH] sexp can set its face (was: Including current time in agenda)
  2010-12-06 22:34     ` suvayu ali
@ 2010-12-08 23:46       ` Łukasz Stelmach
  2010-12-12  7:44         ` Carsten Dominik
  2010-12-13  0:14         ` suvayu ali
  0 siblings, 2 replies; 32+ messages in thread
From: Łukasz Stelmach @ 2010-12-08 23:46 UTC (permalink / raw)
  To: emacs-orgmode

suvayu ali <fatkasuvayu+linux@gmail.com> writes:

> 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"))))

To accomplish this you'd have to apply the following patch and use 'face
property rather than font-lock-face.

Why can't a sexp choose its 'face after all?

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 20c901a..ba5eafc 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4650,8 +4650,7 @@ the documentation of `org-diary'."
 (defun org-agenda-get-sexps ()
   "Return the sexp information for agenda display."
   (require 'diary-lib)
-  (let* ((props (list 'face nil
-		      'mouse-face 'highlight
+  (let* ((props (list 'mouse-face 'highlight
 		      'help-echo
 		      (format "mouse-2 or RET jump to org file %s"
 			      (abbreviate-file-name buffer-file-name))))
--8<---------------cut here---------------end--------------->8---

-- 
Miłego dnia,
Łukasz Stelmach

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH] sexp can set its face (was: Including current time in agenda)
  2010-12-08 23:46       ` [PATCH] sexp can set its face (was: Including current time in agenda) Łukasz Stelmach
@ 2010-12-12  7:44         ` Carsten Dominik
  2010-12-13  0:14         ` suvayu ali
  1 sibling, 0 replies; 32+ messages in thread
From: Carsten Dominik @ 2010-12-12  7:44 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: emacs-orgmode

Patch accepted, thanks.

- Carsten

On Dec 9, 2010, at 12:46 AM, Łukasz Stelmach wrote:

> suvayu ali <fatkasuvayu+linux@gmail.com> writes:
>
>> 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"))))
>
> To accomplish this you'd have to apply the following patch and use  
> 'face
> property rather than font-lock-face.
>
> Why can't a sexp choose its 'face after all?
>
> --8<---------------cut here---------------start------------->8---
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index 20c901a..ba5eafc 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -4650,8 +4650,7 @@ the documentation of `org-diary'."
> (defun org-agenda-get-sexps ()
>   "Return the sexp information for agenda display."
>   (require 'diary-lib)
> -  (let* ((props (list 'face nil
> -		      'mouse-face 'highlight
> +  (let* ((props (list 'mouse-face 'highlight
> 		      'help-echo
> 		      (format "mouse-2 or RET jump to org file %s"
> 			      (abbreviate-file-name buffer-file-name))))
> --8<---------------cut here---------------end--------------->8---
>
> -- 
> Miłego dnia,
> Łukasz Stelmach
>
>
> _______________________________________________
> 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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Re: Including current time in agenda
  2010-12-06 15:39   ` Matt Lundin
@ 2010-12-12  8:30     ` Carsten Dominik
  2010-12-12 17:54       ` Eric S Fraga
  2010-12-12 18:19       ` suvayu ali
  0 siblings, 2 replies; 32+ messages in thread
From: Carsten Dominik @ 2010-12-12  8:30 UTC (permalink / raw)
  To: Matt Lundin; +Cc: org-mode mailing list


On Dec 6, 2010, at 4:39 PM, Matt Lundin wrote:

> Julien Danjou <julien@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.
>>
>
> This is great! I've been grateful for all the creative uses people  
> have
> found for diary expressions recently (weather, current time, etc.).

I agree that this is creative and great.

However having the current time in the time grid is so useful that
I have now made it the default, no diary sexp needed.

If you don't like the way it looks, change the variable
`org-agenda-current-time-string' and the face
`org-agenda-current-time'.

To get rid of the current time in the time grid alltogether,
use

(setq org-agenda-show-current-time-in-grid nil)

- Carsten

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Re: Including current time in agenda
  2010-12-12  8:30     ` Carsten Dominik
@ 2010-12-12 17:54       ` Eric S Fraga
  2010-12-12 21:31         ` Matt Lundin
  2010-12-12 18:19       ` suvayu ali
  1 sibling, 1 reply; 32+ messages in thread
From: Eric S Fraga @ 2010-12-12 17:54 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Matt Lundin, org-mode mailing list

Carsten Dominik <carsten.dominik@gmail.com> writes:

[...]

> I agree that this is creative and great.
>
> However having the current time in the time grid is so useful that
> I have now made it the default, no diary sexp needed.

Thanks for this, Carsten.  I like being able to change the face easily
(in my case, I simply set it to underline with no agenda string to keep
a minimalist approach).  

However, there is one problem (?): if I change my view to another day
(using, say, "j" in the agenda day view), I get the "current time"
highlighted for that other day and obviously the current time makes no
sense other than for "today", I would argue.

Thanks again,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.4 (release_7.4.10.g93135f)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Re: Including current time in agenda
  2010-12-12  8:30     ` Carsten Dominik
  2010-12-12 17:54       ` Eric S Fraga
@ 2010-12-12 18:19       ` suvayu ali
  1 sibling, 0 replies; 32+ messages in thread
From: suvayu ali @ 2010-12-12 18:19 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Matt Lundin, org-mode mailing list

On Sun, Dec 12, 2010 at 9:30 AM, Carsten Dominik
<carsten.dominik@gmail.com> wrote:
>
> However having the current time in the time grid is so useful that
> I have now made it the default, no diary sexp needed.
>
> If you don't like the way it looks, change the variable
> `org-agenda-current-time-string' and the face
> `org-agenda-current-time'.
>
> To get rid of the current time in the time grid alltogether,
> use
>
> (setq org-agenda-show-current-time-in-grid nil)

Thanks a lot Carsten!! :)

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Re: Including current time in agenda
  2010-12-12 17:54       ` Eric S Fraga
@ 2010-12-12 21:31         ` Matt Lundin
  2011-01-07 19:31           ` Erik Butz
  0 siblings, 1 reply; 32+ messages in thread
From: Matt Lundin @ 2010-12-12 21:31 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: org-mode mailing list, Carsten Dominik

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
> [...]
>
>> I agree that this is creative and great.
>>
>> However having the current time in the time grid is so useful that
>> I have now made it the default, no diary sexp needed.
>
> Thanks for this, Carsten.  I like being able to change the face easily
> (in my case, I simply set it to underline with no agenda string to keep
> a minimalist approach).  
>
> However, there is one problem (?): if I change my view to another day
> (using, say, "j" in the agenda day view), I get the "current time"
> highlighted for that other day and obviously the current time makes no
> sense other than for "today", I would argue.

The patch below fixes the issue for me. 

Best,
Matt

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index fb26ee9..67c8d89 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5353,7 +5353,7 @@ The modified list may contain inherited tags, and tags matched by
 		new)
 	  (put-text-property
 	   2 (length (car new)) 'face 'org-time-grid (car new))))
-      (when org-agenda-show-current-time-in-grid
+      (when (and todayp org-agenda-show-current-time-in-grid)
 	(push (org-format-agenda-item
 	       nil 
 	       org-agenda-current-time-string
--8<---------------cut here---------------end--------------->8---

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH] sexp can set its face (was: Including current time in agenda)
  2010-12-08 23:46       ` [PATCH] sexp can set its face (was: Including current time in agenda) Łukasz Stelmach
  2010-12-12  7:44         ` Carsten Dominik
@ 2010-12-13  0:14         ` suvayu ali
  1 sibling, 0 replies; 32+ messages in thread
From: suvayu ali @ 2010-12-13  0:14 UTC (permalink / raw)
  To: Łukasz Stelmach; +Cc: emacs-orgmode

Hi Łukasz,

2010/12/9 Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl>:
> suvayu ali <fatkasuvayu+linux@gmail.com> writes:
>
>> 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"))))
>
> To accomplish this you'd have to apply the following patch and use 'face
> property rather than font-lock-face.
>
> Why can't a sexp choose its 'face after all?
>

Thanks for this patch. Works great. :)


> --8<---------------cut here---------------start------------->8---
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index 20c901a..ba5eafc 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -4650,8 +4650,7 @@ the documentation of `org-diary'."
>  (defun org-agenda-get-sexps ()
>   "Return the sexp information for agenda display."
>   (require 'diary-lib)
> -  (let* ((props (list 'face nil
> -                     'mouse-face 'highlight
> +  (let* ((props (list 'mouse-face 'highlight
>                      'help-echo
>                      (format "mouse-2 or RET jump to org file %s"
>                              (abbreviate-file-name buffer-file-name))))
> --8<---------------cut here---------------end--------------->8---
>

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Re: Including current time in agenda
  2010-12-12 21:31         ` Matt Lundin
@ 2011-01-07 19:31           ` Erik Butz
  2011-01-07 23:27             ` suvayu ali
  0 siblings, 1 reply; 32+ messages in thread
From: Erik Butz @ 2011-01-07 19:31 UTC (permalink / raw)
  To: Matt Lundin; +Cc: Carsten Dominik, org-mode mailing list

Hi all,

thanks for this very nice feature. It's working mostly for me, but
now, whenever I try to insert a 'date, deadline,scheduled date' I get
an error saying:

"Symbol's value as variable is void: date"

which I don't quite understand.

Any ideas?

Thanks,

Erik

On Sun, Dec 12, 2010 at 10:31 PM, Matt Lundin <mdl@imapmail.org> wrote:
> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>
>> [...]
>>
>>> I agree that this is creative and great.
>>>
>>> However having the current time in the time grid is so useful that
>>> I have now made it the default, no diary sexp needed.
>>
>> Thanks for this, Carsten.  I like being able to change the face easily
>> (in my case, I simply set it to underline with no agenda string to keep
>> a minimalist approach).
>>
>> However, there is one problem (?): if I change my view to another day
>> (using, say, "j" in the agenda day view), I get the "current time"
>> highlighted for that other day and obviously the current time makes no
>> sense other than for "today", I would argue.
>
> The patch below fixes the issue for me.
>
> Best,
> Matt
>
> --8<---------------cut here---------------start------------->8---
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index fb26ee9..67c8d89 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -5353,7 +5353,7 @@ The modified list may contain inherited tags, and tags matched by
>                new)
>          (put-text-property
>           2 (length (car new)) 'face 'org-time-grid (car new))))
> -      (when org-agenda-show-current-time-in-grid
> +      (when (and todayp org-agenda-show-current-time-in-grid)
>        (push (org-format-agenda-item
>               nil
>               org-agenda-current-time-string
> --8<---------------cut here---------------end--------------->8---
>
>
> _______________________________________________
> 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
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Re: Including current time in agenda
  2011-01-07 19:31           ` Erik Butz
@ 2011-01-07 23:27             ` suvayu ali
  2011-01-07 23:46               ` Erik Butz
  0 siblings, 1 reply; 32+ messages in thread
From: suvayu ali @ 2011-01-07 23:27 UTC (permalink / raw)
  To: Erik Butz; +Cc: Matt Lundin, org-mode mailing list, Carsten Dominik

On Fri, Jan 7, 2011 at 11:31 AM, Erik Butz <erik.butz@googlemail.com> wrote:
> Hi all,
>
> thanks for this very nice feature. It's working mostly for me, but
> now, whenever I try to insert a 'date, deadline,scheduled date' I get
> an error saying:
>
> "Symbol's value as variable is void: date"
>
> which I don't quite understand.
>
> Any ideas?
>

I have been using it without any problems so far. Could you elaborate a
little on how you are trying to use it? I just set these variables,
(both are optional though, defaults should work out of the box)

(setq org-agenda-current-time-string "- - - NOW! - - -"
      org-agenda-time-grid '((daily today)
			     "----------------"
			     (800 1000 1200 1400 1600 1800 2000)))

> Thanks,
>
> Erik

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Re: Including current time in agenda
  2011-01-07 23:27             ` suvayu ali
@ 2011-01-07 23:46               ` Erik Butz
  2011-01-08  0:04                 ` suvayu ali
  0 siblings, 1 reply; 32+ messages in thread
From: Erik Butz @ 2011-01-07 23:46 UTC (permalink / raw)
  To: suvayu ali; +Cc: Matt Lundin, org-mode mailing list, Carsten Dominik

I have


(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))))

in the .emacs file and and entry

* Current Time
 :PROPERTIES:
 :CATEGORY: NOW ——————►
 :END:

%%(org-current-time)

in one of my .org files. That's about all I did.

Any clues from this?

Thanks,

Erik



On Sat, Jan 8, 2011 at 12:27 AM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> On Fri, Jan 7, 2011 at 11:31 AM, Erik Butz <erik.butz@googlemail.com> wrote:
>> Hi all,
>>
>> thanks for this very nice feature. It's working mostly for me, but
>> now, whenever I try to insert a 'date, deadline,scheduled date' I get
>> an error saying:
>>
>> "Symbol's value as variable is void: date"
>>
>> which I don't quite understand.
>>
>> Any ideas?
>>
>
> I have been using it without any problems so far. Could you elaborate a
> little on how you are trying to use it? I just set these variables,
> (both are optional though, defaults should work out of the box)
>
> (setq org-agenda-current-time-string "- - - NOW! - - -"
>      org-agenda-time-grid '((daily today)
>                             "----------------"
>                             (800 1000 1200 1400 1600 1800 2000)))
>
>> Thanks,
>>
>> Erik
>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Re: Including current time in agenda
  2011-01-07 23:46               ` Erik Butz
@ 2011-01-08  0:04                 ` suvayu ali
  2011-01-08 14:46                   ` Erik Butz
  0 siblings, 1 reply; 32+ messages in thread
From: suvayu ali @ 2011-01-08  0:04 UTC (permalink / raw)
  To: Erik Butz; +Cc: Matt Lundin, org-mode mailing list, Carsten Dominik

Hi Erik,

On Fri, Jan 7, 2011 at 3:46 PM, Erik Butz <erik.butz@googlemail.com> wrote:
> I have
>
>
> (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))))
>
> in the .emacs file and and entry
>
> * Current Time
>  :PROPERTIES:
>  :CATEGORY: NOW ——————►
>  :END:
>
> %%(org-current-time)
>
> in one of my .org files. That's about all I did.
>

To get the current time, you don't need to do that any more. After
Carsten's change org shows that by default. Just remove that entry from
your agenda file and if you have any entries for today, the current time
shows up as NOW by default. You can even customise the face by
customising the face `org-agenda-current-time'.

As for your problem with your current setup, I think the problem is you
call the incorrect sexp. The entry should be,

%%(jd:org-current-time)

> Any clues from this?
>
> Thanks,
>
> Erik

Hope this helps

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Re: Including current time in agenda
  2011-01-08  0:04                 ` suvayu ali
@ 2011-01-08 14:46                   ` Erik Butz
  0 siblings, 0 replies; 32+ messages in thread
From: Erik Butz @ 2011-01-08 14:46 UTC (permalink / raw)
  To: suvayu ali; +Cc: Matt Lundin, org-mode mailing list, Carsten Dominik

Hi,

ok, sorry I made a copy-paste error into the mail for the function and
the call. But indeed I wasn't aware that this had become standard.
Indeed after pulling the latest version and removing those statements
everything (including the current time!) is working.

Sorry for the noise.

Thanks,

Erik

On Sat, Jan 8, 2011 at 1:04 AM, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> Hi Erik,
>
> On Fri, Jan 7, 2011 at 3:46 PM, Erik Butz <erik.butz@googlemail.com> wrote:
>> I have
>>
>>
>> (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))))
>>
>> in the .emacs file and and entry
>>
>> * Current Time
>>  :PROPERTIES:
>>  :CATEGORY: NOW ——————►
>>  :END:
>>
>> %%(org-current-time)
>>
>> in one of my .org files. That's about all I did.
>>
>
> To get the current time, you don't need to do that any more. After
> Carsten's change org shows that by default. Just remove that entry from
> your agenda file and if you have any entries for today, the current time
> shows up as NOW by default. You can even customise the face by
> customising the face `org-agenda-current-time'.
>
> As for your problem with your current setup, I think the problem is you
> call the incorrect sexp. The entry should be,
>
> %%(jd:org-current-time)
>
>> Any clues from this?
>>
>> Thanks,
>>
>> Erik
>
> Hope this helps
>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2011-01-08 14:47 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-06  6:49 Including current time in agenda suvayu ali
2010-12-06 11:47 ` Eric S Fraga
2010-12-06 11:55   ` suvayu ali
2010-12-06 12:08     ` Eric S Fraga
2010-12-06 12:27       ` suvayu ali
2010-12-06 13:00       ` Carsten Dominik
2010-12-06 13:10         ` suvayu ali
2010-12-06 13:38 ` Julien Danjou
2010-12-06 14:03   ` Carsten Dominik
2010-12-06 14:30     ` Suvayu Ali
2010-12-06 14:45       ` Carsten Dominik
2010-12-06 14:53         ` Suvayu Ali
2010-12-06 14:56           ` Carsten Dominik
2010-12-06 14:59       ` Rémi Vanicat
2010-12-06 15:10         ` suvayu ali
2010-12-06 15:13       ` Julien Danjou
2010-12-06 15:28         ` Suvayu Ali
2010-12-06 15:39   ` Matt Lundin
2010-12-12  8:30     ` Carsten Dominik
2010-12-12 17:54       ` Eric S Fraga
2010-12-12 21:31         ` Matt Lundin
2011-01-07 19:31           ` Erik Butz
2011-01-07 23:27             ` suvayu ali
2011-01-07 23:46               ` Erik Butz
2011-01-08  0:04                 ` suvayu ali
2011-01-08 14:46                   ` Erik Butz
2010-12-12 18:19       ` suvayu ali
2010-12-06 19:27   ` Eric S Fraga
2010-12-06 22:34     ` suvayu ali
2010-12-08 23:46       ` [PATCH] sexp can set its face (was: Including current time in agenda) Łukasz Stelmach
2010-12-12  7:44         ` Carsten Dominik
2010-12-13  0:14         ` suvayu ali

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).