(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