emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* add a list item and automatically insert an incative timestamp without being asked to confirm "now"
@ 2009-03-25 13:30 Rainer Stengele
  2009-03-26 10:40 ` Carsten Dominik
  0 siblings, 1 reply; 5+ messages in thread
From: Rainer Stengele @ 2009-03-25 13:30 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

I want to write a function to create a new item in an item list and immediately
insert an inactive timestamp. How could I possibly do this?
I can write a keyboard macro, yes.
But can somebody show me how to write a function which I can global-set-key to?


Must be something like
...
(org-meta-return)
(org-time-stamp-inactive t)
...


Problem is I then get asked to confirm the current timestamp. In this case I
always want to use the current timestamp without being asked.

Thanks,

Rainer

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

* Re: add a list item and automatically insert an incative timestamp without being asked to confirm "now"
  2009-03-25 13:30 add a list item and automatically insert an incative timestamp without being asked to confirm "now" Rainer Stengele
@ 2009-03-26 10:40 ` Carsten Dominik
  2009-03-26 15:18   ` Rainer Stengele
  0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2009-03-26 10:40 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: emacs-orgmode


On Mar 25, 2009, at 2:30 PM, Rainer Stengele wrote:

> Hi all,
>
> I want to write a function to create a new item in an item list and  
> immediately
> insert an inactive timestamp. How could I possibly do this?
> I can write a keyboard macro, yes.
> But can somebody show me how to write a function which I can global- 
> set-key to?
>
>
> Must be something like
> ...
> (org-meta-return)
> (org-time-stamp-inactive t)
> ...
>
>
> Problem is I then get asked to confirm the current timestamp. In  
> this case I
> always want to use the current timestamp without being asked.
>

(defun xxx ()
   (interactive)
   (org-insert-item)
   (org-insert-time-stamp (current-time) 'with-hm 'inactive))

This assumes that you are in a plain list already.  Funnily
enough, there is no command to insert an item at any location, except  
pressing

   - SPC

of course :-)

So you could do


(defun xxx ()
   (interactive)
   (if (not (org-in-item-p))
       (insert "- ")
     (org-insert-item))
   (org-insert-time-stamp (current-time) 'with-hm 'inactive))



HTH

- Carsten


- Carsten

> Thanks,
>
> Rainer
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: 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] 5+ messages in thread

* Re: add a list item and automatically insert an incative timestamp without being asked to confirm "now"
  2009-03-26 10:40 ` Carsten Dominik
@ 2009-03-26 15:18   ` Rainer Stengele
  2009-03-26 16:01     ` Rainer Stengele
  0 siblings, 1 reply; 5+ messages in thread
From: Rainer Stengele @ 2009-03-26 15:18 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Carsten Dominik schrieb:
> 
> On Mar 25, 2009, at 2:30 PM, Rainer Stengele wrote:
> 
>> Hi all,
>>
>> I want to write a function to create a new item in an item list and
>> immediately
>> insert an inactive timestamp. How could I possibly do this?
>> I can write a keyboard macro, yes.
>> But can somebody show me how to write a function which I can
>> global-set-key to?
>>
>>
>> Must be something like
>> ...
>> (org-meta-return)
>> (org-time-stamp-inactive t)
>> ...
>>
>>
>> Problem is I then get asked to confirm the current timestamp. In this
>> case I
>> always want to use the current timestamp without being asked.
>>
> 
> (defun xxx ()
>   (interactive)
>   (org-insert-item)
>   (org-insert-time-stamp (current-time) 'with-hm 'inactive))
> 
> This assumes that you are in a plain list already.  Funnily
> enough, there is no command to insert an item at any location, except
> pressing
> 
>   - SPC
> 
> of course :-)
> 
> So you could do
> 
> 
> (defun xxx ()
>   (interactive)
>   (if (not (org-in-item-p))
>       (insert "- ")
>     (org-insert-item))
>   (org-insert-time-stamp (current-time) 'with-hm 'inactive))
> 
> 
> 
> HTH
> 
> - Carsten
> 
> 
> - Carsten
> 



Hi Carsten,

thanks a lot!
Why didn't I find that myself?
I simply tried C-h k C-c ! and found (org-time-stamp-inactive &optional arg).
If I only had found a hint to
  (org-insert-time-stamp time &optional with-hm inactive pre post extra)
...


Thanks again!

Rainer

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

