emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Myles English <mylesenglish@gmail.com>
To: Alan Schmitt <alan.schmitt@polytechnique.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: [OT] Configuring bbdb 3
Date: Wed, 25 Jul 2012 21:51:15 +0100	[thread overview]
Message-ID: <87boj38szg.fsf@ed.ac.uk> (raw)
In-Reply-To: <m2d33jlpdt.fsf@top.irisa.fr>


Alan Schmitt <alan.schmitt@polytechnique.org> 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 <http://ichimusai.org/emacs/.gnus>
;; (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)

  reply	other threads:[~2012-07-25 20:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-25 17:30 [OT] Configuring bbdb 3 Alan Schmitt
2012-07-25 20:51 ` Myles English [this message]
2012-07-26  3:52 ` Eric Abrahamsen
2012-07-26  4:38   ` Achim Gratz
2012-07-26 11:12     ` Eric Abrahamsen
2012-07-26 13:46       ` Nick Dokos
2012-07-26 18:10       ` Achim Gratz
2012-07-26 19:55         ` François Allisson
2012-07-27  3:06           ` Eric Abrahamsen
2012-07-27 15:05           ` local.mk and up2 (Was: [OT] Configuring bbdb 3) Alan Schmitt
2012-07-27 16:14             ` Nick Dokos
2012-07-27 16:24             ` Nick Dokos
2012-07-28 10:56               ` local.mk and up2 Alan Schmitt
2012-07-27 18:08             ` Achim Gratz
2012-07-26  8:10   ` [OT] Configuring bbdb 3 Alan Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87boj38szg.fsf@ed.ac.uk \
    --to=mylesenglish@gmail.com \
    --cc=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).