Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant get company-dabbrv mode to work #630

Closed
zeltak opened this issue Jan 11, 2017 · 9 comments
Closed

Cant get company-dabbrv mode to work #630

zeltak opened this issue Jan 11, 2017 · 9 comments

Comments

@zeltak
Copy link

zeltak commented Jan 11, 2017

Hi ,
I think ive setup company mode correctly yet i cant get company-dabbrv to work as default. i can launch it manually with company-dabbrv yet it wont auto suggest completions in a buffer.

this is the output of company-diag

Emacs 25.1.1 (x86_64-unknown-linux-gnu) of 2016-12-17 on foutrelis
Company 0.9.2

company-backends: (company-abbrev company-ispell company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-files
        (company-dabbrev-code company-gtags company-etags company-keywords)
        company-oddmuse company-dabbrev)

Used backend: company-abbrev
Prefix: ""
Completions:
  "wokr"
  "willbe"
  "vulnerible"
  "tkaes"
  "tjhe"
  "specifc"
  "similiar"
  "sepcific"
  "relize"
  "propertiers"
  "proffesors
   ... (this goes on...) 

so it seems to me dabbrv mode is loaded.

this is my config

  (use-package company 
   :ensure t
   :config
  (add-hook 'after-init-hook 'global-company-mode)

  (setq company-idle-delay 0)
  (setq company-minimum-prefix-length 2) 


 (defun my-org-mode-hook ()
  (set (make-local-variable 'company-backends)
       '((company-capf company-files company-dabbrv))))


   (add-hook 'org-mode-hook #'my-org-mode-hook)
   )

any ideas on how do debug thus?

@dgutov
Copy link
Member

dgutov commented Jan 11, 2017

company-dabbrv

There is a typo in the name.

@zeltak
Copy link
Author

zeltak commented Jan 11, 2017

thx @dgutov

i fixed the typo but still the same issue, here is the current setup

  (use-package company 
   :ensure t
   :config
  (add-hook 'after-init-hook 'global-company-mode)

  (setq company-idle-delay 0)
  (setq company-minimum-prefix-length 2) 
    
;(add-to-list 'company-backends 'company-ispell)
;(add-to-list 'company-backends 'company-dabbrev)
;(add-to-list 'company-backends 'company-abbrev)

;(add-hook 'org-mode
;  (lambda ()
;    (setq company-backends '(company-dabbrev-code))))

)
#+END_SRC

#+BEGIN_SRC emacs-lisp  :results none
 (defun my-org-mode-hook ()
      (set (make-local-variable 'company-backends)
           '((company-capf company-files company-dabbrev))))


(add-hook 'org-mode-hook #'my-org-mode-hook)


@dgutov
Copy link
Member

dgutov commented Jan 11, 2017

Seems to work okay here.

Could you show a full, step-by-step scenario, how to reproduce the problem? Preferably starting with emacs -Q -L .../company.

@zeltak
Copy link
Author

zeltak commented Jan 13, 2017

hi @dgutov
thx for the help. i did what i think you requested yet i think i didnt follow you all the way through since when i load company.el i get this error:

load-library: Cannot open load file: Is a directory, ~/.emacs.d/elpa/company-20170109.333/
Making completion list...
Loading /home/zeltak/.emacs.d/elpa/company-20170109.333/company.el (source)...done
Company backend ’company-bbdb’ could not be initialized:
Symbol’s function definition is void: company-bbdb
Company backend ’company-nxml’ could not be initialized:
Symbol’s function definition is void: company-nxml
Company backend ’company-css’ could not be initialized:
Symbol’s function definition is void: company-css
Company backend ’company-eclim’ could not be initialized:
Symbol’s function definition is void: company-eclim
Company backend ’company-semantic’ could not be initialized:
Symbol’s function definition is void: company-semantic
Company backend ’company-clang’ could not be initialized:
Symbol’s function definition is void: company-clang
Company backend ’company-xcode’ could not be initialized:
Symbol’s function definition is void: company-xcode
Company backend ’company-cmake’ could not be initialized:
Symbol’s function definition is void: company-cmake
Company backend ’company-capf’ could not be initialized:
Symbol’s function definition is void: company-capf
Company backend ’company-files’ could not be initialized:
Symbol’s function definition is void: company-files
Company backend ’company-dabbrev-code’ could not be initialized:
Symbol’s function definition is void: company-dabbrev-code
Company backend ’company-gtags’ could not be initialized:
Symbol’s function definition is void: company-gtags
Company backend ’company-etags’ could not be initialized:
Symbol’s function definition is void: company-etags
Company backend ’company-keywords’ could not be initialized:
Symbol’s function definition is void: company-keywords
Company backend ’company-oddmuse’ could not be initialized:
Symbol’s function definition is void: company-oddmuse
Company backend ’company-dabbrev’ could not be initialized:
Symbol’s function definition is void: company-dabbrev

do i need to manually load additional libraries other than company.el with load-library?

thx

Z

@dgutov
Copy link
Member

dgutov commented Jan 13, 2017

do i need to manually load additional libraries other than company.el with load-library?

You need to add its directory to load-path first. That's what the -L argument I suggested above is supposed to do.

@zeltak
Copy link
Author

zeltak commented Jan 13, 2017

thx again! appreciate your help!

ok so yes now i can load company and issue company-mode and i get no error and it seems to work.

is the next step binary partitioning? or is there another thing to investigate before hand?

@zeltak
Copy link
Author

zeltak commented Jan 13, 2017

Hi again

OK after bisecting my config i think its the worf packaged thats causing the issue

ive opened an issue here

abo-abo/worf#28

and will report back with an answer hopefully soon

@dgutov
Copy link
Member

dgutov commented Jan 13, 2017

is the next step binary partitioning?

That's how we usually do it, yes.

ive opened an issue here

Thanks!

@zeltak
Copy link
Author

zeltak commented Jan 19, 2017

Hi. it turns out worf needs to be loaded after company for some reason (See abo-abo/worf#28)

closing this

thx

Z

@zeltak zeltak closed this as completed Jan 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants