From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Neff Subject: Re: Templates for cloning Date: Sun, 5 Aug 2012 20:35:04 -0500 Message-ID: References: <87vch0xua8.fsf@altern.org> <20120804024048.GQ21653@muh> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SyCDr-0000lo-Rm for emacs-orgmode@gnu.org; Sun, 05 Aug 2012 21:35:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SyCDq-00074B-Hb for emacs-orgmode@gnu.org; Sun, 05 Aug 2012 21:35:07 -0400 In-Reply-To: <20120804024048.GQ21653@muh> 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: Sebastian Fischmeister Cc: Bastien , emacs-orgmode On Fri, Aug 3, 2012 at 9:40 PM, Sebastian Fischmeister wrote: > 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 > Sebastian, thanks for your suggestion, but I'm having trouble understanding how your solution works, and I don't know what you mean by "If you just swap the sequence of the buffer evaluation". I only glanced at your suggestion and will review it later (hopefully). If you can point me to more documentation about what's going on in your solution, or perhaps enlighten me a bit more, I would appreciate it! Thanks, --Nate