diff options
| author | Artur Malabarba | 2015-11-27 12:01:12 +0000 |
|---|---|---|
| committer | Artur Malabarba | 2015-11-27 12:01:12 +0000 |
| commit | a5f2970207d792e5f5d40160485007f282a0569d (patch) | |
| tree | 540dc960935d590eb7921fe57cf7cf1fae8cdb02 /lisp | |
| parent | 19e90846c4a3aedf242a597598ad04505f4923c6 (diff) | |
| download | emacs-a5f2970207d792e5f5d40160485007f282a0569d.tar.gz emacs-a5f2970207d792e5f5d40160485007f282a0569d.zip | |
* 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.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/character-fold.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/character-fold.el b/lisp/character-fold.el index 3d19d29b1f6..4b526c20277 100644 --- a/lisp/character-fold.el +++ b/lisp/character-fold.el | |||
| @@ -38,9 +38,15 @@ | |||
| 38 | (map-char-table | 38 | (map-char-table |
| 39 | (lambda (char decomp) | 39 | (lambda (char decomp) |
| 40 | (when (consp decomp) | 40 | (when (consp decomp) |
| 41 | ;; Discard a possible formatting tag. | 41 | (if (symbolp (car decomp)) |
| 42 | (when (symbolp (car decomp)) | 42 | ;; Discard a possible formatting tag. |
| 43 | (setq decomp (cdr decomp))) | 43 | (setq decomp (cdr decomp)) |
| 44 | ;; If there's no formatting tag, ensure that char matches | ||
| 45 | ;; its decomp exactly. This is because we want 'ä' to | ||
| 46 | ;; match 'ä', but we don't want '¹' to match '1'. | ||
| 47 | (aset equiv char | ||
| 48 | (cons (apply #'string decomp) | ||
| 49 | (aref equiv char)))) | ||
| 44 | ;; Finally, figure out whether char has a simpler | 50 | ;; Finally, figure out whether char has a simpler |
| 45 | ;; equivalent (char-aux). If so, ensure that char-aux | 51 | ;; equivalent (char-aux). If so, ensure that char-aux |
| 46 | ;; matches char and maybe its decomp too. | 52 | ;; matches char and maybe its decomp too. |