bbdb-user
[Top][All Lists]
Advanced

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

"Change name "Gerd Moellmann" to "Gerd Möllmann"?'


From: Sam Steingold
Subject: "Change name "Gerd Moellmann" to "Gerd Möllmann"?'
Date: Thu, 03 Nov 2022 14:34:23 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

"Gerd Möllmann" is already an AKA.
"ö" is an encoding mangling of "ö":

--8<---------------cut here---------------start------------->8---
(decode-coding-string
 (encode-coding-string "Gerd Möllmann" 'latin-1)
 'UT-8)
==> "Gerd Möllmann"
--8<---------------cut here---------------end--------------->8---

So, I set `bbdb-add-aka' to 'sds-bbdb-add-aka':

--8<---------------cut here---------------start------------->8---
(defun sds-bbdb-add-aka (rec name)
  "Decide whether to add the NAME to REC's AKA.
See `bbdb-add-aka'."
  (cond ((member name (bbdb-record-aka rec)) nil)
        ((let* ((bytes (encode-coding-string name 'latin-1 t))
                (n1 (and (not (equal bytes name))
                         (decode-coding-string bytes 'utf-8 t))))
           (and n1 (not (equal n1 name))
                (member n1 (bbdb-record-aka rec))))
         nil)
        (t 'query)))
--8<---------------cut here---------------end--------------->8---

and I am not offered to add the mangled name to AKA.

However, I am still offered to _change_ the name to the mangled version,
because `bbdb-annotate-message' checks for AKA on line 439 like this:

--8<---------------cut here---------------start------------->8---
(member-ignore-case name (bbdb-record-aka record))
--8<---------------cut here---------------end--------------->8---

I am not sure how to handle this with the current setup - except by
adding the same code to both `bbdb-add-name' and `bbdb-add-aka'.

I think we need one function that checks if a name is already present
instead of two `bbdb-add-name' and `bbdb-add-aka'.

Thank you.

-- 
Sam Steingold (https://aphar.dreamwidth.org/) on darwin Ns 10.3.2113
https://lastingimpactpsychology.com https://steingoldpsychology.com
https://memri.org https://iris.org.il https://camera.org https://ij.org/
Sex is a chemical reaction; alcohol is its catalyst.



reply via email to

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