emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Rainer Stengele <rainer.stengele@diplan.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: add a list item and automatically insert an incative timestamp without being asked to confirm "now"
Date: Thu, 26 Mar 2009 11:40:45 +0100	[thread overview]
Message-ID: <FA4C1871-9857-4E06-8E34-3E0546A496C0@gmail.com> (raw)
In-Reply-To: <gqdbma$53a$1@ger.gmane.org>

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

   - SPC

of course :-)

So you could do

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


- 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

  reply	other threads:[~2009-03-26 10:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2009-03-26 15:18   ` Rainer Stengele
2009-03-26 16:01     ` Rainer Stengele
2009-03-26 16:11       ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FA4C1871-9857-4E06-8E34-3E0546A496C0@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rainer.stengele@diplan.de \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


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