comparison lisp/international/kkc.el @ 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 69c91eee7ba1
children 3c4025f3be8f
comparison
equal deleted inserted replaced
19405:7ef4af7505f2 19406:0933bf4b82c9
200 (setq kkc-length-converted 1 200 (setq kkc-length-converted 1
201 kkc-current-conversions-width nil 201 kkc-current-conversions-width nil
202 kkc-current-conversions (cons 0 nil))))))) 202 kkc-current-conversions (cons 0 nil)))))))
203 203
204 ;;;###autoload 204 ;;;###autoload
205 (defun kkc-region (from to) 205 (defun kkc-region (from to &optional kkc-mode-exit-function)
206 "Convert Kana string in the current region to Kanji-Kana mixed string. 206 "Convert Kana string in the current region to Kanji-Kana mixed string.
207 After one candidate of conversion is shown in the region, users are 207 After one candidate of conversion is shown in the region, users are
208 put in KKC major mode to select a desirable conversion." 208 put in KKC major mode to select a desirable conversion.
209 Optional arg KKC-MODE-EXIT-FUNCTION if non-nil is called on exiting KKC mode."
209 (interactive "r") 210 (interactive "r")
210 (setq kkc-original-kana (buffer-substring from to)) 211 (setq kkc-original-kana (buffer-substring from to))
211 (goto-char from) 212 (goto-char from)
212 213
213 ;; Setup overlays. 214 ;; Setup overlays.
244 (kkc-mode) 245 (kkc-mode)
245 (recursive-edit)) 246 (recursive-edit))
246 (goto-char (overlay-end kkc-overlay-tail)) 247 (goto-char (overlay-end kkc-overlay-tail))
247 (delete-overlay kkc-overlay-head) 248 (delete-overlay kkc-overlay-head)
248 (delete-overlay kkc-overlay-tail) 249 (delete-overlay kkc-overlay-tail)
249 (use-local-map previous-local-map))) 250 (use-local-map previous-local-map)
250 kkc-canceled) 251 (if (and kkc-mode-exit-function
252 (fboundp kkc-mode-exit-function))
253 (funcall kkc-mode-exit-function (if kkc-canceled
254 (cons kkc-canceled (point))))))))
251 255
252 (defun kkc-terminate () 256 (defun kkc-terminate ()
253 "Exit from KKC mode by fixing the current conversion." 257 "Exit from KKC mode by fixing the current conversion."
254 (interactive) 258 (interactive)
255 (throw 'exit nil)) 259 (throw 'exit nil))