Add 2011 to FSF/AIST copyright years.
[bpt/emacs.git] / leim / quail / japanese.el
index 974a68c..517ade3 100644 (file)
@@ -1,6 +1,9 @@
 ;;; japanese.el --- Quail package for inputting Japanese  -*-coding: iso-2022-7bit;-*-
 
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2005
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+;;   Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+;;   2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 
 
 ;; 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
@@ -19,9 +22,7 @@
 ;; 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., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
                (or quail-current-str quail-current-key)
              ""))
     (if (integerp control-flag)
-       (if (= control-flag 0)
-           (setq quail-current-str (aref quail-current-key 0))
-         (cond ((= (aref quail-current-key 0) ?n)
+       (let ((keylen (length quail-current-key)))
+         (cond ((= control-flag 0)
+                (setq quail-current-str (aref quail-current-key 0)
+                      control-flag t))
+               ((= (aref quail-current-key 0) ?n)
                 (setq quail-current-str ?\e$B$s\e(B)
                 (if (and quail-japanese-use-double-n
+                         (> keylen 0)
                          (= (aref quail-current-key 1) ?n))
                     (setq control-flag t)))
-               ((= (aref quail-current-key 0) (aref quail-current-key 1))
+               ((and (> keylen 1)
+                     (= (aref quail-current-key 0) (aref quail-current-key 1)))
                 (setq quail-current-str ?\e$B$C\e(B))
                (t
                 (setq quail-current-str (aref quail-current-key 0))))
          (if (integerp control-flag)
              (setq unread-command-events
-                   (list (aref quail-current-key control-flag)))))))
+                   (string-to-list
+                    (substring quail-current-key control-flag)))))))
   control-flag)
 
 ;; Convert Hiragana <-> Katakana in the current translation region.
@@ -544,5 +550,5 @@ qq: toggle between this input method and the input method `japanese-ascii'.
                          (vector (japanese-katakana (aref trans 0))))
                         (t trans)))))
 
-;;; arch-tag: 47e0bfd4-6ecc-4d01-89a8-d687c5e01ff7
+;; arch-tag: 47e0bfd4-6ecc-4d01-89a8-d687c5e01ff7
 ;;; japanese.el ends here