From mboxrd@z Thu Jan 1 00:00:00 1970 From: Myles English Subject: Re: [OT] Configuring bbdb 3 Date: Wed, 25 Jul 2012 21:51:15 +0100 Message-ID: <87boj38szg.fsf@ed.ac.uk> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su8Rr-0000Vi-0i for emacs-orgmode@gnu.org; Wed, 25 Jul 2012 16:44:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Su8Ro-0002af-98 for emacs-orgmode@gnu.org; Wed, 25 Jul 2012 16:44:46 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:37921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su8Rn-0002aJ-VZ for emacs-orgmode@gnu.org; Wed, 25 Jul 2012 16:44:44 -0400 Received: by weys10 with SMTP id s10so956248wey.0 for ; Wed, 25 Jul 2012 13:44:42 -0700 (PDT) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alan Schmitt Cc: emacs-orgmode@gnu.org Alan Schmitt writes: > Hello, > > Since I'm spending more and more time in Emacs, mostly in org mode, I > moved my email reading and writing there. Everything is happily > configured (I'm using gnus), Everything was hunky dory with my gnus...until I upgraded to Emacs 24, and my multiple IMAP accounts sent it crazy, and now I use mu4e (someone mentioned it on this list). > with one exception: email address completion. This was working for me, except for when more than one address was stored it would only give the first one. > I've read a few things online and it seems that bbdb is the way to go, > so I compiled and installed bbdb 3. Unfortunately I could not find any > configuration example online (the ones I found were for bbdb 2, but > things seem to have changed a lot, and the conversion guide in the > emacswiki did not help). > > I know this is off topic for this list, but if someone would be willing > to share his configuration, I would very much appreciate it. (I'm not > aiming for much: I want the addresses of messages I read to be added > automatically in bbdb, and to be able to complete from them when writing > a message.) Digging around in my old configuration has yielded all the bbdb3 things pasted below, may be you will find what you need in there? Sorry, I can't test it properly or say exactly which bit you need. Perhaps someone else will give a better reply. Myles ;; from custom-set-variables ;; I think this commented out line got annoying when it nagged me about adding every address ;; '(bbdb/message-update-records-p (lambda nil (let ((bbdb-update-records-p (quote query))) (bbdb-select-message)))) (setq bbdb/message-update-records-p (lambda nil (let ((bbdb-update-records-p (quote query))) (bbdb-select-message)))) ;; BBDB3 ======================================================== (add-to-list 'load-path "/home/myles/.emacs.d/plugins/bbdb/lisp") (require 'bbdb) (setq bbdb-mua-update-interactive-p '(search . search)) (setq bbdb-default-country "UK") (setq bbdb-phone-style nil) ;; not north american ;; Save BBDB addresses from the people I reply to. ;; Taken from ;; (defun cjb-bbdb-add-recipients-to-bbdb () ;; (mapcar ;; (lambda (address) ;; (let* ((parsed (mail-header-parse-address (bbdb-string-trim address))) ;; (net (car parsed)) ;; (name (cdr parsed))) ;; (when (not (bbdb-search-simple name net)) ;; (bbdb-create-internal (cdr parsed) nil (car parsed) nil nil nil)))) ;; (append (message-tokenize-header (message-fetch-field "To:")) ;; (message-tokenize-header (message-fetch-field "Cc:")) ;; (message-tokenize-header (message-fetch-field "Bcc:"))))) ;; (add-hook 'message-send-mail-hook 'cjb-bbdb-add-recipients-to-bbdb) ;; don't add these addresses (setq bbdb-ignore-message-alist '((("From" "Reply-To") . ".*launchpad.net\\|*launchpad.net\\|*launchpad.net\\|.*@.*.launchpad.net>") (("To" "Cc") . "emacs-orgmode@gnu.org\\|.*debbugs.gnu.org\\|olfin\\|.*launchpad.net))) ;;--------------------- ;; To stop being nagged to add addresses, ;; From: http://lists.gnu.org/archive/html/viewmail-info/2012-05/msg00016.html (setq bbdb-accept-message-alist nil) (defcustom rf-bbdb/vm-primary-inbox-regexp (if (boundp 'vm-primary-inbox) vm-primary-inbox) "A regexp matching folder names of primary VM inboxes." :group 'bbdb-rf :type 'string) (defun rf-bbdb/vm-ignore-old-folders () "Hook for ignoring all folders except in-boxes. Set `bbdb/mail-auto-create-p' to this function in order to ignore new addresses in all folders except the `vm-primary-inbox' or those matching `bbdb/vm-primary-inbox-regexp'." (interactive) (save-excursion (vm-select-folder-buffer) (if (and (string-match (or rf-bbdb/vm-primary-inbox-regexp vm-primary-inbox) (buffer-name)) (bbdb-ignore-some-messages-hook)) 'prompt))) ;; end, address nagging ;;--------------------- (setq org-bbdb-anniversary-field 'birthday) (define-key gnus-summary-mode-map (kbd "\"") 'bbdb-mua-display-records)