aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2023-06-24 11:50:19 +1000
committerYuchen Pei <id@ypei.org>2023-06-24 11:50:19 +1000
commit251c8c4d50e52405f33cfbb5a3f509376052038b (patch)
tree6fc535356075c17ff3206170488e497634e93f9d /emacs
parent49f5687a76f51737b95b5c9fffc1f73f2e8da1e8 (diff)
Make bbdb gnus integration usable
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init/ycp-gnus.el7
-rw-r--r--emacs/.emacs.d/lisp/my/my-bbdb.el7
2 files changed, 12 insertions, 2 deletions
diff --git a/emacs/.emacs.d/init/ycp-gnus.el b/emacs/.emacs.d/init/ycp-gnus.el
index bf8ffae..6eef1cd 100644
--- a/emacs/.emacs.d/init/ycp-gnus.el
+++ b/emacs/.emacs.d/init/ycp-gnus.el
@@ -183,10 +183,13 @@
(my-package bbdb
(:delay 5)
(bbdb-initialize 'gnus 'message)
- ;; Too noisy
- ;; (bbdb-mua-auto-update-init 'gnus 'message)
+ (bbdb-mua-auto-update-init 'gnus 'message)
+ (setq bbdb-message-all-addresses t)
+ (setq bbdb-mua-pop-up-window-size .15)
(setq bbdb-mail-user-agent 'gnus-user-agent)
(setq bbdb-update-records-p 'create)
+ (setq bbdb-message-clean-mail-function 'my-bbdb-clean-mail)
+ (setq bbdb-add-name nil)
(require 'my-bbdb)
(my-keybind bbdb-mode-map "C-c C-c" #'my-bbdb-done)
(setq bbdb-phone-style nil
diff --git a/emacs/.emacs.d/lisp/my/my-bbdb.el b/emacs/.emacs.d/lisp/my/my-bbdb.el
index 80661cd..f5aa420 100644
--- a/emacs/.emacs.d/lisp/my/my-bbdb.el
+++ b/emacs/.emacs.d/lisp/my/my-bbdb.el
@@ -186,5 +186,12 @@ If NAME exists in bbdb, update. Otherwise insert."
(interactive)
(bbdb ""))
+(defun my-bbdb-clean-mail (address)
+ "Cleans email address."
+ (setq address (bbdb-string-trim address))
+ (cond ((string-match "\\`\\([^@+]+\\)\\+[^@]+\\(@.*\\)\\'" address)
+ (concat (match-string 1 address) (match-string 2 address)))
+ (t address)))
+
(provide 'my-bbdb)
;;; my-bbdb.el ends here