]> code.delx.au - gnu-emacs/blobdiff - lisp/language/japan-util.el
Switch to recommended form of GPLv3 permissions notice.
[gnu-emacs] / lisp / language / japan-util.el
index 97554d1c0de3b2438179dda9c26fb899bd932416..0b447721f1f4d32bc4db3999c788c681239a9ff5 100644 (file)
@@ -1,17 +1,20 @@
 ;;; japan-util.el --- utilities for Japanese -*- coding: iso-2022-7bit; -*-
 
-;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
-;; Licensed to the Free Software Foundation.
-;; Copyright (C) 2001 Free SOftware Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+;;   Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+;;   2005, 2006, 2007, 2008
+;;   National Institute of Advanced Industrial Science and Technology (AIST)
+;;   Registration Number H14PRO021
 
 ;; Keywords: mule, multilingual, Japanese
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
 ;;; Code:
 
-(defvar sentence-end-save nil)
-
 ;;;###autoload
 (defun setup-japanese-environment-internal ()
-  (cond ((eq system-type 'ms-dos)
-        (prefer-coding-system 'japanese-shift-jis))
-       ((eq system-type 'usg-unix-v)
-        (prefer-coding-system 'japanese-iso-8bit)))
-  (setq sentence-end-save sentence-end)
-  (setq sentence-end (concat sentence-end "\\|[\e$B!#!)!*\e(B]")))
-
-(defun exit-japanese-environment ()
-  (setq sentence-end sentence-end-save))
+  ;; By default, we use 'japanese-iso-8bit for file names.  But, the
+  ;; following prefer-coding-system will override it.
+  (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))
 
 (defconst japanese-kana-table
   '((?\e$B$"\e(B ?\e$B%"\e(B ?\e(I1\e(B) (?\e$B$$\e(B ?\e$B%$\e(B ?\e(I2\e(B) (?\e$B$&\e(B ?\e$B%&\e(B ?\e(I3\e(B) (?\e$B$(\e(B ?\e$B%(\e(B ?\e(I4\e(B) (?\e$B$*\e(B ?\e$B%*\e(B ?\e(I5\e(B)
@@ -107,7 +103,8 @@ HANKAKU-KATAKANA belongs to `japanese-jisx0201-kana'.")
     (?\e$B!-\e(B ?') (?\e$B!.\e(B ?`) (?\e$B!0\e(B ?^) (?\e$B!2\e(B ?_) (?\e$B!<\e(B ?- ?\e(I0\e(B) (?\e$B!=\e(B ?-) (?\e$B!>\e(B ?-)
     (?\e$B!?\e(B ?/) (?\e$B!@\e(B ?\\) (?\e$B!A\e(B ?~)  (?\e$B!C\e(B ?|) (?\e$B!F\e(B ?`) (?\e$B!G\e(B ?') (?\e$B!H\e(B ?\") (?\e$B!I\e(B ?\")
     (?\\e$B!J\e(B ?\() (?\\e$B!K\e(B ?\)) (?\\e$B!N\e(B ?[) (?\\e$B!O\e(B ?]) (?\\e$B!P\e(B ?{) (?\\e$B!Q\e(B ?})
-    (?\e$B!R\e(B ?<) (?\e$B!S\e(B ?>) (?\e$B!\\e(B ?+) (?\e$B!]\e(B ?-) (?\e$B!a\e(B ?=) (?\e$B!c\e(B ?<) (?\e$B!d\e(B ?>)
+    (?\e$B!R\e(B ?<) (?\e$B!S\e(B ?>) (?\\e$B!V\e(B nil ?\\e(I"\e(B) (?\\e$B!W\e(B nil ?\\e(I#\e(B) 
+    (?\e$B!\\e(B ?+) (?\e$B!]\e(B ?-) (?\e$B!a\e(B ?=) (?\e$B!c\e(B ?<) (?\e$B!d\e(B ?>)
     (?\e$B!l\e(B ?') (?\e$B!m\e(B ?\") (?\e$B!o\e(B ?\\) (?\e$B!p\e(B ?$) (?\e$B!s\e(B ?%) (?\e$B!t\e(B ?#) (?\e$B!u\e(B ?&) (?\e$B!v\e(B ?*)
     (?\e$B!w\e(B ?@))
   "Japanese JISX0208 symbol character table.
@@ -325,4 +322,5 @@ 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