From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: using links/org-capture programmatically Date: Tue, 26 Jul 2011 21:02:48 +0200 Message-ID: <4E2F0F58.3030007@christianmoe.com> References: <877h74x5ry.fsf@ericabrahamsen.net> Reply-To: mail@christianmoe.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:46488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qlmqc-0001mp-EG for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 14:59:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qlmqa-0000r9-Hy for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 14:59:18 -0400 Received: from mars.hitrost.net ([91.185.211.18]:38005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qlmqa-0000qv-CU for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 14:59:16 -0400 In-Reply-To: <877h74x5ry.fsf@ericabrahamsen.net> 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: Eric Abrahamsen Cc: emacs-orgmode@gnu.org On 7/26/11 8:20 PM, Eric Abrahamsen wrote: > I've got a little sequence I use so often I'd like to automate it, but > am not sure how. Basically it goes: > > 1. In Gnus, store a link to an email message > 2. Call org-capture > 3. Choose a template with a REPLY keyword, that gets stored in a certain subtree > 4. Pull the last-stored link, to the email message, into the REPLY heading > 5. Complete and restore what I had before > > If I want to write a single keystroke that does this, how do I insert > the last stored link into the text of the capture template in an elisp > function? Or should I not be using org-capture in a function to begin > with? Can't you just call org-capture from the message and have a link added automatically with %a in the template? See [[info:org#Template%20expansion]]. (Caveat: Not tested, I'm not on Gnus.) Yours, Christian