Hi all. I’m having trouble having any sort of completion working at all.
As far as I understood, I should be able to at least use M-x completion-at-point to manually trigger a completion, but this is not working for me. So the C-M-i keybinding does nothing for me.
I also tried calling that function inside double brackets [[someth|]], and it does not work either.
Company itself does give me completions for normal words.
My guess is company-dabbrev is called before Org-roam is, and Company does not call capf for Org-roam. If this is the case, I don’t know if Company can support two backends run consecutively (I don’t even know if that produces one big list in a pop-up or two separate ones). My guess, in this case, would be you would need to turn off company-dabbrev.
Hang on!
I think I get the problem. I wasn’t editing a file in side the roam directory. I thought it would also work if I link into the roam directory.
Now both org-roam-complete-link-at-point and org-roam-complete-everywhere work as expected.
Only one backend is used at a time. The choice depends on the order of
the items in this list, and on the values they return in response to the
‘prefix’ command (see below). But a backend can also be a “grouped”
one (see below).
So I guess it is because the order.
I said last night that it didn’t work for me because I wasn’t editing a file inside the roam folder. It turns out it wasn’t quite right. I noticed that I have to open a roam file using the C-c n f (org-roam-node-find) function for the completions to work. If I open the very same file, for instance, from the command line (emacs ./org/roam/somefile.org), or using emacs find-file, no roam completions work.
I think :bind in use-package deferrs loading of Org-roam (see this part in the Use-package README).
defers loading of ace-jump-mode until you actually use it
So when you launch Emacs “from the command line (emacs ./org/roam/somefile.org)”, org-roam has not been loaded yet. Try it yourself again. You would still see some commands in M-x because you would have autoloaded them, but you should see a limited number of these compared to when you have loaded the library.
In the case of find-file, the behaviour should also depend on whether or org-roam has already been loaded or not. My guess is that when you tested find-file, it was probably right after you launched Emacs, thus org-roam had not been loaded.
In general, once org-roam has been loaded, there should be no differecet between find-file and org-roam-node-find for the behaviour of Company.