org-mode - no refile targets
Asked Answered
A

2

8

I am trying to use the refile function but don't understand why I get the error no refile targets after hitting the Cc Cw key.

Here is the content of org-refile-targets variable :

Its value is (("~/gtd/gtd.org" :maxlevel . 3) ("~/gtd/someday.org" :level . 1) ("~/gtd/tickler.org" :maxlevel . 2))

Original value was nil and defined through this function in .emacs

(setq org-refile-targets '(("~/gtd/gtd.org" :maxlevel . 3) ("~/gtd/someday.org" :level . 1) ("~/gtd/tickler.org" :maxlevel . 2)))

All those files exist in the gtd folder. I can capture elements that I are stored into the ~/gtd/inbox.org file.

I am relatively new to the emacs/org-mode world, the error might be quite stupid.

Argyll answered 15/3, 2019 at 11:18 Comment(5)
Anyone has an idea :)?Argyll
maybe try to replace ~ with full path /home/.../gtd.orgFootgear
Thanks. I tried this but it didn't change the message ...Argyll
thanks for the feedback. I have no other idea.Footgear
pinecamp suggestion solved it. org-refile-targets creates a list of the defined levels. The list was empty ...Argyll
S
11

It seems like you're following along with Nicolas Petton's Orgmode for GTD article; I ran into the same issue this morning.

org-refile searches for headings within the files in org-refile-targets, up to the level specified. So in your example, org-refile will find headings up to level 3 in ~/gtd/gtd.org, level 2 in ~/gtd/tickler.org, and only level 1 in ~/gtd/someday.org. These will then be offered as targets for your refile operation.

To fix this error, simply create some headings in one or more of those files.

Saldivar answered 20/3, 2019 at 14:11 Comment(2)
Perfect that fixed it! Didn't understand that it made a list of all possible targets.Argyll
No worries, glad I could help!Saldivar
J
0

I had a similar problem which I managed to solve after reading this, so I thought I'd add that solution as well in case it helps others.

I'm currently, through no fault of my own, using Windows. Therefore, I had my paths in my org-refile-targets set up like this:

"C:\Path\to\orgfile.org"

I wasn't thinking properly - those backslashes are interpreted. So the solution was to switch from backslashes to slashes (which works in Emacs even in Windows):

"C:/Path/to/orgfile.org"

I'm guessing that double backslashes would also have worked.

Jerkin answered 4/2, 2021 at 10:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.