From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: using links/org-capture programmatically Date: Tue, 26 Jul 2011 18:53:41 -0700 Message-ID: <87y5zkv68q.fsf@ericabrahamsen.net> References: <877h74x5ry.fsf@ericabrahamsen.net> <4E2F0F58.3030007@christianmoe.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QltJx-00048M-95 for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 21:54:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QltJw-0001Sj-8U for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 21:54:01 -0400 Received: from lo.gmane.org ([80.91.229.12]:46142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QltJv-0001Rz-Sc for emacs-orgmode@gnu.org; Tue, 26 Jul 2011 21:54:00 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QltJr-0003Pk-3f for emacs-orgmode@gnu.org; Wed, 27 Jul 2011 03:53:55 +0200 Received: from 63.226.249.211 ([63.226.249.211]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Jul 2011 03:53:55 +0200 Received: from eric by 63.226.249.211 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Jul 2011 03:53:55 +0200 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 On Tue, Jul 26 2011, Christian Moe wrote: > 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.) Oh, ha! Don't know how I missed that, but you're quite right. It's still several keypresses, but not so many that it breaks the zone. If I need something more complex, I'll try Seb's solution. Thanks to you both! Eric