diff options
| author | Kenichi Handa | 2008-08-29 08:01:43 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-08-29 08:01:43 +0000 |
| commit | 59db3a5ca46094d8f5d3aa196203411fec9ef259 (patch) | |
| tree | 474416a8b5e7f34f569f9c28dbb2313c45148749 | |
| parent | ef19e2f3b487ad7d73233df579aae1552fd509bf (diff) | |
| download | emacs-59db3a5ca46094d8f5d3aa196203411fec9ef259.tar.gz emacs-59db3a5ca46094d8f5d3aa196203411fec9ef259.zip | |
(unicode-category-table): Setup unicode-category-table.
| -rw-r--r-- | lisp/international/characters.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lisp/international/characters.el b/lisp/international/characters.el index 6e8cddefe57..5543650ff7c 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el | |||
| @@ -1116,6 +1116,26 @@ Setup char-width-table appropriate for non-CJK language environment." | |||
| 1116 | 'tibetan) | 1116 | 'tibetan) |
| 1117 | 1117 | ||
| 1118 | 1118 | ||
| 1119 | ;;; Setting unicode-category-table. | ||
| 1120 | |||
| 1121 | ;; This macro is to build unicode-category-table at compile time so | ||
| 1122 | ;; that C code can access the table efficiently. | ||
| 1123 | (defmacro build-unicode-category-table () | ||
| 1124 | (let ((table (make-char-table 'unicode-category-table nil))) | ||
| 1125 | (dotimes (i #x110000) | ||
| 1126 | (if (or (< i #xD800) | ||
| 1127 | (and (> i #xF900) (< i #x30000)) | ||
| 1128 | (and (> i #xE0000) (< i #xE0200))) | ||
| 1129 | (aset table i (get-char-code-property i 'general-category)))) | ||
| 1130 | (set-char-table-range table '(#xE000 . #xF8FF) 'Co) | ||
| 1131 | (set-char-table-range table '(#xF0000 . #xFFFFD) 'Co) | ||
| 1132 | (set-char-table-range table '(#x100000 . #x10FFFD) 'Co) | ||
| 1133 | (optimize-char-table table 'eq) | ||
| 1134 | table)) | ||
| 1135 | |||
| 1136 | (setq unicode-category-table (build-unicode-category-table)) | ||
| 1137 | |||
| 1138 | |||
| 1119 | ;;; Setting word boundary. | 1139 | ;;; Setting word boundary. |
| 1120 | 1140 | ||
| 1121 | (defun next-word-boundary-han (pos limit) | 1141 | (defun next-word-boundary-han (pos limit) |