From: Kenichi Handa Date: Fri, 16 Mar 2001 08:47:41 +0000 (+0000) Subject: (quail-japanese-kana-state): Delete this variable. X-Git-Tag: emacs-pretest-21.0.101~293 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bda0f1b37ec2719ca0176c013ea745c59f638b1f;p=emacs.git (quail-japanese-kana-state): Delete this variable. (quail-japanese-toggle-kana): Don't use quail-japanese-kana-state, instead check if there's any Hiraganas in the converison region. --- diff --git a/leim/quail/japanese.el b/leim/quail/japanese.el index 0b28aa0e7c0..69239d5b9f6 100644 --- a/leim/quail/japanese.el +++ b/leim/quail/japanese.el @@ -55,22 +55,17 @@ (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)))))