HASHIMOTO Taiichi
taiic****@users*****
2005年 9月 12日 (月) 18:13:21 JST
Index: inline_patch/ChangeLog diff -u inline_patch/ChangeLog:1.13 inline_patch/ChangeLog:1.14 --- inline_patch/ChangeLog:1.13 Mon Aug 8 13:25:37 2005 +++ inline_patch/ChangeLog Mon Sep 12 18:13:21 2005 @@ -1,3 +1,8 @@ +2005-09-04 HASHIMOTO Taiichi <taiic****@cl*****> + + * macim.c: èÝðubN·éæ¤ÉÏXD + Ï·ÌR}hüÍðÛD + 2005-08-08 HASHIMOTO Taiichi <taiic****@cl*****> * macim.c: mac-input-method Cxgð¶·éæ¤ÉÏXD Index: inline_patch/emacs-inline.patch diff -u inline_patch/emacs-inline.patch:1.16 inline_patch/emacs-inline.patch:1.17 --- inline_patch/emacs-inline.patch:1.16 Mon Aug 8 13:25:37 2005 +++ inline_patch/emacs-inline.patch Mon Sep 12 18:13:21 2005 @@ -1,6 +1,6 @@ -diff -N -r -p --exclude='*.orig' ../emacs-20050801-0/lisp/loadup.el lisp/loadup.el +diff -N -r -p ../emacs-20050801-0/lisp/loadup.el lisp/loadup.el *** ../emacs-20050801-0/lisp/loadup.el Mon Aug 1 17:05:45 2005 ---- lisp/loadup.el Thu Aug 4 18:59:44 2005 +--- lisp/loadup.el Mon Aug 8 11:20:35 2005 *************** *** 188,193 **** --- 188,196 ---- @@ -13,9 +13,9 @@ (message "%s" (garbage-collect)) (load "vc-hooks") -diff -N -r -p --exclude='*.orig' ../emacs-20050801-0/lisp/term/mac-im.el lisp/term/mac-im.el +diff -N -r -p ../emacs-20050801-0/lisp/term/mac-im.el lisp/term/mac-im.el *** ../emacs-20050801-0/lisp/term/mac-im.el Thu Jan 1 09:00:00 1970 ---- lisp/term/mac-im.el Fri Aug 5 23:09:19 2005 +--- lisp/term/mac-im.el Fri Sep 2 23:18:21 2005 *************** *** 0 **** --- 1,162 ---- @@ -181,9 +181,9 @@ + (define-key global-map [mac-input-method] 'mac-input-method-preedit) + (define-key isearch-mode-map [mac-input-method] 'mac-input-method-isearch-mode) + (define-key minibuffer-local-isearch-map [mac-input-method] 'mac-input-method-isearch-edit-string) -diff -N -r -p --exclude='*.orig' ../emacs-20050801-0/src/Makefile.in src/Makefile.in +diff -N -r -p ../emacs-20050801-0/src/Makefile.in src/Makefile.in *** ../emacs-20050801-0/src/Makefile.in Mon Aug 1 17:05:37 2005 ---- src/Makefile.in Thu Aug 4 18:59:44 2005 +--- src/Makefile.in Mon Aug 8 11:20:35 2005 *************** CYGWIN_OBJ = sheap.o *** 570,576 **** @@ -231,9 +231,9 @@ macselect.o: blockinput.h macterm.h macgui.h frame.h $(config_h) ${emacsapp}Contents/Resources/English.lproj: -diff -N -r -p --exclude='*.orig' ../emacs-20050801-0/src/keyboard.c src/keyboard.c +diff -N -r -p ../emacs-20050801-0/src/keyboard.c src/keyboard.c *** ../emacs-20050801-0/src/keyboard.c Mon Aug 1 17:05:37 2005 ---- src/keyboard.c Thu Aug 4 18:59:44 2005 +--- src/keyboard.c Mon Aug 8 11:20:35 2005 *************** Lisp_Object Qmouse_click; *** 528,533 **** --- 528,536 ---- @@ -277,12 +277,12 @@ Qdrag_n_drop = intern ("drag-n-drop"); staticpro (&Qdrag_n_drop); -diff -N -r -p --exclude='*.orig' ../emacs-20050801-0/src/macim.c src/macim.c +diff -N -r -p ../emacs-20050801-0/src/macim.c src/macim.c *** ../emacs-20050801-0/src/macim.c Thu Jan 1 09:00:00 1970 ---- src/macim.c Thu Aug 4 18:59:44 2005 +--- src/macim.c Fri Sep 2 23:55:27 2005 *************** *** 0 **** ---- 1,349 ---- +--- 1,376 ---- + /* Implementation of Inline Input Method for MacOS X. + Copyright (C) 2004, 2005 Taiichi Hashimoto <taiic****@mac*****>. + @@ -418,7 +418,9 @@ + (code) + Lisp_Object code; + { ++ BLOCK_INPUT; + KeyScript (XINT(code)); ++ UNBLOCK_INPUT; + + return Qnil; + } @@ -428,7 +430,13 @@ + doc: /* get current languge environment of MacOSX */) + () + { -+ return make_number (GetScriptManagerVariable (smKeyScript)); ++ SInt16 current_key_script; ++ ++ BLOCK_INPUT; ++ current_key_script = GetScriptManagerVariable (smKeyScript); ++ UNBLOCK_INPUT; ++ ++ return make_number (current_key_script); + } + + DEFUN ("mac-set-inline-input-method", Fmac_set_inline_input_method, @@ -438,23 +446,33 @@ + Lisp_Object on_p; + { + extern Lisp_Object Vmac_use_inline_input_method; -+ -+ if (NILP(on_p)) { -+ DeactivateTSMDocument (mac_tsm_doc_id); -+ Vmac_use_inline_input_method = Qnil; -+ } else { -+ ActivateTSMDocument (mac_tsm_doc_id); -+ Vmac_use_inline_input_method = Qt; -+ } ++ ++ BLOCK_INPUT; ++ ++ if (NILP(on_p)) ++ { ++ DeactivateTSMDocument (mac_tsm_doc_id); ++ Vmac_use_inline_input_method = Qnil; ++ } ++ else ++ { ++ ActivateTSMDocument (mac_tsm_doc_id); ++ Vmac_use_inline_input_method = Qt; ++ } ++ UNBLOCK_INPUT; + + return on_p; + } + + void -+ mac_store_change_language_event () ++ mac_store_change_language_event (unsigned long timestamp) + { + static SInt16 last_key_script = -1; -+ SInt16 current_key_script = GetScriptManagerVariable (smKeyScript); ++ SInt16 current_key_script; ++ ++ BLOCK_INPUT; ++ current_key_script = GetScriptManagerVariable (smKeyScript); ++ UNBLOCK_INPUT; + + if (last_key_script != current_key_script) + { @@ -464,19 +482,16 @@ + event.kind = LANGUAGE_CHANGE_EVENT; + event.arg = Qnil; + event.code = current_key_script; ++ event.timestamp = timestamp; + kbd_buffer_store_event (&event); + } ++ + last_key_script = current_key_script; + } + + int + mac_ignore_input_method () + { -+ extern Lisp_Object Vmac_use_inline_input_method; -+ -+ Fmac_set_inline_input_method (Vmac_use_inline_input_method); -+ mac_store_change_language_event (); -+ + if (this_command_key_count + || !NILP (current_buffer->read_only) + || cursor_in_echo_area) @@ -491,7 +506,9 @@ + UInt32 ekind = GetEventKind (event), eclass = GetEventClass (event); + OSStatus ret = noErr, err; + unsigned long timestamp = GetEventTime (event) / kEventDurationMillisecond; ++ static int converting = FALSE; + ++ BLOCK_INPUT; + switch (eclass) { + case kEventClassTextInput: + switch (ekind) { @@ -519,6 +536,7 @@ + TextRangeArray *array = NULL; + Lisp_Object argv[1024], triple[3]; + int argc = 0, i = 0; ++ + + GetEventParameter (event, kEventParamTextInputSendText, + typeChar, @@ -570,11 +588,16 @@ + } + if (src) xfree(src); + if (array) xfree(array); ++ ++ if (fixed_nbytes) converting = FALSE; ++ else converting = TRUE; + } + else + { /* src_nbytes == 0 */ + argv[argc++] = make_string("", 0); + argv[argc++] = make_number(0); ++ ++ converting = FALSE; + } + + { @@ -591,7 +614,7 @@ + case kEventTextInputGetSelectedText: + break; + case kEventTextInputUnicodeForKeyEvent: -+ ret = eventNotHandledErr; ++ if (!converting) ret = eventNotHandledErr; + break; + default: + break; @@ -600,7 +623,8 @@ + default: + break; + } -+ ++ UNBLOCK_INPUT; ++ + return ret; + } + @@ -610,8 +634,9 @@ + OSErr err; + InterfaceTypeList itl = { kTextService }; + ++ BLOCK_INPUT; + err = NewTSMDocument (1, itl, &mac_tsm_doc_id, 715); -+ if (err != noErr) abort (); ++ if (err != noErr) abort (); + + err = ActivateTSMDocument (mac_tsm_doc_id); + if (err != noErr) abort (); @@ -623,18 +648,20 @@ + NULL, + &mac_input_method_handler); + if (err != noErr) abort (); ++ UNBLOCK_INPUT; + } + + defsubr (&Smac_set_inline_input_method); + defsubr (&Smac_set_key_script); + defsubr (&Smac_get_key_script); ++ + } + + #endif + -diff -N -r -p --exclude='*.orig' ../emacs-20050801-0/src/macterm.c src/macterm.c +diff -N -r -p ../emacs-20050801-0/src/macterm.c src/macterm.c *** ../emacs-20050801-0/src/macterm.c Mon Aug 1 17:05:37 2005 ---- src/macterm.c Thu Aug 4 18:59:44 2005 +--- src/macterm.c Thu Aug 11 23:26:51 2005 *************** Lisp_Object Vx_toolkit_scroll_bars; *** 103,108 **** --- 103,111 ---- @@ -667,6 +694,18 @@ /*0x70*/ 0, 0xcc /*f15*/, 0x6a /*help*/, 0x50 /*home*/, *************** XTread_socket (sd, expected, hold_quit) +*** 9289,9294 **** +--- 9292,9300 ---- + int xkeysym; + + #if USE_CARBON_EVENTS && defined (MAC_OSX) ++ Fmac_set_inline_input_method (Vmac_use_inline_input_method); ++ mac_store_change_language_event (timestamp); ++ + /* When using Carbon Events, we need to pass raw keyboard + events to the TSM ourselves. If TSM handles it, it + will pass back noErr, otherwise it will pass back +*************** XTread_socket (sd, expected, hold_quit) *** 9300,9309 **** || !(er.modifiers & controlKey)) && (!NILP (Vmac_command_key_is_meta) @@ -678,7 +717,7 @@ #endif #if 0 ---- 9304,9317 ---- +--- 9306,9319 ---- || !(er.modifiers & controlKey)) && (!NILP (Vmac_command_key_is_meta) && NILP (Vmac_option_modifier) @@ -687,15 +726,35 @@ ! || mac_ignore_input_method ())) if (SendEventToEventTarget (eventRef, toolbox_dispatcher) ! != eventNotHandledErr) { -! mac_store_change_language_event (); +! mac_store_change_language_event (timestamp); break; + } #endif #if 0 +*************** XTread_socket (sd, expected, hold_quit) +*** 9316,9321 **** +--- 9326,9332 ---- + } + #endif + ++ #if 0 + { + static SInt16 last_key_script = -1; + SInt16 current_key_script = GetScriptManagerVariable (smKeyScript); +*************** XTread_socket (sd, expected, hold_quit) +*** 9334,9339 **** +--- 9345,9351 ---- + } + last_key_script = current_key_script; + } ++ #endif + + ObscureCursor (); + *************** mac_initialize () *** 10006,10011 **** ---- 10014,10021 ---- +--- 10018,10025 ---- init_service_handler (); init_quit_char_handler (); @@ -706,7 +765,7 @@ init_command_handler (); *************** Toolbox for processing before Emacs sees *** 10119,10124 **** ---- 10129,10137 ---- +--- 10133,10141 ---- Toolbox for processing before Emacs sees it. */); Vmac_pass_control_to_system = Qt; @@ -716,9 +775,9 @@ #endif DEFVAR_LISP ("mac-allow-anti-aliasing", &Vmac_use_core_graphics, -diff -N -r -p --exclude='*.orig' ../emacs-20050801-0/src/termhooks.h src/termhooks.h +diff -N -r -p ../emacs-20050801-0/src/termhooks.h src/termhooks.h *** ../emacs-20050801-0/src/termhooks.h Mon Aug 1 17:05:37 2005 ---- src/termhooks.h Thu Aug 4 18:59:44 2005 +--- src/termhooks.h Mon Aug 8 11:20:35 2005 *************** enum event_kind *** 259,264 **** --- 259,268 ----