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
_______________________________________________
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