From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Capture feature suggestion: place the mark from a template Date: Tue, 24 Apr 2012 10:53:39 -0400 Message-ID: <12935.1335279219@alphaville> References: <00da01cd2207$7cfe04b0$76fa0e10$@cfraizer.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMh7o-00062T-0i for emacs-orgmode@gnu.org; Tue, 24 Apr 2012 10:54:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SMh7g-00063O-OE for emacs-orgmode@gnu.org; Tue, 24 Apr 2012 10:53:51 -0400 Received: from g1t0027.austin.hp.com ([15.216.28.34]:49047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMh7g-00063F-HP for emacs-orgmode@gnu.org; Tue, 24 Apr 2012 10:53:44 -0400 In-Reply-To: Message from "Colin Fraizer" of "Tue, 24 Apr 2012 06:46:20 EDT." <00da01cd2207$7cfe04b0$76fa0e10$@cfraizer.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Colin Fraizer Cc: emacs-orgmode@gnu.org Colin Fraizer wrote: > I use a capture template like this: > > ("t" "Todo" entry (file+headline "todo.org" "Tasks") > "* TODO %?\n :HIDDEN:\n %U\n :END:\n%!" :prepend t) > > to create todo items. I want the cursor to be at the end of the > headline so I can type that in, but then I want to be able to quickly > jump to the end so I can type any details that I want. > > I use "the mark" for that purpose, so I can type "C-x C-x" to jump > right where I want. So I modified the function > org-capture-place-entry to add the following lines: > > (goto-char beg) > (if (re-search-forward "%!" end t) > (progn > (push-mark nil t nil) > (replace-match ""))) > > just before the final (goto-char beg) that will put the cursor > position at "%?". > > (I guess I could have put that following ``(goto-char beg)'' inside > that ``(progn ...)''.) > > Would anyone else find this a useful addition to the capture template > mechanism? > Maybe - but in this particular case, you could just go to the end of the buffer with M-> (end-of-buffer), right? And there might be a problem with your proposal: if I push a bunch of marks during the capture, what happens after the capture is done? Are they still on the stack? If so, should they be? Nick