What has happened to org-roam completion frameworks in v.2

In org-roam version 1 I was able to invoke ivy as my completion framework with:
(setq org-roam-completion-system 'ivy)
In version 2, this no longer seems to work.

the completion has been rewritten, just set:

(setq org-roam-completion-everywhere t)

see more here in the documentation

Thank you. I am away from my main computer at present. Would I need to add that line to the one I provided, or use it as a replacement? If so, how would one specify a specific framework? The documentation does not specify that.

Try replacing it and see what happens.

Okay. It seems that they have now introduced their own completion framework. My ivy does not work any more.

@revrari

How about trying this?

(defun my/org-roam-node-find ()
  (interactive)
  (unwind-protect
;; unwind-protect is required to turn off ivy
;; even when you cancel without choosing a node
      (progn
       (ivy-mode +1)
       (org-roam-node-find))  
    (ivy-mode -1)))

These are two different “completions”.

  1. org-roam-completion-system
  2. org-roam-completion-everywhere

Item 1 is for the minibuffer completion: link to v1 manual from January
Item 2 is for completion at point: link to v1 manual from January

I think Item 1 is no longer available in V2, but Item 2 is as @WalterJ mentions.


Also… This is not quite the case.

Org-roam now uses the stock completing-read. You can inspect how it is done by looking at the source of function org-roam-node-read.

This should not interfere with the completion framework you have chosen to use (Ivy, Helm, Selectrum, etc.).

1 Like

Thank you. Unfortunately that function did not work for me. It did not turn on ivy-mode with org-roam commands. If I simply add (ivy-mode) to my dot emacs then it is activated globally including with org-roam. However, in the past, I was able to specify its use with org-roam. I do not want to globally enable ivy-mode in Emacs.

This function then quickly turns it off after you selecting a node or cancel the completion process, so it should not affect anything else…

But yes, it’s not a set-and-forget function; it’s a replacement. You need to use the custom one instead of the standard one.

The Org-roam feature you refer to does not exist with V2 any longer.

I am only using the custom one. But it does not turn ivy mode on.

Then I think you might need to turn off the completion mode that you have (helm?) in the code before Ivy is turned on, and then turn it back on after Ivy is turned off again. It should be fairly straight forward change to the code. I tested it without having any completion turned on and worked.

I have no completion framework other than the default vanilla Emacs installed.

Very strange then… I assume you have ivy installed. It worked on my PC; can’t think of a reason why it doesn’t work for you. Emacs 27.2.

I will test it out with a minimal install and revert back. Thanks so much.

I have managed to get the function to work, which is just great. I am almost there. However, I would still need to be able to have the same happen for org-roam-node-insert. I tried an equivalent function for that command but it does not work.

I just tested it for org-roam-node-insert. Works on my end.
What did you do differently to get the other one to work?

@nobiot I finally got it to work thanks to you. I am truly overjoyed. I must confess that I had forgotten to update the binding to accord with the function. So, this is a case of human error coupled with the (false) expectation that org-roam 2 would behave in the same way it did in org-roam 1. I made other changes to my system, but those had nothing to do with the problem.

1 Like

No worries. Good to know the idea and functions worked for you

1 Like