My ~/.emacs contains the following:

(setq org-refile-targets '((org-agenda-files :maxlevel . 3)))

The structure of the org file is:

* H1
** Same Name
* H2
** Same Name

Now, when I C-c C-w to refile, how do I select H1 -> Same Name or H2 -> Same Name as a target?


If you set org-refile-use-outline-path to t You will see the full ancestry of candidate headings when refiling- which should make it easy to distinguish between headings with a common name. Alternately you can specify 'file, 'full-file-path, or 'buffer-name.

The docstring for org-refile-use-outline-path:

Non-nil means provide refile targets as paths. So a level 3 headline will be available as level1/level2/level3.

When the value is ‘file’, also include the file name (without directory) into the path. In this case, you can also stop the completion after the file name, to get entries inserted as top level in the file.

When ‘full-file-path’, include the full file path.

When ‘buffer-name’, use the buffer name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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