[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 671974e: * lisp/character-fold.el (character-fold-t
From: |
Artur Malabarba |
Subject: |
[Emacs-diffs] master 671974e: * lisp/character-fold.el (character-fold-table): Reuse `table' |
Date: |
Thu, 25 Jun 2015 17:56:00 +0000 |
branch: master
commit 671974ef79012c8123182a0990c6d5580f53311a
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
* lisp/character-fold.el (character-fold-table): Reuse `table'
---
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 7f5be83..1675e6e 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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 671974e: * lisp/character-fold.el (character-fold-table): Reuse `table',
Artur Malabarba <=