* Re: add a list item and automatically insert an incative timestamp without being asked to confirm "now"
  2009-03-26 15:18   ` Rainer Stengele
@ 2009-03-26 16:01     ` Rainer Stengele
  2009-03-26 16:11       ` Carsten Dominik
  0 siblings, 1 reply; 5+ messages in thread
From: Rainer Stengele @ 2009-03-26 16:01 UTC (permalink / raw)
  Cc: emacs-orgmode

Carsten,

I tried to find the function where one can take notes with a relative timer with
M-<RET>. I gave up ...
I would like to try to add the functionality of adding an item with an inactive
timestamp with M-<RET> (add the item with timestamp if a timestamp occurs in the
previous item).
Where can I start to search?

Rainer


Rainer Stengele schrieb:
> Carsten Dominik schrieb:
>> On Mar 25, 2009, at 2:30 PM, Rainer Stengele wrote:
>>
>>> Hi all,
>>>
>>> I want to write a function to create a new item in an item list and
>>> immediately
>>> insert an inactive timestamp. How could I possibly do this?
>>> I can write a keyboard macro, yes.
>>> But can somebody show me how to write a function which I can
>>> global-set-key to?
>>>
>>>
>>> Must be something like
>>> ...
>>> (org-meta-return)
>>> (org-time-stamp-inactive t)
>>> ...
>>>
>>>
>>> Problem is I then get asked to confirm the current timestamp. In this
>>> case I
>>> always want to use the current timestamp without being asked.
>>>
>> (defun xxx ()
>>   (interactive)
>>   (org-insert-item)
>>   (org-insert-time-stamp (current-time) 'with-hm 'inactive))
>>
>> This assumes that you are in a plain list already.  Funnily
>> enough, there is no command to insert an item at any location, except
>> pressing
>>
>>   - SPC
>>
>> of course :-)
>>
>> So you could do
>>
>>
>> (defun xxx ()
>>   (interactive)
>>   (if (not (org-in-item-p))
>>       (insert "- ")
>>     (org-insert-item))
>>   (org-insert-time-stamp (current-time) 'with-hm 'inactive))
>>
>>
>>
>> HTH
>>
>> - Carsten
>>
>>
>> - Carsten
>>
> 
> 
> 
> Hi Carsten,
> 
> thanks a lot!
> Why didn't I find that myself?
> I simply tried C-h k C-c ! and found (org-time-stamp-inactive &optional arg).
> If I only had found a hint to
>   (org-insert-time-stamp time &optional with-hm inactive pre post extra)
> ...
> 
> 
> Thanks again!
> 
> Rainer
> 
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: 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] 5+ messages in thread

* Re: add a list item and automatically insert an incative timestamp without being asked to confirm "now"
  2009-03-26 16:01     ` Rainer Stengele
@ 2009-03-26 16:11       ` Carsten Dominik
  0 siblings, 0 replies; 5+ messages in thread
From: Carsten Dominik @ 2009-03-26 16:11 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: emacs-orgmode

org-timer.el

- Carsten

On Mar 26, 2009, at 5:01 PM, Rainer Stengele wrote:

> Carsten,
>
> I tried to find the function where one can take notes with a  
> relative timer with
> M-<RET>. I gave up ...
> I would like to try to add the functionality of adding an item with  
> an inactive
> timestamp with M-<RET> (add the item with timestamp if a timestamp  
> occurs in the
> previous item).
> Where can I start to search?
>
> Rainer
>
>
> Rainer Stengele schrieb:
>> Carsten Dominik schrieb:
>>> On Mar 25, 2009, at 2:30 PM, Rainer Stengele wrote:
>>>
>>>> Hi all,
>>>>
>>>> I want to write a function to create a new item in an item list and
>>>> immediately
>>>> insert an inactive timestamp. How could I possibly do this?
>>>> I can write a keyboard macro, yes.
>>>> But can somebody show me how to write a function which I can
>>>> global-set-key to?
>>>>
>>>>
>>>> Must be something like
>>>> ...
>>>> (org-meta-return)
>>>> (org-time-stamp-inactive t)
>>>> ...
>>>>
>>>>
>>>> Problem is I then get asked to confirm the current timestamp. In  
>>>> this
>>>> case I
>>>> always want to use the current timestamp without being asked.
>>>>
>>> (defun xxx ()
>>>  (interactive)
>>>  (org-insert-item)
>>>  (org-insert-time-stamp (current-time) 'with-hm 'inactive))
>>>
>>> This assumes that you are in a plain list already.  Funnily
>>> enough, there is no command to insert an item at any location,  
>>> except
>>> pressing
>>>
>>>  - SPC
>>>
>>> of course :-)
>>>
>>> So you could do
>>>
>>>
>>> (defun xxx ()
>>>  (interactive)
>>>  (if (not (org-in-item-p))
>>>      (insert "- ")
>>>    (org-insert-item))
>>>  (org-insert-time-stamp (current-time) 'with-hm 'inactive))
>>>
>>>
>>>
>>> HTH
>>>
>>> - Carsten
>>>
>>>
>>> - Carsten
>>>
>>
>>
>>
>> Hi Carsten,
>>
>> thanks a lot!
>> Why didn't I find that myself?
>> I simply tried C-h k C-c ! and found (org-time-stamp-inactive  
>> &optional arg).
>> If I only had found a hint to
>>  (org-insert-time-stamp time &optional with-hm inactive pre post  
>> extra)
>> ...
>>
>>
>> Thanks again!
>>
>> Rainer
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Remember: 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] 5+ messages in thread

end of thread, other threads:[~2009-03-26 16:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-25 13:30 add a list item and automatically insert an incative timestamp without being asked to confirm "now" Rainer Stengele
2009-03-26 10:40 ` Carsten Dominik
2009-03-26 15:18   ` Rainer Stengele
2009-03-26 16:01     ` Rainer Stengele
2009-03-26 16:11       ` Carsten Dominik

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