Commit bda0f1b3 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(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.
parent 1bdfe188
......@@ -55,22 +55,17 @@
(list (aref quail-current-key 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 ()
(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))
(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)))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment