X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/a971635315e259c076de020b3676c04d1dcc415e..f998bbe793e9ae7a8df071fec7de63879e67ef1a:/lisp/language/japan-util.el diff --git a/lisp/language/japan-util.el b/lisp/language/japan-util.el index 0b447721f1..9be3c44b4d 100644 --- a/lisp/language/japan-util.el +++ b/lisp/language/japan-util.el @@ -1,9 +1,8 @@ ;;; japan-util.el --- utilities for Japanese -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -;; Free Software Foundation, Inc. +;; Copyright (C) 2001-2012 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008 +;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H14PRO021 @@ -35,7 +34,7 @@ (if (memq system-type '(windows-nt ms-dos cygwin)) (prefer-coding-system 'japanese-shift-jis) (prefer-coding-system 'japanese-iso-8bit)) - (use-cjk-char-width-table)) + (use-cjk-char-width-table 'ja_JP)) (defconst japanese-kana-table '((?$B$"(B ?$B%"(B ?(I1(B) (?$B$$(B ?$B%$(B ?(I2(B) (?$B$&(B ?$B%&(B ?(I3(B) (?$B$((B ?$B%((B ?(I4(B) (?$B$*(B ?$B%*(B ?(I5(B) @@ -106,11 +105,13 @@ HANKAKU-KATAKANA belongs to `japanese-jisx0201-kana'.") (?$B!R(B ?<) (?$B!S(B ?>) (?\$B!V(B nil ?\(I"(B) (?\$B!W(B nil ?\(I#(B) (?$B!\(B ?+) (?$B!](B ?-) (?$B!a(B ?=) (?$B!c(B ?<) (?$B!d(B ?>) (?$B!l(B ?') (?$B!m(B ?\") (?$B!o(B ?\\) (?$B!p(B ?$) (?$B!s(B ?%) (?$B!t(B ?#) (?$B!u(B ?&) (?$B!v(B ?*) - (?$B!w(B ?@)) - "Japanese JISX0208 symbol character table. + (?$B!w(B ?@) + ;; cp932-2-byte + (#x2015 ?-) (#xFF5E ?~) (#xFF0D ?-)) + "Japanese JISX0208 and CP932 symbol character table. Each element is of the form (SYMBOL ASCII HANKAKU), where SYMBOL -belongs to `japanese-jisx0208', ASCII belongs to `ascii', and HANKAKU -belongs to `japanese-jisx0201-kana'.") +belongs to `japanese-jisx0208' or `cp932', ASCII belongs to `ascii', +and HANKAKU belongs to `japanese-jisx0201-kana'.") ;; Put properties 'jisx0208, 'jisx0201, and 'ascii to each Japanese ;; symbol and ASCII characters for conversion among them. @@ -123,11 +124,13 @@ belongs to `japanese-jisx0201-kana'.") (if ascii (progn (put-char-code-property jisx0208 'ascii ascii) - (put-char-code-property ascii 'jisx0208 jisx0208))) + (if (encode-char jisx0208 'japanese-jisx0208) + (put-char-code-property ascii 'jisx0208 jisx0208)))) (if jisx0201 (progn (put-char-code-property jisx0208 'jisx0201 jisx0201) - (put-char-code-property jisx0201 'jisx0208 jisx0208))))) + (if (encode-char jisx0208 'japanese-jisx0208) + (put-char-code-property jisx0201 'jisx0208 jisx0208)))))) (defconst japanese-alpha-numeric-table '((?$B#0(B . ?0) (?$B#1(B . ?1) (?$B#2(B . ?2) (?$B#3(B . ?3) (?$B#4(B . ?4) @@ -160,8 +163,7 @@ belongs to `japanese-jisx0208', ASCII belongs to `ascii'.") ;; Convert string STR by FUNC and return a resulting string. (defun japanese-string-conversion (str func &rest args) (let ((buf (get-buffer-create " *Japanese work*"))) - (save-excursion - (set-buffer buf) + (with-current-buffer buf (erase-buffer) (insert str) (apply func 1 (point) args) @@ -322,5 +324,4 @@ If non-nil, second arg INITIAL-INPUT is a string to insert before reading." ;; (provide 'japan-util) -;; arch-tag: b579595c-c9ad-4b57-9314-98cd8b214f89 ;;; japan-util.el ends here