ebdb 和 bbdb 非常类似,但它对中文的支持可以甩 bbdb 几条街, 有兴趣的同学可以试一试.
(use-package ebdb
:ensure nil
:config
(require 'ebdb-mua)
(require 'ebdb-gnus)
(require 'ebdb-com)
(require 'ebdb-vcard)
(require 'ebdb-complete)
(ebdb-complete-enable)
(use-package pyim
:config
(use-package ebdb-i18n-chn)
;; (defun eh-ebdb-search-chinese (string)
;; (if (functionp 'pyim-isearch-build-search-regexp)
;; (pyim-isearch-build-search-regexp string)
;; string))
;; (setq ebdb-search-transform-functions
;; '(eh-ebdb-search-chinese))
(cl-defmethod ebdb-field-search
:around (field criterion)
(or (cl-call-next-method)
(when (stringp criterion)
(let ((str (ebdb-string field)))
(cl-some
(lambda (pinyin)
(string-match-p criterion pinyin))
(append (pyim-hanzi2pinyin str nil "" t)
(pyim-hanzi2pinyin str t "" t)))))))))