I have set up several files for org refile as targets. I have defined their max levels.

However, it is often hard to define precisely the max level depth for a given file since the hierarchy of nodes may not be consistent among the various headings. When trying to file, thus, one sees the leaf nodes - the last level nodes found.

I understand that sometimes this is desirable, as these leaf nodes can become projects under which one may want to file.

However I find that most of the times I want to file under the parent level heading and not the leaf node, as the leaf nodes are individual tasks and not projects.

Thus, it would be awesome to be able to (spacemacs) press (, r) [keybindings not used] and refile would bring up helm mini buffer with leaf nodes stripped out. It would tremendously cut down on the clutter.

The (, R) could still remain to be mapped to the regular org-refile that shows leaf nodes.

I suppose the only way may be to write a custom function but I don't know elisp enough to be able to accomplish something like that.

Any ideas? Is there a variable one can set in config for org-refile to strip leaf nodes? If not, any pointers on what the custom function might look like?


Your Answer

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

Browse other questions tagged or ask your own question.