2

I have several project directories with the same structure. As a result, I am often annoyed when I have to refile (C-c C-w) some sections because several buffers have the same names.

For instance, the list of targets Emacs shows me is something like:

workInProgess.org/Tasks
workInProgess.org/Tasks
...

How can I configure Emacs to disambiguate these refile targets name?

4

A first solution solution is to define

(setq org-refile-use-outline-path 'full-file-path)

you will get full file paths, however, this can be quite long:

/home/MyHome/...long_path_here.../MyProjectA/workInProgess.org/Tasks
/home/MyHome/...long_path_here.../MyProjectB/workInProgess.org/Tasks
...

and thus reduce readability.

A second solution, I prefer, is to use:

(setq org-refile-use-outline-path 'buffer-name)

in conjunction with the uniquify package.

Once configured with:

(require 'uniquify)
(setq uniquify-buffer-name-style 'post-forward-angle-brackets)

you will get (when refiling):

workInProgess.org<MyProjectA>/Tasks
workInProgess.org<MyProjectB>/Tasks
...

which it the best of two worlds: short but unambiguous refile targets.


Note: to make it works with helm (M-x helm-mode) you must let Org generates all of the possible completions and present them at once thanks to:

(setq org-outline-path-complete-in-steps nil)
| improve this answer | |

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.