Function: describe-char-fold-equivalences
describe-char-fold-equivalences is an autoloaded, interactive and
byte-compiled function defined in char-fold.el.gz.
Signature
(describe-char-fold-equivalences CHAR &optional LAX)
Documentation
Display characters equivalent to CHAR under character-folding.
Prompt for CHAR (using read-char-by-name, which see for how to
specify the character). With no input, i.e. when CHAR is nil,
describe all available character equivalences of char-fold-to-regexp.
Optional argument LAX (interactively, the prefix argument), if
non-nil, means also include partially matching ligatures and
non-canonical equivalences.
Each line of the display shows the equivalences in two different ways separated by a colon:
- as the literal character or sequence
- using an ASCII-only escape syntax
For example, for the letter 'r', the first line is
r: ?\N{LATIN SMALL LETTER R}
which is for the requested character itself, and a later line has
ṟ: ?\N{LATIN SMALL LETTER R}?\N{COMBINING MACRON BELOW}
which clearly shows what the constituent characters are.
Probably introduced at or before Emacs version 29.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/char-fold.el.gz
;;;###autoload
(defun describe-char-fold-equivalences (char &optional lax)
"Display characters equivalent to CHAR under character-folding.
Prompt for CHAR (using `read-char-by-name', which see for how to
specify the character). With no input, i.e. when CHAR is nil,
describe all available character equivalences of `char-fold-to-regexp'.
Optional argument LAX (interactively, the prefix argument), if
non-nil, means also include partially matching ligatures and
non-canonical equivalences.
Each line of the display shows the equivalences in two different
ways separated by a colon:
- as the literal character or sequence
- using an ASCII-only escape syntax
For example, for the letter \\='r\\=', the first line is
r: ?\\N{LATIN SMALL LETTER R}
which is for the requested character itself, and a later line has
ṟ: ?\\N{LATIN SMALL LETTER R}?\\N{COMBINING MACRON BELOW}
which clearly shows what the constituent characters are."
(interactive (list (ignore-errors
(read-char-by-name
(format-prompt "Unicode name, single char, or hex"
"all")
t))
current-prefix-arg))
(require 'help-fns)
(let ((help-buffer-under-preparation t))
(help-setup-xref (list #'describe-char-fold-equivalences)
(called-interactively-p 'interactive))
(let* ((equivalences nil)
(char-fold--no-regexp t)
(table (char-fold--make-table))
(extra (char-table-extra-slot table 0)))
(if (not char)
(map-char-table
(lambda (char list)
(when lax
(setq list (append list (mapcar (lambda (entry)
(cdr entry))
(aref extra char)))))
(setq equivalences (cons (cons char list)
equivalences)))
table)
(setq equivalences (aref table char))
(when lax
(setq equivalences (append equivalences
(mapcar (lambda (entry)
(cdr entry))
(aref extra char)))))
(setq equivalences (cons (char-to-string char) equivalences)))
(with-help-window (help-buffer)
(with-current-buffer standard-output
(if char
(insert
(mapconcat
(lambda (c)
(format "%s: %s\n"
c
(mapconcat
(lambda (ch)
(format "?\\N{%s}"
(or (get-char-code-property ch 'name)
(get-char-code-property ch 'old-name))))
c)))
equivalences))
(insert "A list of char-fold equivalences for `char-fold-to-regexp':\n\n")
(setq-local bidi-paragraph-direction 'left-to-right)
(dolist (equiv (nreverse equivalences))
(insert (format "%c: %s\n" (car equiv)
(string-join (cdr equiv) " "))))))))))