[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] create new files from capture
From: |
Matthew Sauer |
Subject: |
Re: [O] create new files from capture |
Date: |
Mon, 4 Apr 2011 14:49:27 -0500 |
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 <address@hidden> wrote:
> 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.... address@hidden
> Email..... address@hidden
>