;;; bbdb-ivan.el Big Brother Database customization ;; I got tired of people's name being highlighted red when composing ;; e-mail with flyspell. So this bit of code does an export of peoples ;; first and last name from bbdb to aspell custom dictionaries. ;; You need to set the variable ivan-bbdb-aspell-dictionary to a list ;; of personal dictionaries. Then run M-x ivan-bbdb-export-aspell. (require 'ivan-keymap) (require 'bbdb-com) (eval-when-compile ;; pacify compiler (defvar match-recs) (require 'ivan-face) (require 'ivan-fun) (require 'ivan-load) (require 'ivan-var)) (defvar ivan-bbdb-french-email-match "" "Regexp that matches french e-mail address") (defvar ivan-bbdb-french-note-match "french\\|ffriend\\|fbiz" "Regexp that matches bbdb note for french") (defvar ivan-bbdb-map nil "Ivan BBDB prefix keymap") (defun ivan-bbdb-mode-hook () (ivan-keymap-keep-global bbdb-mode-map) (ivan-keymap-define bbdb-mode-map "c" bbdb-dial "f" ivan-bbdb-notmuch)) (add-hook 'bbdb-mode-hook 'ivan-bbdb-mode-hook) (defun ivan-bbdb-notmuch () "Search all email matching e-mail address." (interactive) (notmuch-search (concat "from:" (car (bbdb-record-get-field (bbdb-current-record) 'mail))))) (defun ivan-bbdb-note (rec) "Return language from bbdb REC comment entry" (let ((note (cdr (assoc 'notes (bbdb-record-notes rec)))) (email (car (bbdb-record-mail rec)))) (cond ((and note (string-match ivan-bbdb-french-note-match note)) 'french) ((and email (string-match ivan-bbdb-french-email-match email)) 'french) ((and note (string-match "japanese" note)) 'japanese)))) (ivan-keymap-prefix ivan-bbdb-map "b" bbdb "i" bbdb-create) (bbdb-initialize 'gnus 'message) (setq bbdb-complete-mail-allow-cycling t bbdb-completion-display-record nil bbdb-default-country "France" bbdb-default-label-list '("home" "work") bbdb-dial-long-distance-prefix "00" bbdb-ispell-dictionary-list '("american" "french") bbdb-phone-style nil bbdb-image-path (list (concat ivan-var-static-dir "pic/")) bbdb-image 'name bbdb/mail-auto-create-p nil) (ivan-face bbdb-company normal bbdb-field-name normal bbdb-name yellow) (provide 'ivan-bbdb) ;; Copyright (C) 2007 Ivan Kanis ;; Author: Ivan Kanis ;; ;; This program is free software ; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation ; either version 2 of the License, or ;; (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY ; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program ; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA