mu4e: contacts: use mu4e--contacts-set

We use to have mu4e--contacts-hash, with name mapping to rank; that was
needlessly complicated since most completion engine sort alphabetically, making
the rank totally irrelevant (in practice, it doesn't matter much from the
end-user pov).

Anyway, simplify that part, maintain a set of contacts without any rank (which
what the server delivers now).

Also update the _default_ mu4e-contact-process-function to filter out anything
with 'reply' since it's not very useful for autocompletion.
This commit is contained in:
Dirk-Jan C. Binnema
2022-05-09 21:22:17 +03:00
parent 81689f0af3
commit db86e7b5ee
4 changed files with 35 additions and 51 deletions

View File

@ -151,7 +151,7 @@ invoke
(mu4e--maildirs-with-query)))))
;; maybe request the list of contacts, automatically refreshed after
;; reindexing
(unless mu4e--contacts-hash (mu4e--request-contacts-maybe)))
(unless mu4e--contacts-set (mu4e--request-contacts-maybe)))
(defun mu4e--stop ()
"Stop mu4e."
@ -251,7 +251,7 @@ chance."
"Clear any cached resources."
(setq
mu4e-maildir-list nil
mu4e--contacts-hash nil
mu4e--contacts-set nil
mu4e--contacts-tstamp "0"))
;;; _
(provide 'mu4e)