From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Colin Fraizer" Subject: Capture feature suggestion: place the mark from a template Date: Tue, 24 Apr 2012 06:46:20 -0400 Message-ID: <00da01cd2207$7cfe04b0$76fa0e10$@cfraizer.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMdGV-0004jo-VT for emacs-orgmode@gnu.org; Tue, 24 Apr 2012 06:46:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SMdGO-0001aq-TX for emacs-orgmode@gnu.org; Tue, 24 Apr 2012 06:46:35 -0400 Received: from caibbdcaaaaf.dreamhost.com ([208.113.200.5]:54817 helo=homiemail-a55.g.dreamhost.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMdGO-0001Zp-EL for emacs-orgmode@gnu.org; Tue, 24 Apr 2012 06:46:28 -0400 Received: from homiemail-a55.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a55.g.dreamhost.com (Postfix) with ESMTP id C69EA12C0DB for ; Tue, 24 Apr 2012 03:46:25 -0700 (PDT) Received: from colinfhp (wks201.inter-intelli.com [209.43.1.201]) (Authenticated sender: orgmode@cfraizer.com) by homiemail-a55.g.dreamhost.com (Postfix) with ESMTPA id 83E4712C0D7 for ; Tue, 24 Apr 2012 03:46:25 -0700 (PDT) Content-Language: en-us 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: emacs-orgmode@gnu.org 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?