org-roam / company-org-roam

Company completion backend for Org-roam
GNU General Public License v3.0
57 stars 4 forks source link

company-org-roam break completion of In-Buffer Settings (after #+) #11

Closed zoechi closed 4 years ago

zoechi commented 4 years ago

After I enabled company-org-roam, completion of In-Buffer Settings ( #+DESCRIPTION, #+BEGIN_..., ...) does not work anymore.

When I remove these lines I get the suggestions again.

(use-package
  company-org-roam
  :ensure t
  :after org-roam
  :config (push 'company-org-roam company-backends))

Otherwise company-org-roam works great to insert links.

GNU Emacs 28.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, cairo version 1.16.0) of 2020-04-27

company-org-roam: 20200409.529 org: 9.3.6 org-roam: 20200504.2031

jethrokuan commented 4 years ago

You'll need to configure the company-backends. The settings you provided will show you only org-roam completions if they exist. If they don't, they'll show completions from elsewhere.

zoechi commented 4 years ago

Much harder to find than one might expect from your comment :D https://emacs.stackexchange.com/a/30691/26301 did it for me. Thanks!

update Actually this simpler solution worked for me (Emacs 28.x.x)

(use-package
  company
...
  :hook                                 ;
  ((emacs-lisp-mode . (lambda ()
                        (add-to-list (make-local-variable 'company-backends) 'company-elisp)))
   (org-mode . (lambda ()
                 (add-to-list (make-local-variable 'company-backends)
                              '(company-capf company-org-roam)))))