]> git.eshelyaron.com Git - emacs.git/commitdiff
(quail-japanese-kana-state): Delete this variable.
authorKenichi Handa <handa@m17n.org>
Fri, 16 Mar 2001 08:47:41 +0000 (08:47 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 16 Mar 2001 08:47:41 +0000 (08:47 +0000)
(quail-japanese-toggle-kana): Don't use quail-japanese-kana-state,
instead check if there's any Hiraganas in the converison region.

leim/quail/japanese.el

index 0b28aa0e7c0dd43d98f3f489c6337662027583a0..69239d5b9f64724603a134d2449498fd0c6d66d9 100644 (file)
                    (list (aref quail-current-key control-flag)))))))
   control-flag)
         
-;; Flag to control the behavior of `quail-japanese-toggle-kana'.
-(defvar quail-japanese-kana-state nil)
-(make-variable-buffer-local 'quail-japanese-kana-state)
-
 ;; Convert Hiragana <-> Katakana in the current translation region.
 (defun quail-japanese-toggle-kana ()
   (interactive)
   (setq quail-translating nil)
   (let ((start (overlay-start quail-conv-overlay))
        (end (overlay-end quail-conv-overlay)))
-    (setq quail-japanese-kana-state
-         (if (eq last-command this-command)
-             (not quail-japanese-kana-state)))
-    (if quail-japanese-kana-state
-       (japanese-hiragana-region start end)
-      (japanese-katakana-region start end))
+    (save-excursion
+      (goto-char start)
+      (if (re-search-forward "\\cH" end t)
+         (japanese-katakana-region start end)
+       (japanese-hiragana-region start end)))
     (setq quail-conversion-str
          (buffer-substring (overlay-start quail-conv-overlay)
                            (overlay-end quail-conv-overlay)))))