From 671974ef79012c8123182a0990c6d5580f53311a Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Thu, 25 Jun 2015 18:53:33 +0100 Subject: [PATCH] * lisp/character-fold.el (character-fold-table): Reuse `table' --- lisp/character-fold.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/character-fold.el b/lisp/character-fold.el index 7f5be8324a8..1675e6e2459 100644 --- a/lisp/character-fold.el +++ b/lisp/character-fold.el @@ -36,7 +36,7 @@ some).") (let* ((equiv (make-char-table 'character-fold-table)) (table (unicode-property-table-internal 'decomposition)) (func (char-table-extra-slot table 1))) - ;; Ensure the table is populated + ;; Ensure the table is populated. (map-char-table (lambda (i v) (when (consp i) (funcall func (car i) v table))) table) @@ -77,7 +77,9 @@ some).") (aset equiv k (if multiletter chars (cons (apply #'string dec) chars))))))))) - (unicode-property-table-internal 'decomposition)) + table) + + ;; Add some manual entries. (dolist (it '((?\" """ "“" "”" "”" "„" "⹂" "〞" "‟" "‟" "❞" "❝" "❠" "“" "„" "〝" "〟" "🙷" "🙶" "🙸" "«" "»") (?' "❟" "❛" "❜" "‘" "’" "‚" "‛" "‚" "󠀢" "❮" "❯" "‹" "›") (?` "❛" "‘" "‛" "󠀢" "❮" "‹") @@ -85,6 +87,8 @@ some).") (let ((idx (car it)) (chars (cdr it))) (aset equiv idx (append chars (aref equiv idx))))) + + ;; Convert the lists of characters we compiled into regexps. (map-char-table (lambda (i v) (let ((re (regexp-opt (cons (char-to-string i) v)))) (if (consp i) -- 2.39.2