Re: add sender without mail if mail is in some ignored-list?

Pieter van Oostrum <[email protected]> Fri, 27 Mar 2020 15:24:59 +0100
Newsgroups gmane.emacs.bbdb.user
Message-ID <[email protected]>
Kevin Brubeck Unhammer <[email protected]> writes:

> I tried
>
> (setq
>    my-bbdb-ignore-senders (regexp-opt '("[email protected]"))
>    bbdb-ignore-redundant-mails (defun my-bbdb-ignore-redundant-mails (record mail)
>                                  (if (string-match-p my-bbdb-ignore-senders mail)
>                                      (progn
>                                        (message "returning t so we ignore %s for %s" mail record)
>                                        t)
>                                    1)))
>
>
> and then when I hit `:' on a mail from github with a previously unknown
> sender, my *Messages* say
>
> returning t so we ignore [email protected] for [Some Name nil nil nil nil nil nil nil nil nil nil [Some Name Name, Some nil nil nil nil]]
> created Some Name’s record with address "[email protected]"
>
> and it adds the e-mail anyway. (My old value for that variable was `1'.)
>
> Should the function return something other than `t' to ignore the e-mail
> address?

bbdb-ignore-redundant-mails is only used if there is already an email address in the record.

And, by the way, you shouldn't use the value of a defun, because its value is undefined.
-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]