5

I've read that "The easiest way to insert an entry for a person into BBDB is to press : (colon) in the Summary buffer when a message from him is the selected one. If the person is in the database already, nothing happens; otherwise, Emacs asks you if you want to insert him into the database."

That does not work for me, I guess because I'm using BBDB 3.

EDIT: ':' runs the command 'bbdb-mua-display-sender'.

Is there a workaround to this?

user3341592
  • 1,419
  • 1
  • 17
  • 36
  • Emacswiki mentions that BBDB 3 you need to change `(add-hook 'message-setup-hook 'bbdb-define-all-aliases)` in your init file to `(add-hook 'message-setup-hook 'bbdb-mail-aliases)` have you done that. Also try describing you problem in detail, what exactly did not work? Did you get any error? –  Mar 04 '14 at 18:30
  • I did what you suggest, but this did not change what's bound to ":" (which clearly must be wrong, then). Notice that, in the docstring of bbdb-mail-aliases, they speak of mail-setup-hook (instead of message-setup-hook). Important? – user3341592 Mar 05 '14 at 13:56

1 Answers1

6

This is what I use in my .emacs to work with BBDB-3 in Gnus, it will give this functionality to the ; key:

(require 'bbdb-autoloads)
(require 'bbdb)

;; initialization
(bbdb-initialize 'gnus 'message)
(bbdb-mua-auto-update-init 'gnus 'message)

;; size of the bbdb popup
(setq bbdb-pop-up-window-size 0.15)
(setq bbdb-mua-pop-up-window-size 0.15)

;; What do we do when invoking bbdb interactively
(setq bbdb-mua-update-interactive-p '(query . create))

;; Make sure we look at every address in a message and not only the
;; first one
(setq bbdb-message-all-addresses t)

;; use ; on a message to invoke bbdb interactively
(add-hook
 'gnus-summary-mode-hook
 (lambda ()
    (define-key gnus-summary-mode-map (kbd ";") 'bbdb-mua-edit-field)))

I got this information from somewhere on the net, but can't quite locate where just now; maybe this can set you on the correct path?

Orpheus
  • 298
  • 2
  • 8
  • Hello, thanks for answering, but my question is about how to create a new entry (with ":"), not how to edit a field from an existing entry (with ";")... – user3341592 Mar 05 '14 at 13:54
  • 1
    Did you try this at all? With Gnus, when on a message from someone not in my DDBD address book, pressing ; will offer the following - " is not in BBDB; add?" - Is this not what you want? As for the key binding, just change (kbd ";") to (kdb ":"). – Orpheus Mar 05 '14 at 15:27
  • 5
    I tried it now. In fact, the important part of your code was: (setq bbdb-mua-update-interactive-p '(query . create)). With that, I get what I wanted. Thanks! – user3341592 Mar 05 '14 at 20:20
  • I found the blog post http://blog.petitepomme.net/post/28547901478/installing-and-configuring-bbdb-3 among the search results that also pointed me here. It's very similar and earlier than your answer, so your bbdb config might be from there. – Anaphory Feb 25 '17 at 17:35