Ticket #173 (new 不具合)

Opened 3 years ago

Last modified 3 years ago

wrap-funcrion-to-control-ime

Reported by: anonymous Assigned to:
Priority: major Milestone:
Component: Emacs Lisp Version: 2.10
Keywords: ime,wrap Cc:

Description (Last modified by gotoh)

IMEをONの状態で(y-or-n-p "aa")になると、いちいち切り替えが必要なので厄介ですから、 wrap-funcrion-to-control-ime をつかっていました。

今回の版では、これがうまく機能しない場合があるような気がします。以下のような臨時の 関数を定義して、代わりに使ってしのいでいます。

どんなものでしょうか。

;;; wrap-function-to-control-ime-patch.el
;;; パッチをあてたwrap-function-to-control-ime
;;; ■■Fri Sep 23 02:56:57 2005■■
;;;

(defun wrap-function-to-control-ime-patch
  (function interactive-p interactive-arg &optional suffix)
  "Wrap FUNCTION, and IME control is enabled when FUNCTION is called. \n\
An original function is saved to FUNCTION-SUFFIX when suffix is string. \n\
If SUFFIX is nil, \"-original\" is added. \n\
------patch-----------------------------------------------------------\n\
理由はよくわからないのだが、fep-force-offをfep-get-modeがnilになるまで\n\
messageでタイミングをとりながら繰り返さないと、だめみたい。以前も\n\
なにか似たようなめにあったことが・・・\n\
もとのwrap-function-to-control-imeを変えてしまうのはちょっと心配\n\
なので、別関数として、y-or-n-pにのみ適用した。"
  ;;;
  (let ((original-function
	 (intern (concat (symbol-name function)
			 (if suffix suffix "-original")))))
    (cond ((not (fboundp original-function))
	   (fset original-function
		 (symbol-function function))
	   (fset function
		 (list 
		  'lambda '(&rest arguments)
		  (if interactive-p
		      (list 'interactive interactive-arg))
		  (` (cond ((fep-get-mode)
			    (progn
			      ;; 回している。単発だと、うまくいかない
			      ;; ことがわかっている。
			      (while (fep-get-mode)
				(fep-force-off)
				;; offにしてから待ちをおかないと
				;; どうもすり抜けるようだ。そのための
				;; 待ちをどういれるか、実験のあと。
				;; (sit-for 0) ;;xx
				;; (sit-for 0)(sit-for 0) ;;xx
				;; (message "") ;;xx
				;; (message "off") ;;oo
				;; 
				(message " ") ;;oo
				;; (message "")(message "") ;;oo
				;; なお、mw32はfepよりも下位にある
				;; らしく、だめ。
				;; (mw32-ime-toggle)
				)
			      )
			    ;; 以下はオリジナルのまま。
			    (unwind-protect
				(apply '(, original-function) arguments)
			      (if mw32-ime-state
				  (fep-force-on))))
			   (t
			    (apply '(, original-function)
				   arguments))))))))))
;;; end

Attachments

wrap-function-to-control-ime-patch.el (2.0 kB) - added by anonymous on 09/24/05 03:10:28.

Change History

09/24/05 03:10:28 changed by anonymous

  • attachment wrap-function-to-control-ime-patch.el added.

09/24/05 04:11:19 changed by gotoh

  • description changed.

wiki書式にあわせて修正


Add/Change #173 (wrap-funcrion-to-control-ime)




Change Properties
Action