(empty log message)
@@ -1,5 +1,5 @@ | ||
1 | 1 | *** ../emacs-23.1.91/lisp/term/ns-win.el 2009-12-31 02:14:11.000000000 +0900 |
2 | ---- lisp/term/ns-win.el 2010-01-02 22:49:29.000000000 +0900 | |
2 | +--- lisp/term/ns-win.el 2010-01-15 13:52:23.000000000 +0900 | |
3 | 3 | *************** The properties returned may include `top |
4 | 4 | *** 315,320 **** |
5 | 5 | --- 315,321 ---- |
@@ -153,19 +153,9 @@ | ||
153 | 153 | (cond |
154 | 154 | ((and (overlayp ns-working-overlay) |
155 | 155 | ;; Still alive? |
156 | -*************** See `ns-insert-working-text'." | |
157 | -*** 630,636 **** | |
158 | - (message "%s" msg)))) | |
159 | - (setq ns-working-overlay nil)) | |
160 | - | |
161 | -- | |
162 | - (declare-function ns-convert-utf8-nfd-to-nfc "nsfns.m" (str)) | |
163 | - | |
164 | - ;;;; OS X file system Unicode UTF-8 NFD (decomposed form) support | |
165 | ---- 693,698 ---- | |
166 | 156 | *************** the operating system.") |
167 | 157 | *** 1263,1268 **** |
168 | ---- 1325,1696 ---- | |
158 | +--- 1326,1708 ---- | |
169 | 159 | (add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system)) |
170 | 160 | |
171 | 161 |
@@ -386,7 +376,7 @@ | ||
386 | 376 | + (defun mac-set-input-method-parameter (is key value) |
387 | 377 | + "Function to set a parameter of a input method." |
388 | 378 | + (let* ((is-param (assoc is mac-input-method-parameters)) |
389 | -+ (param (assq key is-param))) | |
379 | ++ (param (assq key is-param))) | |
390 | 380 | + (if is-param |
391 | 381 | + (if param |
392 | 382 | + (setcdr param value) |
@@ -401,8 +391,8 @@ | ||
401 | 391 | + (interactive) |
402 | 392 | + |
403 | 393 | + (let ((title (mac-get-input-method-title is)) |
404 | -+ (type (mac-get-cursor-type is)) | |
405 | -+ (color (mac-get-cursor-color is))) | |
394 | ++ (type (mac-get-cursor-type is)) | |
395 | ++ (color (mac-get-cursor-color is))) | |
406 | 396 | + (if (and title (not (equal title (mac-get-input-method-title)))) |
407 | 397 | + (setq current-input-method-title title)) |
408 | 398 | + (if (and type (not (equal type (mac-get-cursor-type)))) |
@@ -416,13 +406,23 @@ | ||
416 | 406 | + (defun mac-toggle-input-method (&optional arg) |
417 | 407 | + "Function to toggle input method on MacOSX." |
418 | 408 | + (interactive) |
419 | -+ (mac-set-ascii-input-source)) | |
409 | ++ | |
410 | ++ (if arg | |
411 | ++ (progn | |
412 | ++ (make-local-variable 'input-method-function) | |
413 | ++ (setq inactivate-current-input-method-function 'mac-toggle-input-method) | |
414 | ++ (setq input-method-function nil) | |
415 | ++ (setq describe-current-input-method-function nil) | |
416 | ++ (mac-toggle-input-source t)) | |
417 | ++ (kill-local-variable 'input-method-function) | |
418 | ++ (setq describe-current-input-method-function nil) | |
419 | ++ (mac-toggle-input-source nil))) | |
420 | 420 | + |
421 | 421 | + |
422 | 422 | + (defun mac-change-language-to-us () |
423 | -+ "Function to change language (Apple Key Script) to us." | |
423 | ++ "Function to change language to us." | |
424 | 424 | + (interactive) |
425 | -+ (mac-set-ascii-input-source)) | |
425 | ++ (mac-toggle-input-method nil)) | |
426 | 426 | + |
427 | 427 | + |
428 | 428 | + (defun mac-handle-input-method-change () |
@@ -429,15 +429,16 @@ | ||
429 | 429 | + "Function run when a input method change." |
430 | 430 | + (interactive) |
431 | 431 | + |
432 | -+ (let ((input-source (mac-get-current-input-source))) | |
433 | -+ (if (and (equal default-input-method "MacOSX") | |
434 | -+ (not current-input-method)) | |
435 | -+ (set-input-method "MacOSX")) | |
436 | -+ | |
437 | -+ (if (equal current-input-method "MacOSX") | |
432 | ++ (if (equal default-input-method "MacOSX") | |
433 | ++ (let ((input-source (mac-get-current-input-source)) | |
434 | ++ (ascii-capable (mac-input-source-is-ascii-capable))) | |
435 | ++ | |
436 | ++ (cond ((and (not current-input-method) (not ascii-capable)) | |
437 | ++ (set-input-method "MacOSX")) | |
438 | ++ ((and (equal current-input-method "MacOSX") ascii-capable) | |
439 | ++ (toggle-input-method nil))) | |
438 | 440 | + (mac-input-method-update input-source)))) |
439 | 441 | + |
440 | -+ | |
441 | 442 | + ;; |
442 | 443 | + ;; Emacs input method for input method on MacOSX. |
443 | 444 | + ;; |
@@ -540,7 +541,7 @@ | ||
540 | 541 | ;; arch-tag: eb138a45-4e2e-4d68-b1c9-a39665731644 |
541 | 542 | diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/Makefile.in src/Makefile.in |
542 | 543 | *** ../emacs-23.1.91/src/Makefile.in 2009-12-31 02:14:09.000000000 +0900 |
543 | ---- src/Makefile.in 2010-01-02 12:21:53.000000000 +0900 | |
544 | +--- src/Makefile.in 2010-01-04 21:05:27.000000000 +0900 | |
544 | 545 | *************** ns_appresdir=@ns_appresdir@/ |
545 | 546 | *** 542,548 **** |
546 | 547 | ns_appsrc=@ns_appsrc@ |
@@ -587,7 +588,7 @@ | ||
587 | 588 | blockinput.h atimer.h charset.h coding.h ccl.h msdos.h composite.h \ |
588 | 589 | diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/keyboard.c src/keyboard.c |
589 | 590 | *** ../emacs-23.1.91/src/keyboard.c 2009-12-31 02:14:07.000000000 +0900 |
590 | ---- src/keyboard.c 2010-01-02 12:21:53.000000000 +0900 | |
591 | +--- src/keyboard.c 2010-01-04 21:05:27.000000000 +0900 | |
591 | 592 | *************** kbd_buffer_get_event (kbp, used_mouse_me |
592 | 593 | *** 4185,4192 **** |
593 | 594 | { |
@@ -622,12 +623,12 @@ | ||
622 | 623 | But `handle-switch-frame is not run from the special-map. |
623 | 624 | diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/macim.m src/macim.m |
624 | 625 | *** ../emacs-23.1.91/src/macim.m 1970-01-01 09:00:00.000000000 +0900 |
625 | ---- src/macim.m 2010-01-02 12:21:53.000000000 +0900 | |
626 | +--- src/macim.m 2010-01-15 13:25:09.000000000 +0900 | |
626 | 627 | *************** |
627 | 628 | *** 0 **** |
628 | ---- 1,196 ---- | |
629 | +--- 1,165 ---- | |
629 | 630 | + /* Implementation of Input Method Extension for MacOS X. |
630 | -+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 | |
631 | ++ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 | |
631 | 632 | + Taiichi Hashimoto <taiichi2@mac.com>. |
632 | 633 | + */ |
633 | 634 | + |
@@ -669,22 +670,17 @@ | ||
669 | 670 | + int mac_pass_key_to_system (int code, UInt32 modifiers); |
670 | 671 | + int mac_store_change_input_method_event (); |
671 | 672 | + |
672 | -+ static BOOL equal_input_source(TISInputSourceRef a, TISInputSourceRef b) | |
673 | ++ DEFUN ("mac-input-source-is-ascii-capable", Fmac_input_source_is_ascii_capable, | |
674 | ++ Smac_input_source_is_ascii_capable, 0, 0, 0, | |
675 | ++ doc: /* Is current input source ascii capable? */) | |
676 | ++ () | |
673 | 677 | + { |
674 | -+ if (!(a && b)) return NO; | |
678 | ++ TISInputSourceRef is = TISCopyCurrentKeyboardInputSource(); | |
679 | ++ CFBooleanRef ret = TISGetInputSourceProperty(is, kTISPropertyInputSourceIsASCIICapable); | |
675 | 680 | + |
676 | -+ NSString* as = TISGetInputSourceProperty(a, kTISPropertyInputSourceID); | |
677 | -+ NSString* bs = TISGetInputSourceProperty(b, kTISPropertyInputSourceID); | |
678 | -+ | |
679 | -+ return [as isEqualToString:bs]; | |
681 | ++ return CFBooleanGetValue(ret)? Qt : Qnil; | |
680 | 682 | + } |
681 | 683 | + |
682 | -+ static BOOL current_input_source_is_ascii_capable() | |
683 | -+ { | |
684 | -+ TISInputSourceRef is = TISCopyCurrentKeyboardInputSource(); | |
685 | -+ return TISGetInputSourceProperty(is, kTISPropertyInputSourceIsASCIICapable); | |
686 | -+ } | |
687 | -+ | |
688 | 684 | + DEFUN ("mac-get-input-source-list", Fmac_get_input_source_list, |
689 | 685 | + Smac_get_input_source_list, 0, 0, 0, |
690 | 686 | + doc: /* get input source list on MacOSX */) |
@@ -715,55 +711,28 @@ | ||
715 | 711 | + return make_string([id cString], [id length]); |
716 | 712 | + } |
717 | 713 | + |
718 | -+ DEFUN ("mac-set-ascii-input-source", Fmac_set_ascii_input_source, | |
719 | -+ Smac_set_ascii_input_source, 0, 0, 0, | |
720 | -+ doc: /* set ascii input source on MacOSX */) | |
721 | -+ () | |
714 | ++ DEFUN ("mac-toggle-input-source", Fmac_toggle_input_source, | |
715 | ++ Smac_toggle_input_source, 1, 1, 0, | |
716 | ++ doc: /* toggle input source on MacOSX */) | |
717 | ++ (arg) | |
718 | ++ Lisp_Object arg; | |
722 | 719 | + { |
723 | -+ TISInputSourceRef is = TISCopyCurrentASCIICapableKeyboardInputSource(); | |
724 | -+ if (is) | |
720 | ++ TISInputSourceRef is = NULL; | |
721 | ++ | |
722 | ++ if (NILP (arg)) | |
725 | 723 | + { |
726 | -+ TISSelectInputSource(is); | |
724 | ++ is = TISCopyCurrentASCIICapableKeyboardInputSource(); | |
727 | 725 | + } |
726 | ++ else | |
727 | ++ { | |
728 | ++ NSString *locale = [[NSLocale currentLocale] localeIdentifier]; | |
729 | ++ is = TISCopyInputSourceForLanguage(locale); | |
730 | ++ } | |
731 | ++ if (is) TISSelectInputSource(is); | |
728 | 732 | + |
729 | -+ return Qnil; | |
733 | ++ return arg; | |
730 | 734 | + } |
731 | 735 | + |
732 | -+ | |
733 | -+ DEFUN ("mac-get-input-source-for-current-language", Fmac_get_input_source_for_current_language, | |
734 | -+ Smac_get_input_source_for_current_language, 0, 0, 0, | |
735 | -+ doc: /* set ascii input source on MacOSX */) | |
736 | -+ () | |
737 | -+ { | |
738 | -+ NSString *locale = [[NSLocale currentLocale] localeIdentifier]; | |
739 | -+ TISInputSourceRef is = TISCopyInputSourceForLanguage((CFStringRef)locale); | |
740 | -+ NSString *id = (NSString *)TISGetInputSourceProperty(is, kTISPropertyInputSourceID); | |
741 | -+ | |
742 | -+ return make_string([id cString], [id length]); | |
743 | -+ } | |
744 | -+ | |
745 | -+ // DEFUN ("mac-toggle-input-method", Fmac_toggle_input_method, | |
746 | -+ // Smac_toggle_input_method, 0, 0, 0, | |
747 | -+ // doc: /* set ascii input source on MacOSX */) | |
748 | -+ // () | |
749 | -+ // { | |
750 | -+ // TISInputSourceRef is = TISCopyCurrentKeyboardInputSource(); | |
751 | -+ | |
752 | -+ // if (TISGetInputSourceProperty(is, kTISPropertyInputSourceIsASCIICapable)) | |
753 | -+ // { | |
754 | -+ // TISSelectInputSource(last_input_source); | |
755 | -+ // last_input_source = current_input_source; | |
756 | -+ // } | |
757 | -+ // else | |
758 | -+ // { | |
759 | -+ // Fmac_set_ascii_input_source(); | |
760 | -+ // } | |
761 | -+ // TISInputSourceRef is = TISCopyInputSourceForLanguage((CFStringRef)locale); | |
762 | -+ // NSString *id = (NSString *)TISGetInputSourceProperty(is, kTISPropertyInputSourceID); | |
763 | -+ | |
764 | -+ // return make_string([id cString], [id length]); | |
765 | -+ // } | |
766 | -+ | |
767 | 736 | + int |
768 | 737 | + mac_store_change_input_method_event () |
769 | 738 | + { |
@@ -783,29 +752,30 @@ | ||
783 | 752 | + int |
784 | 753 | + mac_pass_key_to_system (int code, UInt32 modifiers) |
785 | 754 | + { |
786 | -+ BOOL ascii_capable = current_input_source_is_ascii_capable(); | |
755 | ++ Lisp_Object ascii_capable = Fmac_input_source_is_ascii_capable(); | |
787 | 756 | + Lisp_Object keys = Fsymbol_value (Qmac_ignore_shortcut); |
788 | 757 | + Lisp_Object m, k; |
789 | 758 | + |
790 | -+ if (!ascii_capable | |
791 | -+ && (this_command_key_count || cursor_in_echo_area)) | |
792 | -+ return FALSE; | |
793 | -+ else if (!ascii_capable | |
794 | -+ && !NILP (current_buffer->read_only)) | |
795 | -+ return FALSE; | |
796 | -+ else | |
797 | -+ while (!NILP (keys)) | |
798 | -+ { | |
799 | -+ m = XCAR (XCAR (keys)); | |
800 | -+ k = XCDR (XCAR (keys)); | |
801 | -+ keys = XCDR (keys); | |
759 | ++ if (NILP (ascii_capable)) | |
760 | ++ { | |
761 | ++ if (this_command_key_count | |
762 | ++ || cursor_in_echo_area | |
763 | ++ || !NILP (current_buffer->read_only)) | |
764 | ++ return FALSE; | |
765 | ++ } | |
766 | ++ | |
767 | ++ while (!NILP (keys)) | |
768 | ++ { | |
769 | ++ m = XCAR (XCAR (keys)); | |
770 | ++ k = XCDR (XCAR (keys)); | |
771 | ++ keys = XCDR (keys); | |
802 | 772 | + |
803 | -+ if (NUMBERP (m) && modifiers == XINT (m)) | |
804 | -+ if (NILP (k) | |
805 | -+ || (NUMBERP (k) && code == XINT (k))) | |
806 | -+ return FALSE; | |
807 | -+ } | |
808 | -+ | |
773 | ++ if (NUMBERP (m) && modifiers == XINT (m)) | |
774 | ++ if (NILP (k) | |
775 | ++ || (NUMBERP (k) && code == XINT (k))) | |
776 | ++ return FALSE; | |
777 | ++ } | |
778 | ++ | |
809 | 779 | + return TRUE; |
810 | 780 | + } |
811 | 781 | + |
@@ -815,16 +785,16 @@ | ||
815 | 785 | + Qmac_ignore_shortcut = intern ("mac-ignore-shortcut"); |
816 | 786 | + staticpro (&Qmac_ignore_shortcut); |
817 | 787 | + |
788 | ++ defsubr (&Smac_input_source_is_ascii_capable); | |
818 | 789 | + defsubr (&Smac_get_input_source_list); |
819 | 790 | + defsubr (&Smac_get_current_input_source); |
820 | -+ defsubr (&Smac_set_ascii_input_source); | |
821 | -+ defsubr (&Smac_get_input_source_for_current_language); | |
791 | ++ defsubr (&Smac_toggle_input_source); | |
822 | 792 | + } |
823 | 793 | + |
824 | 794 | + #endif |
825 | 795 | diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/nsfns.m src/nsfns.m |
826 | 796 | *** ../emacs-23.1.91/src/nsfns.m 2009-12-31 02:14:11.000000000 +0900 |
827 | ---- src/nsfns.m 2010-01-02 12:21:53.000000000 +0900 | |
797 | +--- src/nsfns.m 2010-01-04 21:05:27.000000000 +0900 | |
828 | 798 | *************** be used as the image of the icon represe |
829 | 799 | *** 2676,2681 **** |
830 | 800 | --- 2676,2685 ---- |
@@ -840,7 +810,7 @@ | ||
840 | 810 | |
841 | 811 | diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/nsterm.h src/nsterm.h |
842 | 812 | *** ../emacs-23.1.91/src/nsterm.h 2009-12-31 02:14:11.000000000 +0900 |
843 | ---- src/nsterm.h 2010-01-02 12:21:53.000000000 +0900 | |
813 | +--- src/nsterm.h 2010-01-04 21:05:27.000000000 +0900 | |
844 | 814 | *************** typedef unsigned int NSUInteger; |
845 | 815 | *** 365,370 **** |
846 | 816 | --- 365,371 ---- |
@@ -853,7 +823,7 @@ | ||
853 | 823 | for managing a table of bitmap "records" */ |
854 | 824 | diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/nsterm.m src/nsterm.m |
855 | 825 | *** ../emacs-23.1.91/src/nsterm.m 2009-12-31 02:14:11.000000000 +0900 |
856 | ---- src/nsterm.m 2010-01-02 18:08:20.000000000 +0900 | |
826 | +--- src/nsterm.m 2010-01-15 13:26:00.000000000 +0900 | |
857 | 827 | *************** ns_term_init (Lisp_Object display_name) |
858 | 828 | *** 3721,3726 **** |
859 | 829 | --- 3721,3729 ---- |
@@ -888,23 +858,6 @@ | ||
888 | 858 | - (void)sendEvent: (NSEvent *)theEvent |
889 | 859 | /* -------------------------------------------------------------------------- |
890 | 860 | *************** extern void update_window_cursor (struct |
891 | -*** 4337,4343 **** | |
892 | - | |
893 | - /*****************************************************************************/ | |
894 | - /* Keyboard handling. */ | |
895 | -! #define NS_KEYLOG 0 | |
896 | - | |
897 | - - (void)keyDown: (NSEvent *)theEvent | |
898 | - { | |
899 | ---- 4352,4358 ---- | |
900 | - | |
901 | - /*****************************************************************************/ | |
902 | - /* Keyboard handling. */ | |
903 | -! #define NS_KEYLOG 1 | |
904 | - | |
905 | - - (void)keyDown: (NSEvent *)theEvent | |
906 | - { | |
907 | -*************** extern void update_window_cursor (struct | |
908 | 861 | *** 4478,4483 **** |
909 | 862 | --- 4493,4499 ---- |
910 | 863 |
@@ -1028,7 +981,7 @@ | ||
1028 | 981 | pt = [[self window] convertBaseToScreen: pt]; |
1029 | 982 | diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/s/darwin.h src/s/darwin.h |
1030 | 983 | *** ../emacs-23.1.91/src/s/darwin.h 2009-12-31 02:13:53.000000000 +0900 |
1031 | ---- src/s/darwin.h 2010-01-02 12:21:53.000000000 +0900 | |
984 | +--- src/s/darwin.h 2010-01-04 21:05:27.000000000 +0900 | |
1032 | 985 | *************** along with GNU Emacs. If not, see <http |
1033 | 986 | *** 145,151 **** |
1034 | 987 | /* Definitions for how to compile & link. */ |
@@ -1,3 +1,8 @@ | ||
1 | +2010-01-15 HASHIMOTO Taiichi <taiichi2@mac.com> | |
2 | + | |
3 | + * lisp/term/ns-win.el (mac-toggle-input-method): system と Emacs のIMの状態を同期する機能を強化 | |
4 | + * src/macim.m (mac-toggle-input-source): input source を変更する関数を追加 | |
5 | + | |
1 | 6 | 2010-01-04 HASHIMOTO Taiichi <taiichi2@mac.com> |
2 | 7 | |
3 | 8 | * src/nsterm.m (firstRectForCharRange): 候補ウィンドウの出現位置の制御 |