I'm just getting started with org-mode and imagine a workflow whereby I capture new tasks and notes in an org-mode "inbox" file. For tasks that grow into projects, I would imagine refiling them into a new org-mode file which is then added to my agenda.

The org-mode manual describes refiling a tree mostly the way I'm looking for, except that it only seems to allow refiling the section within the same file. What I'd like to do, is take that tree, and refile it into a new file (and then preferably add the file to the agenda list).

I can copy-paste into a new buffer, and then add the new buffer to the agenda, but it seems like this is the sort of thing that the org-mode gods would have a shortcut for.

link|improve this question
Why do you want to make a new file for every project? There are small projects and big ones, so you can have a projects.org file as a sort of incubation file which contains all projects initially and if a project grows so big that it deserves its own file then you can create it manually. – Tom Jan 1 at 20:33
Thanks, Tom. That's my thinking. Big things move to their own file when they get too big. I found a flag that lets me refile to another file in my agenda list, but only under an existing heading. I'm going to do a little more digging to see if I can simply add a tree to a new empty org file... – Peter Jan 1 at 21:17
@Peter you can refile any tree into another file. but first you need to add destination file to org-agenda-files – kindahero Jan 1 at 21:36
@kindahero: Is that a default option? I have a file "test1.org" with a tree that I want to move to an empty file "test2.org" that has been saved and added to the agenda with C-c [. The only refile targets that it gives me as completion options are from "test1.org." – Peter Jan 1 at 23:15
feedback

1 Answer

Too add other org-mode buffers to the refile list, you will need to add a line such as follows to your .emacs file. I took this from Brent Hansen's configuration (See here)

; Targets include this file and any file contributing to the agenda - up to 9 levels deep
(setq org-refile-targets (quote ((nil :maxlevel . 9)
                                 (org-agenda-files :maxlevel . 9))))

Only (org-agenda-files :maxlevel .9) is actually needed, the other part sets a maximum number of levels to refile to.

link|improve this answer
This lets me add a tree to an existing tree in a new file, but not to a blank, newly added file with no existing content. I think this may be as close as I get. – Peter Jan 3 at 20:37
You might also be able to add (setq org-refile-allow-creating-parent-nodes (quote confirm)) as referenced in the same code block from Bernt (see link above). It will allow you to add them as parent nodes, not just as subheadings. I'm not sure if you can add a new file on the go that way unfortunately. – Jonathan Leech-Pepin Jan 3 at 21:24
Even with that line, the files in the agenda don't show up as refile targets. It appears I can only refile to an existing header. – Peter Jan 4 at 17:10
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.