Function: textsec-name-suspicious-p
textsec-name-suspicious-p is a byte-compiled function defined in
textsec.el.gz.
Signature
(textsec-name-suspicious-p NAME)
Documentation
Say whether NAME looks suspicious.
NAME is a string, for instance, the free-text display name part of an email address.
If it isn't suspicious, return nil. If it is, return a string explaining the potential problem.
Names are considered suspicious if they use characters that can look similar to other characters when displayed, or use certain other unusual mixtures of characters.
Source Code
;; Defined in /usr/src/emacs/lisp/international/textsec.el.gz
(defun textsec-name-suspicious-p (name)
"Say whether NAME looks suspicious.
NAME is a string, for instance, the free-text display name part
of an email address.
If it isn't suspicious, return nil. If it is, return a string
explaining the potential problem.
Names are considered suspicious if they use characters that can
look similar to other characters when displayed, or use certain
other unusual mixtures of characters."
(cond
((not (equal name (ucs-normalize-NFC-string name)))
(format "`%s' is not in normalized form `%s', its display might deceive"
name (ucs-normalize-NFC-string name)))
((and (seq-find (lambda (char)
(and (member char bidi-control-characters)
(not (member char
'( ?\N{left-to-right mark}
?\N{right-to-left mark}
?\N{arabic letter mark})))))
name)
;; We have bidirectional formatting characters, but check
;; whether they affect any other characters in suspicious
;; ways. If not, NAME is not suspicious.
(fixnump (textsec-bidi-controls-suspicious-p name)))
(format "`%s' contains suspicious uses of bidirectional control characters"
name))
((textsec-suspicious-nonspacing-p name))))