mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 12:21:25 -08:00
(unicode-category-table): Setup unicode-category-table.
This commit is contained in:
parent
ef19e2f3b4
commit
59db3a5ca4
1 changed files with 20 additions and 0 deletions
|
|
@ -1115,6 +1115,26 @@ Setup char-width-table appropriate for non-CJK language environment."
|
|||
(set-char-table-range char-script-table range 'tibetan))
|
||||
'tibetan)
|
||||
|
||||
|
||||
;;; Setting unicode-category-table.
|
||||
|
||||
;; This macro is to build unicode-category-table at compile time so
|
||||
;; that C code can access the table efficiently.
|
||||
(defmacro build-unicode-category-table ()
|
||||
(let ((table (make-char-table 'unicode-category-table nil)))
|
||||
(dotimes (i #x110000)
|
||||
(if (or (< i #xD800)
|
||||
(and (> i #xF900) (< i #x30000))
|
||||
(and (> i #xE0000) (< i #xE0200)))
|
||||
(aset table i (get-char-code-property i 'general-category))))
|
||||
(set-char-table-range table '(#xE000 . #xF8FF) 'Co)
|
||||
(set-char-table-range table '(#xF0000 . #xFFFFD) 'Co)
|
||||
(set-char-table-range table '(#x100000 . #x10FFFD) 'Co)
|
||||
(optimize-char-table table 'eq)
|
||||
table))
|
||||
|
||||
(setq unicode-category-table (build-unicode-category-table))
|
||||
|
||||
|
||||
;;; Setting word boundary.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue