1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

* lisp/character-fold.el: Allow complex chars to match their decomposition

(character-fold-table): When a character's decomposition does not
involve a formatting tag (i.e., if it has an "exact" description via
other characters), then this character is allowed to match the
decomposition.
This commit is contained in:
Artur Malabarba 2015-11-27 12:01:12 +00:00
parent 19e90846c4
commit a5f2970207

View file

@ -38,9 +38,15 @@
(map-char-table
(lambda (char decomp)
(when (consp decomp)
;; Discard a possible formatting tag.
(when (symbolp (car decomp))
(setq decomp (cdr decomp)))
(if (symbolp (car decomp))
;; Discard a possible formatting tag.
(setq decomp (cdr decomp))
;; If there's no formatting tag, ensure that char matches
;; its decomp exactly. This is because we want 'ä' to
;; match 'ä', but we don't want '¹' to match '1'.
(aset equiv char
(cons (apply #'string decomp)
(aref equiv char))))
;; Finally, figure out whether char has a simpler
;; equivalent (char-aux). If so, ensure that char-aux
;; matches char and maybe its decomp too.