"Change name "Gerd Moellmann" to "Gerd Möllmann" ?'
Sam Steingold <[email protected]> Thu, 03 Nov 2022 14:34:23 -0400
| Newsgroups | gmane.emacs.bbdb.user |
|---|---|
| Message-ID | <[email protected]> |
"Gerd M=C3=B6llmann" is already an AKA.
"=C3=83=C2=B6" is an encoding mangling of "=C3=B6":
--8<---------------cut here---------------start------------->8---
(decode-coding-string
(encode-coding-string "Gerd M=C3=83=C2=B6llmann" 'latin-1)
'UT-8)
=3D=3D> "Gerd M=C3=B6llmann"
--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.
--=20
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.