From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Sauer Subject: Re: create new files from capture Date: Mon, 4 Apr 2011 14:49:27 -0500 Message-ID: References: <1696133DB0E548409327158967872500@gmail.com> <87pqp1q18t.wl%dmaus@ictsoc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=58987 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6pmE-0005Sa-3b for emacs-orgmode@gnu.org; Mon, 04 Apr 2011 15:49:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q6pmC-0000It-NQ for emacs-orgmode@gnu.org; Mon, 04 Apr 2011 15:49:29 -0400 Received: from mail-ww0-f41.google.com ([74.125.82.41]:45121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q6pmC-0000Hx-J4 for emacs-orgmode@gnu.org; Mon, 04 Apr 2011 15:49:28 -0400 Received: by wwi18 with SMTP id 18so1956146wwi.0 for ; Mon, 04 Apr 2011 12:49:27 -0700 (PDT) In-Reply-To: <87pqp1q18t.wl%dmaus@ictsoc.de> 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: David Maus Cc: emacs-orgmode@gnu.org, Buck Brody Could one not have it go into a temporary file and then have an exit hook attatched to a particular template that if a particular property had been filled in that it would create a new file with that name and either refile to or cut to and then paste from the kill ring? Matthew obviously would require some modification/hacking On Mon, Apr 4, 2011 at 2:12 PM, David Maus wrote: > At Fri, 1 Apr 2011 13:43:06 -0400, > Buck Brody wrote: >> Is there a way to use capture to create new files? =A0Can I fill out >> the name of the file, and add a date stamp, from within the capture >> template? > > Prompting in the templates happens after the template is placed in the > target buffer. =A0So AFAIK there is no way to achive this without a > little bit hacking: You could specify a target function > > target =A0 =A0 =A0 Specification of where the captured item should be pla= ced. > =A0 =A0 =A0 =A0 =A0 =A0 In Org-mode files, targets usually define a node.= =A0Entries will > =A0 =A0 =A0 =A0 =A0 =A0 become children of this node, other types will be= added to the > =A0 =A0 =A0 =A0 =A0 =A0 table or list in the body of this node. > > =A0 =A0 =A0 =A0 =A0 =A0 Most target specifications contain a file name. = =A0If that file > =A0 =A0 =A0 =A0 =A0 =A0 name is the empty string, it defaults to `org-def= ault-notes-file'. > =A0 =A0 =A0 =A0 =A0 =A0 A file can also be given as a variable, function,= or Emacs Lisp > =A0 =A0 =A0 =A0 =A0 =A0 form. > > =A0 =A0 =A0 =A0 =A0 =A0 ... > > =A0 =A0 =A0 =A0 =A0 =A0 (function function-finding-location) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Most general way, write your own function = to find both > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0file and location > > That could read the target file name with a prompt. > >> I also considered creating a new headline and then exporting the >> subtree. =A0The problem is that I need to have the title of the new >> file automatically created based upon the headline, and I can't >> figure out how to do this. > > Same here. The function `org-heading-components' (C-h f > org-heading-components RET) will get you the title of the headline > which you would have to transform to a valid file name > (i.e. `replace-regexp-in-string'). > > Best, > =A0-- David > -- > OpenPGP... 0x99ADB83B5A4478E6 > Jabber.... dmjena@jabber.org > Email..... dmaus@ictsoc.de >