girzel / ebdb

An EIEIO port of BBDB, Emacs' contact-management package
67 stars 11 forks source link

Does completion work with Corfu? #110

Closed jthaman closed 1 year ago

jthaman commented 1 year ago

Right now I'm using the custom completion scheme, which works well enough. I could not figure out from the manual what configuration would let me use Corfu in message buffers.

My config:

(use-package ebdb
  :elpaca t
  :after gnus
  :config
  (setq ebdb-message-auto-update-p
        (lambda ()
          (unless (ebdb-mua-message-header "Newsgroups")
            'query)))
  (setq ebdb-complete-mail t)
  (ebdb-complete-enable)
  (setq ebdb-save-on-exit t)
  (setq ebdb-mua-pop-up nil)
  (require 'ebdb-gnus)
  (require 'ebdb-message))
girzel commented 1 year ago

Sorry for the slow response here...

Completion in message-mode buffers is a bit of mess, as Gnus doesn't really work well with Emacs' built-in completion framework. By default EBDB will clobber the whole mess and set things up so that TAB will end up calling ebdb-complete-mail, and that function will only use your chosen completion framework when you're selecting one of multiple matching contacts.

Your other choice is to set the option ebdb-complete-mail to the symbol 'capf, for "completion at point", which is Emacs' built-in completion. I've never used Corfu, but my expectation is that then you would get "normal" string completion, with Corfu as the provider. The only caveat is that completion is a little less powerful this way: you're completing on a pre-composed list of strings, whereas using ebdb-complete-mail can conduct dynamic queries against the database.

TL;DR: set ebdb-complete-mail to 'capf.

girzel commented 1 year ago

Closing this now, please re-open if there's still any difficulty...

jthaman commented 1 year ago

Indeed, it has been working fine since I implemented your suggestion. Thank you.