From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Spiers Subject: Re: inserting files within remember templates Date: Sun, 9 Dec 2007 12:19:40 +0000 Message-ID: <20071209121940.GE15129@atlantic.linksys.moosehall> References: <20071105181739.GB13544@atlantic.linksys.moosehall> <8A730AEC-45F4-4A2F-BD38-24DEBF937445@science.uva.nl> <20071106163647.GC13544@atlantic.linksys.moosehall> <20071106223950.GA6033@atlantic.linksys.moosehall> <31C9500E-1350-48A8-9738-5C7EFC072AB0@science.uva.nl> <20071124145227.GB30662@atlantic.linksys.moosehall> Reply-To: Adam Spiers Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J1L8L-00016l-TU for emacs-orgmode@gnu.org; Sun, 09 Dec 2007 07:19:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J1L8L-000163-3o for emacs-orgmode@gnu.org; Sun, 09 Dec 2007 07:19:45 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1L8K-00015f-UZ for emacs-orgmode@gnu.org; Sun, 09 Dec 2007 07:19:44 -0500 Received: from mail.beimborn.com ([70.84.38.100]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J1L8K-0006Ia-FL for emacs-orgmode@gnu.org; Sun, 09 Dec 2007 07:19:44 -0500 Received: from mail.beimborn.com (localhost.localdomain [127.0.0.1]) by mail.beimborn.com (8.12.11.20060308/8.12.8) with ESMTP id lB9CJhKr016910 for ; Sun, 9 Dec 2007 06:19:43 -0600 Received: from localhost (localhost [[UNIX: localhost]]) by mail.beimborn.com (8.12.11.20060308/8.12.11/Submit) id lB9CJggG016900 for emacs-orgmode@gnu.org; Sun, 9 Dec 2007 12:19:42 GMT Content-Disposition: inline In-Reply-To: <20071124145227.GB30662@atlantic.linksys.moosehall> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On Sat, Nov 24, 2007 at 02:52:27PM +0000, Adam Spiers wrote: > On Wed, Nov 07, 2007 at 09:42:55AM +0100, Carsten Dominik wrote: > > On 6 Nov 2007, at 11:39 PM, Adam Spiers wrote: > > > On Tue, Nov 06, 2007 at 04:36:47PM +0000, Adam Spiers wrote: > > > > This could easily be accomplished if remember templates allowed > > > > syntax such as > > > > > > > > ,------ > > > > | * %T > > > > | %(shell-command-to-string "grep 'last full' /proc/acpi/battery/BAT0/info") > > > > `------ > > > > > > OK, it turns out that this was easy to implement, and I think the > > > patch is small enough that it could be accepted even though I haven't > > > got around to sending back the copyright assignment form yet (sorry - > > > this *will* happen at some point!) > > > > I'll take this patch, thanks. [snipped] > Here's a better version. Differences: [snipped] > - Patches texinfo file. [snipped] > diff -r 09b1470ac170 org.texi > --- a/org.texi Wed Oct 31 09:46:35 2007 +0000 > +++ b/org.texi Sat Nov 24 14:39:51 2007 +0000 > @@ -4378,6 +4378,8 @@ insertion of content: > %^g @r{prompt for tags, with completion on tags in target file.} > %^G @r{prompt for tags, with completion all tags in all agenda files.} > %:keyword @r{specific information for certain link types, see below} > +%[pathname] @r{insert the contents of the file given by @code{pathname}} > +%(sexp) @r{evaluate elisp @code{(sexp)} and replace with the result} > @end example > > @noindent I just noticed that we both forgot to patch the defcustom with some of the recent changes! This should fix it: diff -r 742454cf3979 org.el --- a/org.el Wed Dec 05 09:48:23 2007 +0000 +++ b/org.el Sun Dec 09 12:18:26 2007 +0000 @@ -1436,7 +1436,7 @@ a first line starting with a star, to ac a first line starting with a star, to act as the org-mode headline. Furthermore, the following %-escapes will be replaced with content: - %^{prompt} prompt the user for a string and replace this sequence with it. + %^{prompt} prompt the user for a string and replace this sequence with it %t time stamp, date only %T time stamp with date and time %u, %U like the above, but inactive time stamps @@ -1447,6 +1447,12 @@ Furthermore, the following %-escapes wil %i initial content, the region when remember is called with C-u. If %i is indented, the entire inserted text will be indented as well. + %c content of the clipboard, or current kill ring head + %^g prompt for tags, with completion on tags in target file + %^G prompt for tags, with completion all tags in all agenda files + %:keyword specific information for certain link types, see below + %[pathname] insert the contents of the file given by `pathname' + %(sexp) evaluate elisp `(sexp)' and replace with the result %? After completing the template, position cursor here.