From bda0f1b37ec2719ca0176c013ea745c59f638b1f Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 16 Mar 2001 08:47:41 +0000 Subject: [PATCH] (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. --- leim/quail/japanese.el | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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))))) -- 2.39.2