diff options
| author | Artur Malabarba | 2015-06-25 18:53:33 +0100 |
|---|---|---|
| committer | Artur Malabarba | 2015-06-25 18:55:24 +0100 |
| commit | 671974ef79012c8123182a0990c6d5580f53311a (patch) | |
| tree | eaf58c4ec8c6ffba91f793e3bd71894cd2fade3c | |
| parent | ee80c1170916aae1bca62df5ca086fcc13486de1 (diff) | |
| download | emacs-671974ef79012c8123182a0990c6d5580f53311a.tar.gz emacs-671974ef79012c8123182a0990c6d5580f53311a.zip | |
* lisp/character-fold.el (character-fold-table): Reuse `table'
| -rw-r--r-- | lisp/character-fold.el | 8 |
1 files 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).") | |||
| 36 | (let* ((equiv (make-char-table 'character-fold-table)) | 36 | (let* ((equiv (make-char-table 'character-fold-table)) |
| 37 | (table (unicode-property-table-internal 'decomposition)) | 37 | (table (unicode-property-table-internal 'decomposition)) |
| 38 | (func (char-table-extra-slot table 1))) | 38 | (func (char-table-extra-slot table 1))) |
| 39 | ;; Ensure the table is populated | 39 | ;; Ensure the table is populated. |
| 40 | (map-char-table | 40 | (map-char-table |
| 41 | (lambda (i v) (when (consp i) (funcall func (car i) v table))) | 41 | (lambda (i v) (when (consp i) (funcall func (car i) v table))) |
| 42 | table) | 42 | table) |
| @@ -77,7 +77,9 @@ some).") | |||
| 77 | (aset equiv k | 77 | (aset equiv k |
| 78 | (if multiletter chars | 78 | (if multiletter chars |
| 79 | (cons (apply #'string dec) chars))))))))) | 79 | (cons (apply #'string dec) chars))))))))) |
| 80 | (unicode-property-table-internal 'decomposition)) | 80 | table) |
| 81 | |||
| 82 | ;; Add some manual entries. | ||
| 81 | (dolist (it '((?\" """ "“" "”" "”" "„" "⹂" "〞" "‟" "‟" "❞" "❝" "❠" "“" "„" "〝" "〟" "🙷" "🙶" "🙸" "«" "»") | 83 | (dolist (it '((?\" """ "“" "”" "”" "„" "⹂" "〞" "‟" "‟" "❞" "❝" "❠" "“" "„" "〝" "〟" "🙷" "🙶" "🙸" "«" "»") |
| 82 | (?' "❟" "❛" "❜" "‘" "’" "‚" "‛" "‚" "" "❮" "❯" "‹" "›") | 84 | (?' "❟" "❛" "❜" "‘" "’" "‚" "‛" "‚" "" "❮" "❯" "‹" "›") |
| 83 | (?` "❛" "‘" "‛" "" "❮" "‹") | 85 | (?` "❛" "‘" "‛" "" "❮" "‹") |
| @@ -85,6 +87,8 @@ some).") | |||
| 85 | (let ((idx (car it)) | 87 | (let ((idx (car it)) |
| 86 | (chars (cdr it))) | 88 | (chars (cdr it))) |
| 87 | (aset equiv idx (append chars (aref equiv idx))))) | 89 | (aset equiv idx (append chars (aref equiv idx))))) |
| 90 | |||
| 91 | ;; Convert the lists of characters we compiled into regexps. | ||
| 88 | (map-char-table | 92 | (map-char-table |
| 89 | (lambda (i v) (let ((re (regexp-opt (cons (char-to-string i) v)))) | 93 | (lambda (i v) (let ((re (regexp-opt (cons (char-to-string i) v)))) |
| 90 | (if (consp i) | 94 | (if (consp i) |