changeset 19406:0933bf4b82c9

(kkc-region): New arg kkc-mode-exit-function.
author Kenichi Handa <handa@m17n.org>
date Mon, 18 Aug 1997 10:51:45 +0000
parents 7ef4af7505f2
children 50444ccff3f2
files lisp/international/kkc.el
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/kkc.el	Mon Aug 18 10:51:45 1997 +0000
+++ b/lisp/international/kkc.el	Mon Aug 18 10:51:45 1997 +0000
@@ -202,10 +202,11 @@
 		  kkc-current-conversions (cons 0 nil)))))))
 
 ;;;###autoload
-(defun kkc-region (from to)
+(defun kkc-region (from to &optional kkc-mode-exit-function)
   "Convert Kana string in the current region to Kanji-Kana mixed string.
 After one candidate of conversion is shown in the region, users are
-put in KKC major mode to select a desirable conversion."
+put in KKC major mode to select a desirable conversion.
+Optional arg KKC-MODE-EXIT-FUNCTION if non-nil is called on exiting KKC mode."
   (interactive "r")
   (setq kkc-original-kana (buffer-substring from to))
   (goto-char from)
@@ -246,8 +247,11 @@
       (goto-char (overlay-end kkc-overlay-tail))
       (delete-overlay kkc-overlay-head)
       (delete-overlay kkc-overlay-tail)
-      (use-local-map previous-local-map)))
-  kkc-canceled)
+      (use-local-map previous-local-map)
+      (if (and kkc-mode-exit-function
+	       (fboundp kkc-mode-exit-function))
+	  (funcall kkc-mode-exit-function (if kkc-canceled
+					      (cons kkc-canceled (point))))))))
 
 (defun kkc-terminate ()
   "Exit from KKC mode by fixing the current conversion."