Yasnippet changes possibly disallow completion popups
Closed this issue · 14 comments
It seems after the recent yasnippet
integration, company popups are disabled once I add the company-dict
backend. The popup dialog is created only on the <tab>
key. This is in spite of (setq company-dict-enable-yasnippet nil)
.
Odd, I can't reproduce this. With company-dict-enable-yasnippet
set to nil, company-dict should completely ignore the yasnippet bit.
I took a peek at your emacs.d and didn't see anything that would cause this. What version of Emacs are you running?
I'll do some more testing and see if anything turns up.
I am using both Emacs 25.1 and 24.5 on two different machines. I see that enabling company-dict
disables company
popup and I have to press <tab>
to start the completion (possibly via yasnippet
?). Just disabling company-dict
allows the popup to appear.
This could also be because of my yasnippet
setup. I will try and look into it more tomorrow.
I tried with emacs -Q
and I could reproduce it. Evaluating till my company
configuration shows the popup, evaluating company-dict
gives the following error:
Here is the error that I get:
Company: An error occurred in auto-begin
Company: backend company-dict error "Symbol's function definition is void: remove-if-not" with args (candidates com)
Do you need (require 'cl)
?
I digged a bit more, and I tried evaluating the following code.
(require 'package)
(setq package-user-dir (expand-file-name "~/.emacs.d/elpa/")
package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-when-compile
(require 'use-package))
(use-package company
:ensure t
:config
(setq company-global-modes t ; Turn on company-mode for all major modes
company-show-numbers t ; Quick-access numbers for the first ten candidates
company-minimum-prefix-length 3
company-tooltip-flip-when-above t ; Invert the navigation direction if the completion popup is displayed on top
company-tooltip-align-annotations t
company-tooltip-limit 20
company-selection-wrap-around t
company-dabbrev-downcase 'case-replace
company-dabbrev-ignore-case 'keep-prefix
company-dabbrev-code-ignore-case t
;; Offer completions in comments and strings
company-dabbrev-code-everywhere t)
(global-company-mode 1))
(defcustom dotemacs-temp-directory (concat user-emacs-directory "tmp/")
"Storage location for various configuration files."
:group 'dotemacs)
(use-package company-dict ; FIXME: yasnippet support disables company popup
:ensure t
:after company
:config
(setq company-dict-dir (concat dotemacs-temp-directory "dict/")
company-dict-enable-fuzzy t
company-dict-enable-yasnippet nil)
(add-to-list 'company-backends 'company-dict))
It seems the problem arises when trying to customize company-dict-dir
. The problem does not arise after evaluating the sexp with the line commented.
Alright, I pushed a fix for the remove-if-not
issue. I don't see anything suspect with custom directories (I use one myself), but I'll do some more experimenting.
Is the above snippet working correctly for you? Do you get to see company
popups even after evaluating company-dict-dir
?
You're right. That snippet didn't work. It complained first about remove-if-not
and then about parent-mode-list
— I've fixed these two in the latest commit. Please update and let me know if the problems continue!
Aah, I overlooked the fact that you expected a reply. Yes, the problem persists.
This is very odd. I can no longer reproduce it. What else is in your company-backends
? Is it possible another backend is interfering?
I am not an elisp expert, so cannot help you much. Adding dictionary files such as all
under company-dict-dir
seems to create a problem for me. The popup works with an empty directory. Does this help?
Oh, perhaps it's a permissions or file encoding issue then? I just pushed another update. I changed the way it reads dict files, makes it handle unreadable files better and optimized the parsing process. Please try that and let me know if it fixes it.
No, the problem still persists for me. Here is a screenshot: Typing com
just shows entries from the dictionary file all
(copied from your repo), it does not show the other candidates as one would expect. Isn't that what should happen?
The snippet that I am evaluating with emacs -Q
is the one that I have shared earlier.
Sorry for the tremendously late response, but are you still having this issue (if you're even using the plugin anymore, haha).
I am using it, but things are okay right now. I do not remember what resolved it or whatever. I will close it for now, thanks for the follow up.