• R/O
  • SSH
  • HTTPS

macemacsjp: 提交


Commit MetaInfo

修订版562 (tree)
时间2010-01-15 14:13:29
作者taiichi

Log Message

(empty log message)

更改概述

差异

--- inline_patch/trunk/emacs-inline.patch (revision 561)
+++ inline_patch/trunk/emacs-inline.patch (revision 562)
@@ -1,5 +1,5 @@
11 *** ../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
33 *************** The properties returned may include `top
44 *** 315,320 ****
55 --- 315,321 ----
@@ -153,19 +153,9 @@
153153 (cond
154154 ((and (overlayp ns-working-overlay)
155155 ;; 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 ----
166156 *************** the operating system.")
167157 *** 1263,1268 ****
168---- 1325,1696 ----
158+--- 1326,1708 ----
169159 (add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system))
170160
171161
@@ -386,7 +376,7 @@
386376 + (defun mac-set-input-method-parameter (is key value)
387377 + "Function to set a parameter of a input method."
388378 + (let* ((is-param (assoc is mac-input-method-parameters))
389-+ (param (assq key is-param)))
379++ (param (assq key is-param)))
390380 + (if is-param
391381 + (if param
392382 + (setcdr param value)
@@ -401,8 +391,8 @@
401391 + (interactive)
402392 +
403393 + (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)))
406396 + (if (and title (not (equal title (mac-get-input-method-title))))
407397 + (setq current-input-method-title title))
408398 + (if (and type (not (equal type (mac-get-cursor-type))))
@@ -416,13 +406,23 @@
416406 + (defun mac-toggle-input-method (&optional arg)
417407 + "Function to toggle input method on MacOSX."
418408 + (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)))
420420 +
421421 +
422422 + (defun mac-change-language-to-us ()
423-+ "Function to change language (Apple Key Script) to us."
423++ "Function to change language to us."
424424 + (interactive)
425-+ (mac-set-ascii-input-source))
425++ (mac-toggle-input-method nil))
426426 +
427427 +
428428 + (defun mac-handle-input-method-change ()
@@ -429,15 +429,16 @@
429429 + "Function run when a input method change."
430430 + (interactive)
431431 +
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)))
438440 + (mac-input-method-update input-source))))
439441 +
440-+
441442 + ;;
442443 + ;; Emacs input method for input method on MacOSX.
443444 + ;;
@@ -540,7 +541,7 @@
540541 ;; arch-tag: eb138a45-4e2e-4d68-b1c9-a39665731644
541542 diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/Makefile.in src/Makefile.in
542543 *** ../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
544545 *************** ns_appresdir=@ns_appresdir@/
545546 *** 542,548 ****
546547 ns_appsrc=@ns_appsrc@
@@ -587,7 +588,7 @@
587588 blockinput.h atimer.h charset.h coding.h ccl.h msdos.h composite.h \
588589 diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/keyboard.c src/keyboard.c
589590 *** ../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
591592 *************** kbd_buffer_get_event (kbp, used_mouse_me
592593 *** 4185,4192 ****
593594 {
@@ -622,12 +623,12 @@
622623 But `handle-switch-frame is not run from the special-map.
623624 diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/macim.m src/macim.m
624625 *** ../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
626627 ***************
627628 *** 0 ****
628---- 1,196 ----
629+--- 1,165 ----
629630 + /* 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
631632 + Taiichi Hashimoto <taiichi2@mac.com>.
632633 + */
633634 +
@@ -669,22 +670,17 @@
669670 + int mac_pass_key_to_system (int code, UInt32 modifiers);
670671 + int mac_store_change_input_method_event ();
671672 +
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++ ()
673677 + {
674-+ if (!(a && b)) return NO;
678++ TISInputSourceRef is = TISCopyCurrentKeyboardInputSource();
679++ CFBooleanRef ret = TISGetInputSourceProperty(is, kTISPropertyInputSourceIsASCIICapable);
675680 +
676-+ NSString* as = TISGetInputSourceProperty(a, kTISPropertyInputSourceID);
677-+ NSString* bs = TISGetInputSourceProperty(b, kTISPropertyInputSourceID);
678-+
679-+ return [as isEqualToString:bs];
681++ return CFBooleanGetValue(ret)? Qt : Qnil;
680682 + }
681683 +
682-+ static BOOL current_input_source_is_ascii_capable()
683-+ {
684-+ TISInputSourceRef is = TISCopyCurrentKeyboardInputSource();
685-+ return TISGetInputSourceProperty(is, kTISPropertyInputSourceIsASCIICapable);
686-+ }
687-+
688684 + DEFUN ("mac-get-input-source-list", Fmac_get_input_source_list,
689685 + Smac_get_input_source_list, 0, 0, 0,
690686 + doc: /* get input source list on MacOSX */)
@@ -715,55 +711,28 @@
715711 + return make_string([id cString], [id length]);
716712 + }
717713 +
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;
722719 + {
723-+ TISInputSourceRef is = TISCopyCurrentASCIICapableKeyboardInputSource();
724-+ if (is)
720++ TISInputSourceRef is = NULL;
721++
722++ if (NILP (arg))
725723 + {
726-+ TISSelectInputSource(is);
724++ is = TISCopyCurrentASCIICapableKeyboardInputSource();
727725 + }
726++ else
727++ {
728++ NSString *locale = [[NSLocale currentLocale] localeIdentifier];
729++ is = TISCopyInputSourceForLanguage(locale);
730++ }
731++ if (is) TISSelectInputSource(is);
728732 +
729-+ return Qnil;
733++ return arg;
730734 + }
731735 +
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-+
767736 + int
768737 + mac_store_change_input_method_event ()
769738 + {
@@ -783,29 +752,30 @@
783752 + int
784753 + mac_pass_key_to_system (int code, UInt32 modifiers)
785754 + {
786-+ BOOL ascii_capable = current_input_source_is_ascii_capable();
755++ Lisp_Object ascii_capable = Fmac_input_source_is_ascii_capable();
787756 + Lisp_Object keys = Fsymbol_value (Qmac_ignore_shortcut);
788757 + Lisp_Object m, k;
789758 +
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);
802772 +
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++
809779 + return TRUE;
810780 + }
811781 +
@@ -815,16 +785,16 @@
815785 + Qmac_ignore_shortcut = intern ("mac-ignore-shortcut");
816786 + staticpro (&Qmac_ignore_shortcut);
817787 +
788++ defsubr (&Smac_input_source_is_ascii_capable);
818789 + defsubr (&Smac_get_input_source_list);
819790 + 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);
822792 + }
823793 +
824794 + #endif
825795 diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/nsfns.m src/nsfns.m
826796 *** ../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
828798 *************** be used as the image of the icon represe
829799 *** 2676,2681 ****
830800 --- 2676,2685 ----
@@ -840,7 +810,7 @@
840810
841811 diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/nsterm.h src/nsterm.h
842812 *** ../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
844814 *************** typedef unsigned int NSUInteger;
845815 *** 365,370 ****
846816 --- 365,371 ----
@@ -853,7 +823,7 @@
853823 for managing a table of bitmap "records" */
854824 diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/nsterm.m src/nsterm.m
855825 *** ../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
857827 *************** ns_term_init (Lisp_Object display_name)
858828 *** 3721,3726 ****
859829 --- 3721,3729 ----
@@ -888,23 +858,6 @@
888858 - (void)sendEvent: (NSEvent *)theEvent
889859 /* --------------------------------------------------------------------------
890860 *************** 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
908861 *** 4478,4483 ****
909862 --- 4493,4499 ----
910863
@@ -1028,7 +981,7 @@
1028981 pt = [[self window] convertBaseToScreen: pt];
1029982 diff -p -N -r -x '*.orig' ../emacs-23.1.91/src/s/darwin.h src/s/darwin.h
1030983 *** ../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
1032985 *************** along with GNU Emacs. If not, see <http
1033986 *** 145,151 ****
1034987 /* Definitions for how to compile & link. */
--- inline_patch/trunk/ChangeLog (revision 561)
+++ inline_patch/trunk/ChangeLog (revision 562)
@@ -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+
16 2010-01-04 HASHIMOTO Taiichi <taiichi2@mac.com>
27
38 * src/nsterm.m (firstRectForCharRange): 候補ウィンドウの出現位置の制御
Show on old repository browser