Builds fine, but broken for Japanese. Please don't ignore it,
C-u 100 please.
1. Though the function `setup-japanese-environment-internal' in
japan-util.el uses the coding systems `japanese-shift-jis'
and `japanese-iso-8bit', they have not been defined. Because
of this, we cannot run the command `set-language-environment'
with the argument "Japanese".
2. Since `language-unicode-precedence-list' does not have the
default value, XEmacs decodes a unicode encoded Japanese text
with Chinese characters:
(char-charset
(string-to-char
(decode-coding-string
(encode-coding-string
(char-to-string (make-char 'japanese-jisx0208 36 34))
'utf-8)
'utf-8)))
=> chinese-gb2312
3. The Japanese category table has not been set, so the regexp
"\\cj" does not match Japanese text:
(string-match "\\cj" (char-to-string (make-char 'japanese-jisx0208 36
34)))
=> nil
4. The kinsoku processing does not work correctly. It is caused
by the bugs in kinsoku.el which has been fixed in XEmacs 21.4.
5. Converting hiragana string to katakana string, or katakana to
hiragana doesn't work. It is because the character code
property has not been set for those Japanese characters.
6. Automatic code conversion does not work for Japanese text
files when the command `find-file' is performed. I don't
know why it does not work.
I will attach the patch for fixing 1 2 3 4 5:
2002-05-29 Katsumi Yamaoka <yamaoka(a)jpl.org>
c.f. <
http://emacs-w3m.namazu.org/ml/msg03461.html>
* mule/japan-util.el (setup-japanese-environment-internal): Use
proper coding-systems.
2002-05-28 Katsumi Yamaoka <yamaoka(a)jpl.org>
c.f. <
http://list-archive.xemacs.org/xemacs-beta/200205/msg00579.html>
* mule/japan-util.el: Use `characterp' instead of `integerp' while
defining char properties for katakana.
c.f. <
http://list-archive.xemacs.org/xemacs-beta/200205/msg00579.html>
* mule/mule-category.el: Clear the category table before defining
categories for `predefined-category-list'.
c.f <
http://emacs-w3m.namazu.org/ml/msg03451.html>,
<
http://emacs-w3m.namazu.org/ml/msg03433.html>
* mule/mule-cmds.el (finish-set-language-environment): Fit the
charsets preferences in unicode conversions for the language
environment. Suggested by ARISAWA Akihiro <ari(a)mbf.sphere.ne.jp>.
2001-07-10 Katsumi Yamaoka <yamaoka(a)jpl.org>
c.f. <
http://list-archive.xemacs.org/xemacs-patches/200205/msg00233.html>,
<
http://list-archive.xemacs.org/xemacs-patches/200107/msg00022.html>,
<
http://list-archive.xemacs.org/xemacs-patches/200107/msg00018.html>
* mule/kinsoku.el (kinsoku-bol-p): Work with ascii and non-ascii
mixed text.
(kinsoku-eol-p): Ditto.
2001-07-09 Katsumi Yamaoka <yamaoka(a)jpl.org>
c.f. <
http://list-archive.xemacs.org/xemacs-patches/200205/msg00233.html>,
<
http://list-archive.xemacs.org/xemacs-patches/200107/msg00022.html>,
<
http://list-archive.xemacs.org/xemacs-patches/200107/msg00018.html>
* mule/kinsoku.el (kinsoku-ascii-eol, kinsoku-gb-bol,
kinsoku-gb-eol, kinsoku-big5-bol, kinsoku-big5-eol): Assign
characters as the category `s' or `e' correctly.
--- xemacs/lisp/mule/japan-util.el~ 2002-03-17 22:19:10 +0000
+++ xemacs/lisp/mule/japan-util.el 2002-07-03 01:55:33 +0000
@@ -35,9 +35,9 @@
;;;###autoload
(defun setup-japanese-environment-internal ()
(cond ((eq system-type 'ms-dos)
- (prefer-coding-system 'japanese-shift-jis))
+ (prefer-coding-system 'shift_jis))
((eq system-type 'usg-unix-v)
- (prefer-coding-system 'japanese-iso-8bit)))
+ (prefer-coding-system 'euc-jp)))
(setq sentence-end-save sentence-end)
(setq sentence-end (concat sentence-end "\\|[。?!]")))
@@ -89,7 +89,7 @@
(get-char-code-property hira 'kana-composition)))))
(put-char-code-property hiragana 'katakana katakana)
(put-char-code-property hiragana 'jisx0201 jisx0201)))
- (when (integerp katakana)
+ (when (characterp katakana)
(put-char-code-property katakana 'hiragana hiragana)
(put-char-code-property katakana 'jisx0201 jisx0201))
(if jisx0201
--- xemacs/lisp/mule/kinsoku.el~ 2002-03-13 22:00:34 +0000
+++ xemacs/lisp/mule/kinsoku.el 2002-07-03 01:55:33 +0000
@@ -172,7 +172,7 @@
;; kinsoku ascii
(loop for char in (string-to-list kinsoku-ascii-bol)
do (modify-category-entry char ?s))
-(loop for char in kinsoku-ascii-eol
+(loop for char in (string-to-list kinsoku-ascii-eol)
do (modify-category-entry char ?e))
;; kinsoku-jis
(loop for char in (string-to-list kinsoku-jis-bol)
@@ -180,14 +180,14 @@
(loop for char in (string-to-list kinsoku-jis-eol)
do (modify-category-entry char ?e))
;; kinsoku-gb
-(loop for char in kinsoku-gb-bol
+(loop for char in (string-to-list kinsoku-gb-bol)
do (modify-category-entry char ?s))
-(loop for char in kinsoku-gb-eol
+(loop for char in (string-to-list kinsoku-gb-eol)
do (modify-category-entry char ?e))
;; kinsoku-big5
-(loop for char in kinsoku-big5-bol
+(loop for char in (string-to-list kinsoku-big5-bol)
do (modify-category-entry char ?s))
-(loop for char in kinsoku-big5-eol
+(loop for char in (string-to-list kinsoku-big5-eol)
do (modify-category-entry char ?e))
(defun kinsoku-bol-p ()
@@ -195,14 +195,21 @@
Uses category \'s\' to check.
pointで改行すると行頭禁則に触れるかどうかをかえす。
行頭禁則文字は\'s\'のcategoryで指定する。"
- (let ((ch (char-after)))
- (if (and ch
+ (let ((before (char-before))
+ (after (char-after)))
+ (if (and after
(or
- (and kinsoku-ascii (char-in-category-p ch ?a))
- (and kinsoku-jis (char-in-category-p ch ?j))
- (and kinsoku-gb (char-in-category-p ch ?c))
- (and kinsoku-big5 (char-in-category-p ch ?t))))
- (char-in-category-p ch ?s)
+ (and kinsoku-ascii (char-in-category-p after ?a))
+ (and kinsoku-jis (or (char-in-category-p after ?j)
+ (and before
+ (char-in-category-p before ?j))))
+ (and kinsoku-gb (or (char-in-category-p after ?c)
+ (and before
+ (char-in-category-p before ?c))))
+ (and kinsoku-big5 (or (char-in-category-p after ?t)
+ (and before
+ (char-in-category-p before ?t))))))
+ (char-in-category-p after ?s)
nil)))
(defun kinsoku-eol-p ()
@@ -210,14 +217,21 @@
Uses category \'e\' to check.
pointで改行すると行末禁則に触れるかどうかをかえす。
行末禁則文字は\'s\'のcategoryで指定する。"
- (let ((ch (char-before)))
- (if (and ch
+ (let ((before (char-before))
+ (after (char-after)))
+ (if (and before
(or
- (and kinsoku-ascii (char-in-category-p ch ?a))
- (and kinsoku-jis (char-in-category-p ch ?j))
- (and kinsoku-gb (char-in-category-p ch ?c))
- (and kinsoku-big5 (char-in-category-p ch ?t))))
- (char-in-category-p ch ?e)
+ (and kinsoku-ascii (char-in-category-p before ?a))
+ (and kinsoku-jis (or (char-in-category-p before ?j)
+ (and after
+ (char-in-category-p after ?j))))
+ (and kinsoku-gb (or (char-in-category-p before ?c)
+ (and after
+ (char-in-category-p after ?c))))
+ (and kinsoku-big5 (or (char-in-category-p before ?t)
+ (and after
+ (char-in-category-p after ?t))))))
+ (char-in-category-p before ?e)
nil)))
(defvar kinsoku-extend-limit nil
--- xemacs/lisp/mule/mule-category.el~ 2002-03-21 22:01:39 +0000
+++ xemacs/lisp/mule/mule-category.el 2002-07-03 01:55:33 +0000
@@ -266,7 +266,7 @@
(if (and (nth 2 (car l))
(not (defined-category-p (nth 2 (car l)))))
(define-category (nth 1 (car l)) (nth 2 (car l))))
- (modify-category-entry (car (car l)) (nth 1 (car l)))
+ (modify-category-entry (car (car l)) (nth 1 (car l)) nil t)
(setq l (cdr l))))
;;; Setting word boundary.
--- xemacs/lisp/mule/mule-cmds.el~ 2002-04-07 22:18:31 +0000
+++ xemacs/lisp/mule/mule-cmds.el 2002-07-03 01:55:33 +0000
@@ -753,6 +753,11 @@
(let ((func (get-language-info language-name 'setup-function)))
(if (fboundp func)
(funcall func)))
+
+ ;; Fit the charsets preferences in unicode conversions for the
+ ;; language environment.
+ (set-language-unicode-precedence-list (charset-list))
+
(run-hooks 'set-language-environment-hook)
(force-mode-line-update t))
--
Katsumi Yamaoka <yamaoka(a)jpl.org>