bbdb-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: telling bbdb to not ask about first names?


From: Deus Max
Subject: Re: telling bbdb to not ask about first names?
Date: Fri, 08 May 2020 20:50:38 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

On Fri Feb 28 2020 address@hidden wrote:
>On Thu Feb 27 2020 address@hidden wrote:
>> bbdb3 routinely asks me whether I want to change a full name to a first name
>> e.g. Change Rajeev Gore to Rajeev?
>> Is there some way that I can turn this off permanently ?
>
>I am not sure I understand.
>
>If you receive an email from a sender whose email address is known
>to BBDB, but the (first + last) name known to BBDB for this email
>address does not match the name appearing in the email, then the
>user variable bbdb-add-name controls how BBDB should handle this
>situation.  The default value of bbdb-add-name is 'query.
>If this is indeed the cause of your problem, then the value nil may
>solve your problem.

Hi,

This issue is very annoying.
When bbdb-mua-auto-update-p is set (non-nil) to be routinely asked to
change from "John Doe" to "Doe John". There is no consistency in how
names are presented in the email field.
This results in multiple AKA entries of "AKA: Doe John" being saved to
quiet the constant querying.

So, I solved it by creating a function bbdb-deusmax-add-name to check
if the first-name, second-name are swapped. If a simple rotation matches
with the bbdb name, then it returns nil and the update terminates.
Otherwise, it returns 'query and the update proceeds as before.
the rotated new name is the same as the record name.

The elisp code is below. If you can add this to bbdb, please do.
Of course, the function can have a proper bbdb-* name, perhaps 
bbdb-add-name-query.

Below is my code. I have been using it for some time and works well for
me. Of course, it is only good for 2 names, does not help for 3 or more
names !


(setq bbdb-add-name 'bbdb-dias-add-name)

(defun bbdb-dias-add-name (record newname)
  "Check NEWNAME to add to existing bbdb RECORD.
Reject the simple case where first and last names are swapped.
This seems to be very common with email. Otherwise, use the
standard bbdb query."
  (setq newname (bbdb-split " " newname))
  (if (string= (bbdb-record-name record) (concat (second newname) " " (first 
newname)))
      nil
    'query))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]