1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-26 10:49:33 +00:00

(quail-japanese-kanji-kkc): Use marker to remember the conversion

start.
This commit is contained in:
Kenichi Handa 2000-11-18 00:04:54 +00:00
parent 3c7d764ed9
commit 5f1e183edd

View File

@ -79,22 +79,24 @@
;; (Kana Kanji Converter) utility.
(defun quail-japanese-kanji-kkc ()
(interactive)
(let ((from (overlay-start quail-conv-overlay))
(to (overlay-end quail-conv-overlay)))
(quail-delete-overlays)
(setq quail-current-str nil)
(when (= (char-before to) ?n)
(when (= (char-before (overlay-end quail-conv-overlay)) ?n)
;; The last char is `n'. We had better convert it to `$B$s(B'
;; before kana-kanji conversion.
(goto-char to)
(goto-char (overlay-end quail-conv-overlay))
(delete-char -1)
(insert ?$B$s(B))
(let ((result (kkc-region from to)))
(let* ((from (copy-marker (overlay-start quail-conv-overlay)))
(len (- (overlay-end quail-conv-overlay) from)))
(quail-delete-overlays)
(setq quail-current-str nil)
(unwind-protect
(let ((result (kkc-region from (+ from len))))
(move-overlay quail-conv-overlay from (point))
(setq quail-conversion-str (buffer-substring from (point)))
(if (= (+ from result) (point))
(setq quail-converting nil))
(setq quail-translating nil))))
(setq quail-translating nil))
(set-marker from nil))))
(defun quail-japanese-self-insert-and-switch-to-alpha (key idx)
(quail-delete-region)