From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Fischmeister Subject: Re: Templates for cloning Date: Fri, 3 Aug 2012 22:40:48 -0400 Message-ID: <20120804024048.GQ21653@muh> References: <87vch0xua8.fsf@altern.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxUIt-0007w8-50 for emacs-orgmode@gnu.org; Fri, 03 Aug 2012 22:41:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SxUIs-0008Kt-7b for emacs-orgmode@gnu.org; Fri, 03 Aug 2012 22:41:23 -0400 Content-Disposition: inline In-Reply-To: <87vch0xua8.fsf@altern.org> 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: Bastien Cc: emacs-orgmode As an idea, this is how I use templates: %+begin_src (defun org-p (key) (let ((val (read-from-minibuffer (concat "Define " key ": ")))) (plist-put org-store-link-plist (intern (concat ":" key)) val)) "" ) (defmacro org-g (key) (or (plist-get org-store-link-plist (intern (concat ":" key))) (concat "MISSING-KEY-" key))) (setq org-capture-templates (quote (("p4" "Template: Bla" plain (file+headline "~/.org/todo.org" "Projects") (file "~/.org/templates/bla.tmpl"))))) %+end_src %+begin_src yasnippet %(org-p "var1") %(org-p "var2") ** Now copy here %(org-g "var1") ** And here %(org-g "var1") SCHEDULED: %^t %+end_src If you just swap the sequence of the buffer evaluation in org-capture-fill-template, then you would even have a nicer version of this. See this previous post for details: http://comments.gmane.org/gmane.emacs.orgmode/57248 Sebastian On 08/03/12 09:25am, Bastien wrote: > Hi Nathan, > > Nathan Neff writes: > > > Is there a way to create a template structure for cloning? > > This is something I've wanted for long, and I hope I'll find the time > to implement it after 7.9. > > More precisely, I want something that captures the structure of the > subtree at point (with all elements), then let's you convert this > structure into a template for later interactive insertion. > > > Does anyone know of a way to do this? > > I guess yasnippet can help to produce something close to what you want > for now. > > Best,