Emacs org mode 9.x refile not working with ido

Viewed 241

Since I upgraded orgmode to 9.x, refile is no longer working with ido. According to http://orgmode.org/Changes.html, all options related to ido and iswitchb have been removed. It also mentions "Instead Org uses regular functions, e.g., completion-read so as to let those libraries operate."

However, being a recent vim-user-turned-emacs, I can't find how to setup ido (including ido-vertical) to work in orgmode 9.x the way it used to work in 8.x Any suggestion welcome.

Thanks in advance.

Cheers /jerome

1 Answers

I think the only way to do this is to re-define or wrap the stock emacs completion functions. ido-completing-read+ is a package that wraps the stock completion functions to use ido wherever possible (including in org-refile), and you can configure exceptions.

That package is a bit aggressive in that it tries to enable IDO everywhere. If you don't want that, you can set the completing read function to IDO's completing read function in org mode only by adding a function to the org mode hook:

(defun bl/completion-use-ido ()
  "Set the current buffer's completing read engine to IDO."
  (setq-local completing-read-function #'ido-completing-read))

(add-hook 'org-mode-hook 'bl/completion-use-ido)

That will enable IDO completion for only org-mode buffers.

Related