From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: create new files from capture Date: Mon, 04 Apr 2011 21:12:50 +0200 Message-ID: <87pqp1q18t.wl%dmaus@ictsoc.de> References: <1696133DB0E548409327158967872500@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Mon_Apr__4_21:12:50_2011-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=41000 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6pCs-0002GN-91 for emacs-orgmode@gnu.org; Mon, 04 Apr 2011 15:12:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q6pCr-00069q-0h for emacs-orgmode@gnu.org; Mon, 04 Apr 2011 15:12:58 -0400 Received: from mail.xlhost.de ([213.202.242.118]:49653 helo=mysql1.xlhost.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q6pCq-00068p-Rj for emacs-orgmode@gnu.org; Mon, 04 Apr 2011 15:12:56 -0400 In-Reply-To: <1696133DB0E548409327158967872500@gmail.com> 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: Buck Brody Cc: emacs-orgmode@gnu.org --pgp-sign-Multipart_Mon_Apr__4_21:12:50_2011-1 Content-Type: text/plain; charset=US-ASCII At Fri, 1 Apr 2011 13:43:06 -0400, Buck Brody wrote: > Is there a way to use capture to create new files? Can 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. So AFAIK there is no way to achive this without a little bit hacking: You could specify a target function target Specification of where the captured item should be placed. In Org-mode files, targets usually define a node. Entries will become children of this node, other types will be added to the table or list in the body of this node. Most target specifications contain a file name. If that file name is the empty string, it defaults to `org-default-notes-file'. A file can also be given as a variable, function, or Emacs Lisp form. ... (function function-finding-location) Most general way, write your own function to find both file and location That could read the target file name with a prompt. > I also considered creating a new headline and then exporting the > subtree. The 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, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --pgp-sign-Multipart_Mon_Apr__4_21:12:50_2011-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iF4EAREIAAYFAk2aGDIACgkQma24O1pEeOb10gEAszShDf7bZSCtcxrOBSMUWEDR Ppu7wQoCZvxAMGD1VuUA/R9jJ2Xg7wTumIkh6CYcRYBKFUAfSXJtJrMjkfy9ANQH =0b3i -----END PGP SIGNATURE----- --pgp-sign-Multipart_Mon_Apr__4_21:12:50_2011-1--