From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: add a list item and automatically insert an incative timestamp without being asked to confirm "now" Date: Thu, 26 Mar 2009 17:11:34 +0100 Message-ID: References: <49CB9CA9.2040207@diplan.de> <49CBA6F1.7080208@diplan.de> Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LmsBD-0001rE-1v for emacs-orgmode@gnu.org; Thu, 26 Mar 2009 12:11:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LmsB8-0001ou-32 for emacs-orgmode@gnu.org; Thu, 26 Mar 2009 12:11:42 -0400 Received: from [199.232.76.173] (port=36253 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LmsB7-0001ok-Nj for emacs-orgmode@gnu.org; Thu, 26 Mar 2009 12:11:37 -0400 Received: from ey-out-1920.google.com ([74.125.78.146]:53186) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LmsB7-0001Gc-Ax for emacs-orgmode@gnu.org; Thu, 26 Mar 2009 12:11:37 -0400 Received: by ey-out-1920.google.com with SMTP id 13so130046eye.24 for ; Thu, 26 Mar 2009 09:11:36 -0700 (PDT) In-Reply-To: <49CBA6F1.7080208@diplan.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rainer Stengele Cc: emacs-orgmode@gnu.org 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-. I gave up ... > I would like to try to add the functionality of adding an item with > an inactive > timestamp with M- (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 >> >