minad / cape

🦸cape.el - Completion At Point Extensions
GNU General Public License v3.0
584 stars 20 forks source link

Error in post-command-hook (corfu--post-command): (error "Invalid face" :icon) #15

Closed tsdh closed 2 years ago

tsdh commented 2 years ago

I'm using corfu since quite some time and now read your recommendation for cape and kind-icons. Very nice, indeed!

However, with the combination of corfu, cape, and kind-icons I get the error in the title with cape-file. It happens when I invoke it after /, after /h it completes to /home/ without error, after /home/ it immediately completes to /home/horn (although there are other possibilities!) and also prints the error, after /home/horn/. it errors, and with prefix /home/horn/D it shows the completion popup with all four possibilities. I don't really see any systematic when it works or errors...

This on with the current emacs master and the following config:

(use-package cape
  :ensure t
  :custom
  (cape-dabbrev-check-other-buffers nil)
  (cape-dabbrev-min-length 3)
  :init
  (add-to-list 'completion-at-point-functions #'cape-keyword)

  (add-hook 'text-mode-hook
            (lambda ()
              (make-local-variable 'completion-at-point-functions)
              (add-to-list 'completion-at-point-functions
                           #'cape-dabbrev t))))

(use-package corfu
  :ensure t
  :config
  (setq corfu-auto t
        corfu-auto-prefix 2)
  (setq corfu-quit-at-boundary t)
  :init
  (when (not (fboundp 'corfu-global-mode))
    (require 'corfu))
  (corfu-global-mode))

(use-package kind-icon
  :ensure t
  :after corfu
  :custom
  (kind-icon-default-face 'corfu-default) ; to compute blended backgrounds correctly
  :config
  (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter))
minad commented 2 years ago

https://github.com/jdtsmith/kind-icon/issues/7

tsdh commented 2 years ago

Oh, thank you. I should have searched a bit better. :-)