Mercurial > emacs
changeset 36834:ec1f6390f68e
(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.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 16 Mar 2001 08:47:41 +0000 |
parents | 96b2d9e4ef6d |
children | 7276cd2a0117 |
files | leim/quail/japanese.el |
diffstat | 1 files changed, 5 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/leim/quail/japanese.el Fri Mar 16 08:47:14 2001 +0000 +++ b/leim/quail/japanese.el Fri Mar 16 08:47:41 2001 +0000 @@ -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)))))