-(defun its-make-select-func (key name file map &optional lang zhuyin)
- (setq name (intern (concat "its-select-" (symbol-name name)))
- file (intern (concat "its/" (symbol-name file)))
- map (intern (concat "its-" (symbol-name map) "-map"))
- lang (symbol-name lang))
- (cons
- `(defun ,name (&optional mode-line-unchange)
- (interactive)
- (cond
- ((its-in-fence-p)
- (its-input-end)
- (its-put-cursor t))
- ((egg-get-bunsetsu-info (point))
- (egg-exit-conversion)))
- ,(if lang `(egg-check-language ,lang))
- (require ',file)
- (setq its-current-map ,map)
- ,(if lang `(setq its-current-language ,lang))
- ,(if zhuyin `(setq its-zhuyin ,(eq zhuyin 'T)))
- (if (null mode-line-unchange)
- (egg-set-mode-line-title)))
- `(define-key map ,(concat "\C-x\C-m" key) ',name)))
+(eval-and-compile
+ (defun its-make-select-func (key1 key2 func file map &optional zhuyin)
+ (setq func (intern (concat "its-select-" (symbol-name func)))
+ file (intern (concat "its/" (symbol-name file)))
+ map (intern (concat "its-" (symbol-name map) "-map")))
+ (cons
+ `(defun ,func (&optional temporally mode-line-unchange)
+ (interactive "P")
+ (if temporally
+ (its-select-mode-temporally ',func)
+ (let ((inhibit-read-only t))
+ (require ',file)
+ (cond
+ ((its-in-fence-p)
+ (its-input-end)
+ (its-put-cursor t))
+ ((egg-get-bunsetsu-info (point))
+ (egg-exit-conversion)))
+ (setq its-current-select-func ',func
+ its-current-map ',map)
+ (if (its-get-language ,map)
+ (setq its-current-language (its-get-language ,map)))
+ ,(if zhuyin `(setq its-zhuyin ,(eq zhuyin 'T)))
+ (if (null mode-line-unchange)
+ (its-set-mode-line-title)))))
+ `(,func ,(concat "\C-x\C-m" key1) ,(concat "\e" key2)))))