VM

BBDB and aliases/abbrevs

Asked by Johan Vromans

I'm in the process of upgrading my old VM config to modern times. I'm currently using VM 8.2.0a and BBDB 2.36devo.

In my .vm settings I have the following aliases/abbrevs/BBDB related settings:

(defun jv-mail-setup-hook ()
  (mail-abbrevs-setup)
  (if (fboundp 'bbdb-define-all-aliases)
      (bbdb-define-all-aliases))
  (define-key (current-local-map) "\C-n" 'mail-abbrev-next-line)
  (define-key (current-local-map) [down] 'mail-abbrev-next-line)
  (define-key (current-local-map) [C-end] 'mail-abbrev-end-of-buffer)
  (define-key (current-local-map) "\M->" 'mail-abbrev-end-of-buffer)
  (define-key (current-local-map) "\C-c\C-w" 'jv-mail-signature)
  (define-key (current-local-map) [M-kp-enter] 'jv-vm-toggle-reply-address)
  )
(add-hook 'mail-setup-hook 'jv-mail-setup-hook)

In .emacs:

(require 'bbdb)
(bbdb-initialize 'gnus 'message 'vm)

However, when composing a mail from VM I do not get the BBDB aliases/abbrevs.

In the buffer mode line it says that abbrev minor mode is enabled.
Keys like \C-n and [down] are, indeed, bound to mail-abbrev-next-line, indicating that the mail setup hook was executed.
But the only aliases/abbrevs that are expanded are a few that are read from .abbrev_defs.
No mail addresses from BBDB, also no addresses from BBDB 'mail-alias fields.

Helpful suggestions are kindly welcomed.

Question information

Language:
English Edit question
Status:
Invalid
For:
VM Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Uday Reddy (reddyuday) said :
#1

Have you tried it with BBDB 2.35? I believe that the 2.36 version, which
should be really called BBDB 3 is still being developed.

I personally have no idea what the problem is. I have never used
bbdb-define-all-aliases. These kind of questions are better asked on the
viewmail-info mailing list so that other users can give you answers. Note
that this question has nothing to do with VM anyway.

Cheers,
Uday

Revision history for this message
Tim Cross (tcross) said :
#2

Hi John,

not sure if this will help, but I use VM trunk with bbdb and the only
BBDB related configuration I've had in my config for a long time now
is

(require 'bbdb)
(bbdb-initialize 'vm 'message 'sendmail)

(setq bbdb-check-zip-codes-p nil
          bbdb-default-country "Australia"
          bbdb-north-american-phone-numbers-p nil
          bbdb/mail-autocreate-p nil)

To get address completion in VM I just hit tab when filling in
to/cc/bcc headers.
I do ensure the path to bbdb is provided when building VM

I use to use abbrevs with mail as well, but stopped doing that a few
years back (for no special reason, just didn't find I needed it as
well as bbdb).

My suggestion would be to remove all your bbdb related settings apart
from the require and initialize lines and then see what you need to
add/configure.

I'm using bbdb from a github repository - don't know if its the latest
or greatest, but it works for me. The ursl is

git://github.com/barak/BBDB.git

I'm also running under emacs 24 (from bzr repo). While I normally find
emacs 24 quite stable, over recent weeks, I have run into numerous
issues and would not recommend it over emacs 23 unless there are
features in 24 you need.

Tim

On Wed, Jul 20, 2011 at 12:41 AM, Johan Vromans
<email address hidden> wrote:
> New question #165331 on VM:
> https://answers.launchpad.net/vm/+question/165331
>
> I'm in the process of upgrading my old VM config to modern times. I'm currently using VM 8.2.0a and BBDB 2.36devo.
>
> In my .vm settings I have the following aliases/abbrevs/BBDB related settings:
>
> (defun jv-mail-setup-hook ()
>  (mail-abbrevs-setup)
>  (if (fboundp 'bbdb-define-all-aliases)
>      (bbdb-define-all-aliases))
>  (define-key (current-local-map) "\C-n" 'mail-abbrev-next-line)
>  (define-key (current-local-map) [down] 'mail-abbrev-next-line)
>  (define-key (current-local-map) [C-end]  'mail-abbrev-end-of-buffer)
>  (define-key (current-local-map) "\M->" 'mail-abbrev-end-of-buffer)
>  (define-key (current-local-map) "\C-c\C-w" 'jv-mail-signature)
>  (define-key (current-local-map) [M-kp-enter] 'jv-vm-toggle-reply-address)
>  )
> (add-hook 'mail-setup-hook 'jv-mail-setup-hook)
>
> In .emacs:
>
> (require 'bbdb)
> (bbdb-initialize 'gnus 'message 'vm)
>
> However, when composing a mail from VM I do not get the BBDB aliases/abbrevs.
>
> In the buffer mode line it says that abbrev minor mode is enabled.
> Keys like \C-n and [down] are, indeed, bound to mail-abbrev-next-line, indicating that the mail setup hook was executed.
> But the only aliases/abbrevs that are expanded are a few that are read from .abbrev_defs.
> No mail addresses from BBDB, also no addresses from BBDB 'mail-alias fields.
>
> Helpful suggestions are kindly welcomed.
>
> --
> You received this question notification because you are a member of VM
> development team, which is an answer contact for VM.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~vm
> Post to     : <email address hidden>
> Unsubscribe : https://launchpad.net/~vm
> More help   : https://help.launchpad.net/ListHelp
>

Revision history for this message
Johan Vromans (jvromans) said :
#3

[Quoting Uday Reddy, on July 19 2011, 23:01, in "Re: [Question #16533"]
> These kind of questions are better asked on the viewmail-info
> mailing list so that other users can give you answers.

Apologies. I was under the impression that this was "Questions for VM".

Careful inspeciton of https://launchpad.net/vm doesn't show any
reference to a viewmail-info mailing list. It does have an appealing
'Ask a question' button...

> Note that this question has nothing to do with VM anyway.

This remains to be seen. De functionality disappeared after VM
upgrade.

-- Johan

Revision history for this message
Uday Reddy (reddyuday) said :
#4

Johan Vromans writes:

> Apologies. I was under the impression that this was "Questions for VM".

Yeah, I admit that it is a confusing button. But Lauchpad is just the
development site. Most users don't come here except when they want to
download something. If you go to the "homepage", you will get all the
links.

> This remains to be seen. De functionality disappeared after VM
> upgrade.

If you are sure that it is a problem created by the upgrade, then it is best
to file it as a bug report. You can use the Bugs link on the Launchpad, but
generally it is better to use vm-submit-bug-report function within VM.

The "Answers" link is best used for things that might be classed as FAQs.
"How do I do X?" kind of things.

Cheers,
Uday

Revision history for this message
Uday Reddy (reddyuday) said :
#5

I just tried bbdb-define-all-aliases from BBDB 2.35, and it is working
fine. Also, as I said, it has nothing to do with VM. mail-mode and
mailabbrevs are part of Gnu Emacs and BBDB is its own package.

Regarding your statement:

> No mail addresses from BBDB, also no addresses from BBDB 'mail-alias fields.

I only see in the BBDB manual the functionality of expanded addresses from
'mail-alias fields. I don't know what you mean by "mail addresses from
BBDB".

Cheers,
Uday

Revision history for this message
Uday Reddy (reddyuday) said :
#6

No problems with BBDB 2.35.

Revision history for this message
Johan Vromans (jvromans) said :
#7

[Quoting Uday Reddy, on July 20 2011, 08:56, in "Re: [Question #16533"]
> I just tried bbdb-define-all-aliases from BBDB 2.35, and it is working
> fine. Also, as I said, it has nothing to do with VM. mail-mode and
> mailabbrevs are part of Gnu Emacs and BBDB is its own package.

I went back to BBDB 2.35 and VM 8.1.1. The unsolicited window stealing
interferes with my work. I'll try to tackle that some other time.

> I only see in the BBDB manual the functionality of expanded
> addresses from 'mail-alias fields. I don't know what you mean by
> "mail addresses from BBDB".

I should have been a bit more clear.
BBDB provides completion and abbrevs (aliases).
Completion info is derived from the user name and/or email addresses.
Aliases are derived from the mail-alias field in the BBDB records.

In a mail buffer, when I enter

  To: foo

I can hit M-TAB to get completion for names and addresses starting
with "foo".
I can hit C-n or [down] (since I bound these keys to
mail-abbrev-next-line) to expand a possible abbrev "foo".

Setting up the 'aliases' is handled by bbdb-define-all-aliases which,
according to the BBDB docs, should be run from the mail-setup-hook.
There something goes wrong. Since Mail/VM/BBDB are tightly cooperating
I'm investigating which of the components is mistaken (counting myself
as a component, too).

-- Johan

Revision history for this message
Uday Reddy (reddyuday) said :
#8

Johan Vromans writes:

> Setting up the 'aliases' is handled by bbdb-define-all-aliases which,
> according to the BBDB docs, should be run from the mail-setup-hook.
> There something goes wrong. Since Mail/VM/BBDB are tightly cooperating
> I'm investigating which of the components is mistaken (counting myself
> as a component, too).

VM is not integrated as you imagine. If you start Emacs without loading VM,
you would likely see the same behaviour.

Cheers,
Uday