From 4626499f4fd3b6de6c61a3dc240b88e143a70ecb Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 22 Oct 2008 05:29:08 +0000 Subject: [PATCH] Don't setup find-word-boundary-function-table. (next-word-boundary-han, next-word-boundary-kana): Delete them. (word-combining-categories, word-separating-categories): Adjusted to the change of the docstrings. --- lisp/ChangeLog | 8 ++++ lisp/international/characters.el | 72 ++------------------------------ src/ChangeLog | 8 ++++ 3 files changed, 19 insertions(+), 69 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 38110a0b326..05d153a7bbf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2008-10-22 Kenichi Handa + + * international/characters.el: Don't setup + find-word-boundary-function-table. + (next-word-boundary-han, next-word-boundary-kana): Delete them. + (word-combining-categories, word-separating-categories): Adjusted + to the change of the docstrings. + 2008-10-21 Alan Mackenzie * simple.el (undo-more): Add comment explaining the operations on diff --git a/lisp/international/characters.el b/lisp/international/characters.el index 5543650ff7c..159bac02466 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -1138,80 +1138,14 @@ Setup char-width-table appropriate for non-CJK language environment." ;;; Setting word boundary. -(defun next-word-boundary-han (pos limit) - (if (<= pos limit) - (save-excursion - (goto-char pos) - (looking-at "\\cC+") - (goto-char (match-end 0)) - (if (looking-at "\\cH+") - (goto-char (match-end 0))) - (point)) - (while (and (> pos limit) - (eq (aref char-script-table (char-after (1- pos))) 'han)) - (setq pos (1- pos))) - pos)) - -(defun next-word-boundary-kana (pos limit) - (if (<= pos limit) - (save-excursion - (goto-char pos) - (if (looking-at "\\cK+") - (goto-char (match-end 0))) - (if (looking-at "\\cH+") - (goto-char (match-end 0))) - (if (looking-at "\\ck+") - (goto-char (match-end 0))) - (point)) - (let ((category-set (char-category-set (char-after pos))) - category) - (if (or (aref category-set ?K) (aref category-set ?k)) - (while (and (> pos limit) - (setq category-set - (char-category-set (char-after (1- pos)))) - (or (aref category-set ?K) (aref category-set ?k))) - (setq pos (1- pos))) - (while (and (> pos limit) - (aref (setq category-set - (char-category-set (char-after (1- pos)))) ?H)) - (setq pos (1- pos))) - (setq category (cond ((aref category-set ?C) ?C) - ((aref category-set ?K) ?K) - ((aref category-set ?A) ?A))) - (when category - (setq pos (1- pos)) - (while (and (> pos limit) - (aref (char-category-set (char-after (1- pos))) - category)) - (setq pos (1- pos))))) - pos))) - -(map-char-table - #'(lambda (char script) - (cond ((eq script 'han) - (set-char-table-range find-word-boundary-function-table - char #'next-word-boundary-han)) - ((eq script 'kana) - (set-char-table-range find-word-boundary-function-table - char #'next-word-boundary-kana)))) - char-script-table) - (setq word-combining-categories - '((?l . ?l) - (?C . ?C) + '((nil . ?^) + (?^ . nil) (?C . ?H) (?C . ?K))) (setq word-separating-categories ; (2-byte character sets) - '((?A . ?K) ; Alpha numeric - Katakana - (?A . ?C) ; Alpha numeric - Chinese - (?H . ?A) ; Hiragana - Alpha numeric - (?H . ?K) ; Hiragana - Katakana - (?H . ?C) ; Hiragana - Chinese - (?K . ?A) ; Katakana - Alpha numeric - (?K . ?C) ; Katakana - Chinese - (?C . ?A) ; Chinese - Alpha numeric - (?C . ?K) ; Chinese - Katakana + '((?H . ?K) ; Hiragana - Katakana )) ;; Local Variables: diff --git a/src/ChangeLog b/src/ChangeLog index 0a11f86292c..25064915f1f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2008-10-22 Kenichi Handa + + * category.c (word_boundary_p): Check scripts instead of charset. + Handle nil value in word-separating-categories and + word-combining-categories. + (syms_of_category): Fix docstrings of word-separating-categories + and word-combining-categories. + 2008-10-21 Eli Zaretskii * coding.c (Fencode_coding_region, Fdecode_coding_region) -- 2.39.5