changeset 30256:e4b4bca5087a

(kkc-after-update-conversion-functions): New variable. (kkc-update-conversion): Run functions in it at the tail.
author Kenichi Handa <handa@m17n.org>
date Mon, 17 Jul 2000 23:52:42 +0000
parents ed4c1e5caf4b
children eed8930dc4f7
files lisp/international/kkc.el
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/kkc.el	Mon Jul 17 23:52:13 2000 +0000
+++ b/lisp/international/kkc.el	Mon Jul 17 23:52:42 2000 +0000
@@ -212,6 +212,14 @@
 (defvar kkc-converting nil)
 
 ;;;###autoload
+(defvar kkc-after-update-conversion-functions nil
+  "Functions to run after a conversion is selected in `japanese' input method.
+With this input method, a user can select a proper conversion from
+candidate list.  Each time he changes the selection, functions in this
+list are called with two arguments; starting and ending buffer
+positions that contains the current selection.")
+
+;;;###autoload
 (defun kkc-region (from to)
   "Convert Kana string in the current region to Kanji-Kana mixed string.
 Users can select a desirable conversion interactively.
@@ -635,7 +643,11 @@
 	  (move-overlay kkc-overlay-head
 			(overlay-start kkc-overlay-head) pos)
 	  (delete-region (point) (overlay-end kkc-overlay-tail)))))
-  (goto-char (overlay-end kkc-overlay-tail)))
+  (unwind-protect
+      (run-hook-with-args 'kkc-after-update-conversion-functions
+			  (overlay-start kkc-overlay-head)
+			  (overlay-end kkc-overlay-head))
+    (goto-char (overlay-end kkc-overlay-tail))))
 
 ;;
 (provide 'kkc)