I have a single file tasks.org
that contains all the tasks for agenda and I have separate projects files with a tasks related to specific project. I try to setup a configuration that will let me refile tasks from project files under the heading * Projects
in tasks.org
file and from the tasks.org
file back to specific project file under heading ** Tasks
.
I try to use :regexp
to narrow down refilling options to specific heading, but it doesn't work at all, it works only when I use :level
parameter - maybe there is a bug in "regexp" parameter implementation or I use it wrong way.
Global org-refile-targets
:
(setq org-refile-targets `(
(,my/project-1 :level . 1)
(,my/project-2 :regexp . "Projects$")))
The example project file:
# -*- mode: org -*-
# Local Variables:
# eval: (setq-local org-refile-targets `((,my/org-tasks-file-path :regexp . "Projects$")))
# End:
* Project 1
** Tasks
*** TODO bar
** Resources
Example tasks.org
file:
# -*- mode: org -*-
* Tasks
** TODO foo
* Projects
EDIT: I managed to succesfully refile task from tasks.org to project file. The problem was that there were different heading depths. The tasks.org have 2 levels and project file had 3. I changed project file to match number of heading levels with tasks file and now it works.
The project.org file look like this now:
# -*- mode: org -*-
* Project 1
** Tasks
*** TODO bar
** Resources
The only problem that left is to narrow down local refiling options for project file to just tasks.org * Projects
. Local Variables with eval doesn't work. When I eval (setq-local org-refile-targets
((,my/org-tasks-file-path :regexp . "Projects$")))` by hand it works though.
Any idea how can I set org-refile-targets
on file level?
Local Variables:
section has to be at the end of the file. That may have been the reason thateval:
did not work. – NickD Jul 30 '20 at 16:34