From: Kenichi Handa Date: Tue, 23 Jun 2009 02:11:35 +0000 (+0000) Subject: (hangul-to-hanja-conversion): When it is called X-Git-Tag: emacs-pretest-23.1.90~2462 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8000b1d55bd9700de61660c7f6ce7939de5e2eab;p=emacs.git (hangul-to-hanja-conversion): When it is called while korean input method is off, convert the following character. --- diff --git a/leim/quail/hangul.el b/leim/quail/hangul.el index 6ebfd2ef03c..3f963d732f8 100644 --- a/leim/quail/hangul.el +++ b/leim/quail/hangul.el @@ -355,17 +355,24 @@ Other parts are the same as a `hangul3-input-method-cho'." (delete-backward-char 1))) (defun hangul-to-hanja-conversion () - "Convert the previous hangul character to the corresponding hanja character." + "Convert the previous hangul character to the corresponding hanja character. +When a Korean input method is off, convert the following hangul character." (interactive) (let ((echo-keystrokes 0) delete-func hanja-character) - (setq hanja-character (hangul-to-hanja-char (preceding-char))) + (if (and (overlayp quail-overlay) (overlay-start quail-overlay)) + (progn + (setq hanja-character (hangul-to-hanja-char (preceding-char))) + (setq delete-func (lambda () (delete-backward-char 1)))) + (setq hanja-character (hangul-to-hanja-char (following-char))) + (setq delete-func (lambda () (delete-char 1)))) (when hanja-character - (delete-backward-char 1) + (funcall delete-func) (insert hanja-character) (setq hangul-queue (make-vector 6 0)) - (move-overlay quail-overlay (point) (point))))) + (if (and (overlayp quail-overlay) (overlay-start quail-overlay)) + (move-overlay quail-overlay (point) (point)))))) ;; Support function for `hangul2-input-method'. Actually, this ;; function handles the Hangul 2-Bulsik. KEY is an entered key code