• R/O
  • SSH
  • HTTPS

macemacsjp: Commit


Commit MetaInfo

Revision583 (tree)
Time2013-04-13 23:54:11
Authortaiichi

Log Message

for 24.3

Change Summary

Incremental Difference

--- inline_patch/trunk/emacs-inline.patch (revision 582)
+++ inline_patch/trunk/emacs-inline.patch (revision 583)
@@ -1,537 +1,6 @@
1-diff -N -p ../emacs-24.0.97/configure.in ./configure.in
2-*** ../emacs-24.0.97/configure.in 2012-05-17 11:19:50.000000000 +0900
3---- ./configure.in 2012-05-20 17:01:19.000000000 +0900
4-*************** if test "${HAVE_NS}" = yes; then
5-*** 1582,1588 ****
6- fi
7- ns_frag=$srcdir/src/ns.mk
8- NS_OBJ="fontset.o fringe.o image.o"
9-! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
10- fi
11- CFLAGS="$tmp_CFLAGS"
12- CPPFLAGS="$tmp_CPPFLAGS"
13---- 1582,1588 ----
14- fi
15- ns_frag=$srcdir/src/ns.mk
16- NS_OBJ="fontset.o fringe.o image.o"
17-! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macim.o"
18- fi
19- CFLAGS="$tmp_CFLAGS"
20- CPPFLAGS="$tmp_CPPFLAGS"
21-*************** case "$opsys" in
22-*** 3416,3422 ****
23- ## 0x690 is the total size of 30 segment load commands (at 56
24- ## each); under Cocoa 31 commands are required.
25- if test "$HAVE_NS" = "yes"; then
26-! libs_nsgui="-framework AppKit"
27- headerpad_extra=6C8
28- else
29- libs_nsgui=
30---- 3416,3422 ----
31- ## 0x690 is the total size of 30 segment load commands (at 56
32- ## each); under Cocoa 31 commands are required.
33- if test "$HAVE_NS" = "yes"; then
34-! libs_nsgui="-framework AppKit -framework Carbon"
35- headerpad_extra=6C8
36- else
37- libs_nsgui=
38-diff -r -N -p ../emacs-24.0.96/src/Makefile.in src/Makefile.in
39-*** ../emacs-24.0.96/src/Makefile.in 2012-04-08 12:03:02.000000000 +0900
40---- src/Makefile.in 2012-05-03 22:23:59.000000000 +0900
41-*************** obj = $(base_obj) $(NS_OBJC_OBJ)
42-*** 350,356 ****
43- SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
44- xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
45- fontset.o dbusbind.o \
46-! nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
47- w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
48- w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
49- w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
50---- 350,356 ----
51- SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
52- xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
53- fontset.o dbusbind.o \
54-! nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macim.o\
55- w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
56- w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
57- w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
58-diff -r -N -p ../emacs-24.0.96/src/keyboard.c src/keyboard.c
59-*** ../emacs-24.0.96/src/keyboard.c 2012-04-08 12:03:02.000000000 +0900
60---- src/keyboard.c 2012-05-03 22:23:59.000000000 +0900
61-*************** kbd_buffer_get_event (KBOARD **kbp,
62-*** 3915,3922 ****
63- {
64- if (event->code == KEY_NS_PUT_WORKING_TEXT)
65- obj = Fcons (intern ("ns-put-working-text"), Qnil);
66-! else
67- obj = Fcons (intern ("ns-unput-working-text"), Qnil);
68- kbd_fetch_ptr = event + 1;
69- if (used_mouse_menu)
70- *used_mouse_menu = 1;
71---- 3915,3924 ----
72- {
73- if (event->code == KEY_NS_PUT_WORKING_TEXT)
74- obj = Fcons (intern ("ns-put-working-text"), Qnil);
75-! else if (event->code == KEY_NS_UNPUT_WORKING_TEXT)
76- obj = Fcons (intern ("ns-unput-working-text"), Qnil);
77-+ else if (event->code == KEY_NS_PUT_MARKED_TEXT)
78-+ obj = Fcons (intern ("ns-put-marked-text"), event->arg);
79- kbd_fetch_ptr = event + 1;
80- if (used_mouse_menu)
81- *used_mouse_menu = 1;
82-*************** keys_of_keyboard (void)
83-*** 12332,12337 ****
84---- 12334,12341 ----
85- "ns-put-working-text");
86- initial_define_lispy_key (Vspecial_event_map, "ns-unput-working-text",
87- "ns-unput-working-text");
88-+ initial_define_lispy_key (Vspecial_event_map, "ns-put-marked-text",
89-+ "ns-put-marked-text");
90- /* Here we used to use `ignore-event' which would simple set prefix-arg to
91- current-prefix-arg, as is done in `handle-switch-frame'.
92- But `handle-switch-frame is not run from the special-map.
93-diff -r -N -p ../emacs-24.0.96/src/macim.m src/macim.m
94-*** ../emacs-24.0.96/src/macim.m 1970-01-01 09:00:00.000000000 +0900
95---- src/macim.m 2012-05-03 22:23:59.000000000 +0900
96-***************
97-*** 0 ****
98---- 1,177 ----
99-+ /* Implementation of Input Method Extension for MacOS X.
100-+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
101-+ Taiichi Hashimoto <taiichi2@mac.com>.
102-+ */
103-+
104-+ #include "config.h"
105-+
106-+ #ifdef NS_IMPL_COCOA
107-+
108-+ #include <math.h>
109-+ #include <sys/types.h>
110-+ #include <time.h>
111-+ #include <signal.h>
112-+ #include <unistd.h>
113-+
114-+ #include <Carbon/Carbon.h>
115-+
116-+ #include "lisp.h"
117-+ #include "blockinput.h"
118-+
119-+ enum output_method
120-+ {
121-+ output_initial,
122-+ output_termcap,
123-+ output_x_window,
124-+ output_msdos_raw,
125-+ output_w32,
126-+ output_mac,
127-+ output_ns
128-+ } output_method;
129-+
130-+ #include "termhooks.h"
131-+ #include "keyboard.h"
132-+ #include "buffer.h"
133-+
134-+ //extern Lisp_Object Qcurrent_input_method;
135-+ //extern int cursor_in_echo_area;
136-+ static Lisp_Object Qmac_keys_passed_to_system;
137-+
138-+ void mac_init_input_method ();
139-+ int mac_pass_key_to_system (int code, int modifiers);
140-+ int mac_pass_key_directly_to_emacs ();
141-+ int mac_store_change_input_method_event ();
142-+
143-+ DEFUN ("mac-input-source-is-ascii-capable", Fmac_input_source_is_ascii_capable, Smac_input_source_is_ascii_capable,
144-+ 0, 0, 0,
145-+ doc: /* Is current input source ascii capable? */)
146-+ (void)
147-+ {
148-+ TISInputSourceRef is = TISCopyCurrentKeyboardInputSource();
149-+ CFBooleanRef ret = TISGetInputSourceProperty(is, kTISPropertyInputSourceIsASCIICapable);
150-+
151-+ return CFBooleanGetValue(ret)? Qt : Qnil;
152-+ }
153-+
154-+ DEFUN ("mac-get-input-source-list", Fmac_get_input_source_list, Smac_get_input_source_list,
155-+ 0, 0, 0,
156-+ doc: /* get input source list on MacOSX */)
157-+ (void)
158-+ {
159-+ NSArray *is_list = (NSArray *)TISCreateInputSourceList(NULL, false);
160-+ int list_size = [is_list count];
161-+ Lisp_Object list[list_size];
162-+ int i;
163-+
164-+ for (i = 0; i < list_size; i++) {
165-+ TISInputSourceRef is = (TISInputSourceRef)[is_list objectAtIndex:i];
166-+ NSString *id = (NSString *)TISGetInputSourceProperty(is, kTISPropertyInputSourceID);
167-+ list[i] = make_string([id UTF8String],
168-+ [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
169-+ }
170-+
171-+ return Flist(list_size, list);
172-+ }
173-+
174-+ DEFUN ("mac-get-current-input-source", Fmac_get_current_input_source, Smac_get_current_input_source,
175-+ 0, 0, 0,
176-+ doc: /* get current input source on MacOSX */)
177-+ (void)
178-+ {
179-+ TISInputSourceRef is = TISCopyCurrentKeyboardInputSource();
180-+ NSString *id = (NSString *)TISGetInputSourceProperty(is, kTISPropertyInputSourceID);
181-+
182-+ return make_string([id UTF8String],
183-+ [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
184-+ }
185-+
186-+ DEFUN ("mac-toggle-input-source", Fmac_toggle_input_source, Smac_toggle_input_source,
187-+ 1, 1, 0,
188-+ doc: /* toggle input source on MacOSX */)
189-+ (arg)
190-+ Lisp_Object arg;
191-+ {
192-+ TISInputSourceRef is = NULL;
193-+
194-+ if (NILP (arg))
195-+ {
196-+ is = TISCopyCurrentASCIICapableKeyboardInputSource();
197-+ }
198-+ else
199-+ {
200-+ NSString *locale = [[NSLocale currentLocale] localeIdentifier];
201-+ is = TISCopyInputSourceForLanguage((CFStringRef)locale);
202-+ }
203-+ if (is) TISSelectInputSource(is);
204-+
205-+ return arg;
206-+ }
207-+
208-+ int
209-+ mac_store_change_input_method_event ()
210-+ {
211-+ Lisp_Object dim;
212-+ int ret = FALSE;
213-+
214-+ dim = Fsymbol_value (intern ("default-input-method"));
215-+ if (STRINGP (dim) && strcmp(SDATA (dim), "MacOSX") == 0)
216-+ {
217-+ ret = TRUE;
218-+ }
219-+
220-+ return ret;
221-+ }
222-+
223-+ int
224-+ mac_pass_key_to_system (int code, int modifiers)
225-+ {
226-+ Lisp_Object keys = Fsymbol_value (Qmac_keys_passed_to_system);
227-+ Lisp_Object m, k;
228-+
229-+ while (!NILP (keys))
230-+ {
231-+ m = XCAR (XCAR (keys));
232-+ k = XCDR (XCAR (keys));
233-+ keys = XCDR (keys);
234-+
235-+ if (NUMBERP (m) && modifiers == XINT (m))
236-+ if (NILP (k)
237-+ || (NUMBERP (k) && code == XINT (k)))
238-+ return TRUE;
239-+ }
240-+
241-+ return FALSE;
242-+ }
243-+
244-+ int
245-+ mac_pass_key_directly_to_emacs (void)
246-+ {
247-+
248-+ if (NILP (Fmac_input_source_is_ascii_capable()))
249-+ {
250-+ if (NILP (Vmac_use_input_method_on_system)
251-+ || this_command_key_count
252-+ || cursor_in_echo_area
253-+ || !NILP (BVAR (current_buffer, read_only)))
254-+ return TRUE;
255-+ }
256-+
257-+ return FALSE;
258-+ }
259-+
260-+
261-+ void mac_init_input_method (void)
262-+ {
263-+ Qmac_keys_passed_to_system = intern ("mac-keys-passed-to-system");
264-+ staticpro (&Qmac_keys_passed_to_system);
265-+
266-+ DEFVAR_LISP ("mac-use-input-method-on-system", Vmac_use_input_method_on_system,
267-+ doc: /* If it is non-nil, use input method on system. */);
268-+ Vmac_use_input_method_on_system = Qt;
269-+
270-+ defsubr (&Smac_input_source_is_ascii_capable);
271-+ defsubr (&Smac_get_input_source_list);
272-+ defsubr (&Smac_get_current_input_source);
273-+ defsubr (&Smac_toggle_input_source);
274-+ }
275-+ #endif
276-diff -r -N -p ../emacs-24.0.96/src/nsfns.m src/nsfns.m
277-*** ../emacs-24.0.96/src/nsfns.m 2012-04-08 12:03:02.000000000 +0900
278---- src/nsfns.m 2012-05-04 00:05:24.000000000 +0900
279-*************** static ptrdiff_t image_cache_refcount;
280-*** 111,117 ****
281-
282- ========================================================================== */
283-
284--
285- void
286- check_ns (void)
287- {
288---- 111,116 ----
289-*************** be used as the image of the icon represe
290-*** 2722,2727 ****
291---- 2721,2744 ----
292- doc: /* Toolkit version for NS Windowing. */);
293- Vns_version_string = ns_appkit_version_str ();
294-
295-+
296-+ DEFVAR_LISP ("ns-shift-key-mask", Vns_shift_key_mask,
297-+ doc: /* Shift key mask defined in system. */);
298-+ Vns_shift_key_mask = make_number (NSShiftKeyMask);
299-+
300-+ DEFVAR_LISP ("ns-control-key-mask", Vns_control_key_mask,
301-+ doc: /* Control key mask defined in system. */);
302-+ Vns_control_key_mask = make_number (NSControlKeyMask);
303-+
304-+ DEFVAR_LISP ("ns-alternate-key-mask", Vns_alternate_key_mask,
305-+ doc: /* Alternate key mask defined in system. */);
306-+ Vns_alternate_key_mask = make_number (NSAlternateKeyMask);
307-+
308-+ DEFVAR_LISP ("ns-command-key-mask", Vns_command_key_mask,
309-+ doc: /* Command key mask defined in system. */);
310-+ Vns_command_key_mask = make_number (NSCommandKeyMask);
311-+
312-+
313- defsubr (&Sns_read_file_name);
314- defsubr (&Sns_get_resource);
315- defsubr (&Sns_set_resource);
316-*************** be used as the image of the icon represe
317-*** 2766,2771 ****
318---- 2783,2792 ----
319- defsubr (&Sx_show_tip);
320- defsubr (&Sx_hide_tip);
321-
322-+ #ifdef NS_IMPL_COCOA
323-+ mac_init_input_method ();
324-+ #endif
325-+
326- /* used only in fontset.c */
327- check_window_system_func = check_ns;
328-
329-diff -r -N -p ../emacs-24.0.96/src/nsterm.h src/nsterm.h
330-*** ../emacs-24.0.96/src/nsterm.h 2012-04-08 12:03:02.000000000 +0900
331---- src/nsterm.h 2012-05-03 22:23:59.000000000 +0900
332-*************** typedef unsigned int NSUInteger;
333-*** 398,403 ****
334---- 398,405 ----
335- #define KEY_NS_NEW_FRAME ((1<<28)|(0<<16)|12)
336- #define KEY_NS_TOGGLE_TOOLBAR ((1<<28)|(0<<16)|13)
337- #define KEY_NS_SHOW_PREFS ((1<<28)|(0<<16)|14)
338-+ #define KEY_MAC_CHANGE_INPUT_METHOD ((1<<28)|(0<<16)|15)
339-+ #define KEY_NS_PUT_MARKED_TEXT ((1<<28)|(0<<16)|16)
340-
341- /* could use list to store these, but rest of emacs has a big infrastructure
342- for managing a table of bitmap "records" */
343-diff -r -N -p ../emacs-24.0.96/src/nsterm.m src/nsterm.m
344-*** ../emacs-24.0.96/src/nsterm.m 2012-04-09 22:08:55.000000000 +0900
345---- src/nsterm.m 2012-05-04 00:12:13.000000000 +0900
346-*************** ns_term_init (Lisp_Object display_name)
347-*** 4040,4045 ****
348---- 4040,4048 ----
349- /* [[NSNotificationCenter defaultCenter] addObserver: NSApp
350- selector: @selector (logNotification:)
351- name: nil object: nil]; */
352-+ [[NSDistributedNotificationCenter defaultCenter] addObserver: NSApp
353-+ selector: @selector (changeInputMethod:)
354-+ name: @"AppleSelectedInputSourcesChangedNotification" object: nil];
355-
356- dpyinfo = (struct ns_display_info *)xmalloc (sizeof (struct ns_display_info));
357- memset (dpyinfo, 0, sizeof (struct ns_display_info));
358-*************** ns_term_shutdown (int sig)
359-*** 4255,4260 ****
360---- 4258,4276 ----
361- NSLog (@"notification: '%@'", [notification name]);
362- }
363-
364-+ - (void)changeInputMethod: (NSNotification *)notification
365-+ {
366-+
367-+ struct frame *emacsframe = SELECTED_FRAME ();
368-+
369-+ if (mac_store_change_input_method_event())
370-+ {
371-+ emacs_event->kind = NS_NONKEY_EVENT;
372-+ emacs_event->code = KEY_MAC_CHANGE_INPUT_METHOD;
373-+ emacs_event->modifiers = 0;
374-+ EV_TRAILER ((id)nil);
375-+ }
376-+ }
377-
378- - (void)sendEvent: (NSEvent *)theEvent
379- /* --------------------------------------------------------------------------
380-*************** ns_term_shutdown (int sig)
381-*** 4857,4863 ****
382- code, fnKeysym, flags, emacs_event->modifiers);
383-
384- /* if it was a function key or had modifiers, pass it directly to emacs */
385-! if (fnKeysym || (emacs_event->modifiers
386- && (emacs_event->modifiers != shift_modifier)
387- && [[theEvent charactersIgnoringModifiers] length] > 0))
388- /*[[theEvent characters] length] */
389---- 4872,4879 ----
390- code, fnKeysym, flags, emacs_event->modifiers);
391-
392- /* if it was a function key or had modifiers, pass it directly to emacs */
393-! if (mac_pass_key_directly_to_emacs ()
394-! ||fnKeysym || (emacs_event->modifiers
395- && (emacs_event->modifiers != shift_modifier)
396- && [[theEvent charactersIgnoringModifiers] length] > 0))
397- /*[[theEvent characters] length] */
398-*************** ns_term_shutdown (int sig)
399-*** 4872,4879 ****
400- ? MULTIBYTE_CHAR_KEYSTROKE_EVENT : ASCII_KEYSTROKE_EVENT;
401-
402- emacs_event->code = code;
403-! EV_TRAILER (theEvent);
404-! return;
405- }
406- }
407-
408---- 4888,4905 ----
409- ? MULTIBYTE_CHAR_KEYSTROKE_EVENT : ASCII_KEYSTROKE_EVENT;
410-
411- emacs_event->code = code;
412-! /* The function mac_pass_key_to_system decides
413-! whether it is passed directly to emacs or not. */
414-! if (emacs_event->kind == NON_ASCII_KEYSTROKE_EVENT
415-! || !mac_pass_key_to_system (code, flags
416-! & (NSShiftKeyMask
417-! | NSControlKeyMask
418-! | NSAlternateKeyMask
419-! | NSCommandKeyMask)))
420-! {
421-! EV_TRAILER (theEvent);
422-! return;
423-! }
424- }
425- }
426-
427-*************** ns_term_shutdown (int sig)
428-*** 4966,4975 ****
429- NSLog (@"setMarkedText '%@' len =%d range %d from %d", str, [str length],
430- selRange.length, selRange.location);
431-
432-- if (workingText != nil)
433-- [self deleteWorkingText];
434- if ([str length] == 0)
435-! return;
436-
437- if (!emacs_event)
438- return;
439---- 4992,5010 ----
440- NSLog (@"setMarkedText '%@' len =%d range %d from %d", str, [str length],
441- selRange.length, selRange.location);
442-
443- if ([str length] == 0)
444-! {
445-! [self deleteWorkingText];
446-! return;
447-! }
448-! else
449-! {
450-! if (workingText != nil) {
451-! [workingText release];
452-! workingText = nil;
453-! processingCompose = NO;
454-! }
455-! }
456-
457- if (!emacs_event)
458- return;
459-*************** ns_term_shutdown (int sig)
460-*** 4979,4985 ****
461- ns_working_text = build_string ([workingText UTF8String]);
462-
463- emacs_event->kind = NS_TEXT_EVENT;
464-! emacs_event->code = KEY_NS_PUT_WORKING_TEXT;
465- EV_TRAILER ((id)nil);
466- }
467-
468---- 5014,5022 ----
469- ns_working_text = build_string ([workingText UTF8String]);
470-
471- emacs_event->kind = NS_TEXT_EVENT;
472-! emacs_event->code = KEY_NS_PUT_MARKED_TEXT;
473-! emacs_event->arg = Fcons (make_number (selRange.location),
474-! Fcons (make_number (selRange.length), Qnil));
475- EV_TRAILER ((id)nil);
476- }
477-
478-*************** ns_term_shutdown (int sig)
479-*** 5034,5048 ****
480- {
481- NSRect rect;
482- NSPoint pt;
483-! struct window *win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
484- if (NS_KEYLOG)
485- NSLog (@"firstRectForCharRange request");
486-
487- rect.size.width = theRange.length * FRAME_COLUMN_WIDTH (emacsframe);
488- rect.size.height = FRAME_LINE_HEIGHT (emacsframe);
489- pt.x = WINDOW_TEXT_TO_FRAME_PIXEL_X (win, win->phys_cursor.x);
490- pt.y = WINDOW_TO_FRAME_PIXEL_Y (win, win->phys_cursor.y
491-! +FRAME_LINE_HEIGHT (emacsframe));
492-
493- pt = [self convertPoint: pt toView: nil];
494- pt = [[self window] convertBaseToScreen: pt];
495---- 5071,5093 ----
496- {
497- NSRect rect;
498- NSPoint pt;
499-! // struct window *win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
500-! struct window *win;
501- if (NS_KEYLOG)
502- NSLog (@"firstRectForCharRange request");
503-+
504-+ if (NILP (Vmac_in_echo_area))
505-+ win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
506-+ else if (WINDOWP (echo_area_window))
507-+ win = XWINDOW (echo_area_window);
508-+ else
509-+ win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
510-
511- rect.size.width = theRange.length * FRAME_COLUMN_WIDTH (emacsframe);
512- rect.size.height = FRAME_LINE_HEIGHT (emacsframe);
513- pt.x = WINDOW_TEXT_TO_FRAME_PIXEL_X (win, win->phys_cursor.x);
514- pt.y = WINDOW_TO_FRAME_PIXEL_Y (win, win->phys_cursor.y
515-! +FRAME_LINE_HEIGHT (emacsframe)+2);
516-
517- pt = [self convertPoint: pt toView: nil];
518- pt = [[self window] convertBaseToScreen: pt];
519-*************** variable `x-use-underline-position-prope
520-*** 6764,6769 ****
521---- 6809,6818 ----
522- baseline level. The default value is nil. */);
523- x_underline_at_descent_line = 0;
524-
525-+ DEFVAR_LISP ("mac-in-echo-area", Vmac_in_echo_area,
526-+ doc: /* state of cursor in echo area. */);
527-+ Vmac_in_echo_area = Qnil;
528-+
529- /* Tell emacs about this window system. */
530- Fprovide (intern ("ns"), Qnil);
531- }
532-diff -r -N -p ../emacs-24.0.96/lisp/term/common-win.el lisp/term/common-win.el
533-*** ../emacs-24.0.96/lisp/term/common-win.el 2012-04-08 12:03:02.000000000 +0900
534---- lisp/term/common-win.el 2012-05-03 22:23:59.000000000 +0900
1+diff -r -N -p -x '*.elc' ../emacs-24.3.org/lisp/term/common-win.el lisp/term/common-win.el
2+*** ../emacs-24.3.org/lisp/term/common-win.el 2013-01-02 05:37:17.000000000 +0900
3+--- lisp/term/common-win.el 2013-04-13 21:49:53.000000000 +0900
5354 *************** is not used)."
5365 *** 127,132 ****
5376 --- 127,133 ----
@@ -542,12 +11,12 @@
54211 ))))
54312 (set-terminal-parameter frame 'x-setup-function-keys t)))
54413
545-diff -r -N -p ../emacs-24.0.96/lisp/term/ns-win.el lisp/term/ns-win.el
546-*** ../emacs-24.0.96/lisp/term/ns-win.el 2012-04-08 12:03:02.000000000 +0900
547---- lisp/term/ns-win.el 2012-05-03 23:57:14.000000000 +0900
14+diff -r -N -p -x '*.elc' ../emacs-24.3.org/lisp/term/ns-win.el lisp/term/ns-win.el
15+*** ../emacs-24.3.org/lisp/term/ns-win.el 2013-01-02 05:37:17.000000000 +0900
16+--- lisp/term/ns-win.el 2013-04-13 21:50:48.000000000 +0900
54817 *************** The properties returned may include `top
549-*** 173,178 ****
550---- 173,179 ----
18+*** 171,176 ****
19+--- 171,177 ----
55120 (define-key global-map [ns-new-frame] 'make-frame)
55221 (define-key global-map [ns-toggle-toolbar] 'ns-toggle-toolbar)
55322 (define-key global-map [ns-show-prefs] 'customize)
@@ -556,7 +25,7 @@
55625
55726 ;; Set up a number of aliases and other layers to pretend we're using
55827 *************** The properties returned may include `top
559-*** 259,272 ****
28+*** 256,269 ****
56029 ;; editing window.)
56130
56231 (defface ns-working-text-face
@@ -571,7 +40,7 @@
57140 (defvar ns-working-text) ; nsterm.m
57241
57342 ;; Test if in echo area, based on mac-win.el 2007/08/26 unicode-2.
574---- 260,289 ----
43+--- 257,286 ----
57544 ;; editing window.)
57645
57746 (defface ns-working-text-face
@@ -603,7 +72,7 @@
60372
60473 ;; Test if in echo area, based on mac-win.el 2007/08/26 unicode-2.
60574 *************** When text is in th echo area, this just
606-*** 274,290 ****
75+*** 271,287 ****
60776 (defun ns-in-echo-area ()
60877 "Whether, for purposes of inserting working composition text, the minibuffer
60978 is currently being used."
@@ -621,7 +90,7 @@
62190
62291 ;; The 'interactive' here stays for subinvocations, so the ns-in-echo-area
62392 ;; always returns nil for some reason. If this WASN'T the case, we could
624---- 291,309 ----
93+--- 288,306 ----
62594 (defun ns-in-echo-area ()
62695 "Whether, for purposes of inserting working composition text, the minibuffer
62796 is currently being used."
@@ -642,8 +111,8 @@
642111 ;; The 'interactive' here stays for subinvocations, so the ns-in-echo-area
643112 ;; always returns nil for some reason. If this WASN'T the case, we could
644113 *************** is currently being used."
645-*** 293,298 ****
646---- 312,318 ----
114+*** 290,295 ****
115+--- 309,315 ----
647116 (defun ns-put-working-text ()
648117 (interactive)
649118 (if (ns-in-echo-area) (ns-echo-working-text) (ns-insert-working-text)))
@@ -652,7 +121,7 @@
652121 (interactive)
653122 (ns-delete-working-text))
654123 *************** The overlay is assigned the face `ns-wor
655-*** 314,332 ****
124+*** 311,329 ****
656125 (defun ns-echo-working-text ()
657126 "Echo contents of `ns-working-text' in message display area.
658127 See `ns-insert-working-text'."
@@ -672,7 +141,7 @@
672141 (cond
673142 ((and (overlayp ns-working-overlay)
674143 ;; Still alive?
675---- 334,414 ----
144+--- 331,411 ----
676145 (defun ns-echo-working-text ()
677146 "Echo contents of `ns-working-text' in message display area.
678147 See `ns-insert-working-text'."
@@ -755,8 +224,8 @@
755224 ((and (overlayp ns-working-overlay)
756225 ;; Still alive?
757226 *************** See the documentation of `create-fontset
758-*** 931,936 ****
759---- 1013,1438 ----
227+*** 943,948 ****
228+--- 1025,1490 ----
760229 (add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system))
761230
762231
@@ -920,6 +389,26 @@
920389 + (title . "C")
921390 + (cursor-color)
922391 + (cursor-type))
392++ ("com.justsystems.inputmethod.atok21.Roman"
393++ (title . "A")
394++ (cursor-color)
395++ (cursor-type))
396++ ("com.justsystems.inputmethod.atok21.Japanese"
397++ (title . "あ")
398++ (cursor-color)
399++ (cursor-type))
400++ ("com.justsystems.inputmethod.atok21.Japanese.Katakana"
401++ (title . "ア")
402++ (cursor-color)
403++ (cursor-type))
404++ ("com.justsystems.inputmethod.atok21.Japanese.FullWidthRoman"
405++ (title . "英")
406++ (cursor-color)
407++ (cursor-type))
408++ ("com.justsystems.inputmethod.atok21.Japanese.HalfWidthEiji"
409++ (title . "半英")
410++ (cursor-color)
411++ (cursor-type))
923412 + ("com.justsystems.inputmethod.atok22.Roman"
924413 + (title . "A")
925414 + (cursor-color)
@@ -980,6 +469,26 @@
980469 + (title . "半英")
981470 + (cursor-color)
982471 + (cursor-type))
472++ ("com.justsystems.inputmethod.atok25.Roman"
473++ (title . "A")
474++ (cursor-color)
475++ (cursor-type))
476++ ("com.justsystems.inputmethod.atok25.Japanese"
477++ (title . "あ")
478++ (cursor-color)
479++ (cursor-type))
480++ ("com.justsystems.inputmethod.atok25.Japanese.Katakana"
481++ (title . "ア")
482++ (cursor-color)
483++ (cursor-type))
484++ ("com.justsystems.inputmethod.atok25.Japanese.FullWidthRoman"
485++ (title . "英")
486++ (cursor-color)
487++ (cursor-type))
488++ ("com.justsystems.inputmethod.atok25.Japanese.HalfWidthEiji"
489++ (title . "半英")
490++ (cursor-color)
491++ (cursor-type))
983492 + )
984493 + "Alist of Mac script code vs parameters for input method on MacOSX.")
985494 +
@@ -1183,4 +692,578 @@
1183692 (provide 'ns-win)
1184693
1185694 ;;; ns-win.el ends here
1186-
695+diff -r -N -p ../emacs-24.3.org/src/Makefile.in src/Makefile.in
696+*** ../emacs-24.3.org/src/Makefile.in 2013-01-02 05:37:17.000000000 +0900
697+--- src/Makefile.in 2013-04-13 21:49:53.000000000 +0900
698+*************** obj = $(base_obj) $(NS_OBJC_OBJ)
699+*** 356,362 ****
700+ SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
701+ xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
702+ fontset.o dbusbind.o cygw32.o \
703+! nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
704+ w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
705+ w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
706+ w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
707+--- 356,362 ----
708+ SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
709+ xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
710+ fontset.o dbusbind.o cygw32.o \
711+! nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macim.o \
712+ w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
713+ w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
714+ w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
715+diff -r -N -p ../emacs-24.3.org/src/keyboard.c src/keyboard.c
716+*** ../emacs-24.3.org/src/keyboard.c 2013-02-13 13:25:53.000000000 +0900
717+--- src/keyboard.c 2013-04-13 21:49:53.000000000 +0900
718+*************** kbd_buffer_get_event (KBOARD **kbp,
719+*** 3862,3869 ****
720+ {
721+ if (event->code == KEY_NS_PUT_WORKING_TEXT)
722+ obj = Fcons (intern ("ns-put-working-text"), Qnil);
723+! else
724+ obj = Fcons (intern ("ns-unput-working-text"), Qnil);
725+ kbd_fetch_ptr = event + 1;
726+ if (used_mouse_menu)
727+ *used_mouse_menu = 1;
728+--- 3862,3871 ----
729+ {
730+ if (event->code == KEY_NS_PUT_WORKING_TEXT)
731+ obj = Fcons (intern ("ns-put-working-text"), Qnil);
732+! else if (event->code == KEY_NS_UNPUT_WORKING_TEXT)
733+ obj = Fcons (intern ("ns-unput-working-text"), Qnil);
734++ else if (event->code == KEY_NS_PUT_MARKED_TEXT)
735++ obj = Fcons (intern ("ns-put-marked-text"), event->arg);
736+ kbd_fetch_ptr = event + 1;
737+ if (used_mouse_menu)
738+ *used_mouse_menu = 1;
739+*************** keys_of_keyboard (void)
740+*** 12088,12093 ****
741+--- 12090,12097 ----
742+ "ns-put-working-text");
743+ initial_define_lispy_key (Vspecial_event_map, "ns-unput-working-text",
744+ "ns-unput-working-text");
745++ initial_define_lispy_key (Vspecial_event_map, "ns-put-marked-text",
746++ "ns-put-marked-text");
747+ /* Here we used to use `ignore-event' which would simple set prefix-arg to
748+ current-prefix-arg, as is done in `handle-switch-frame'.
749+ But `handle-switch-frame is not run from the special-map.
750+diff -r -N -p ../emacs-24.3.org/src/macim.m src/macim.m
751+*** ../emacs-24.3.org/src/macim.m 1970-01-01 09:00:00.000000000 +0900
752+--- src/macim.m 2013-04-13 21:50:24.000000000 +0900
753+***************
754+*** 0 ****
755+--- 1,184 ----
756++ /* Implementation of Input Method Extension for MacOS X.
757++ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
758++ Taiichi Hashimoto <taiichi2@mac.com>.
759++ */
760++
761++ #include "config.h"
762++
763++ #ifdef NS_IMPL_COCOA
764++
765++ #include <math.h>
766++ #include <sys/types.h>
767++ #include <time.h>
768++ #include <signal.h>
769++ #include <unistd.h>
770++
771++ #include <Carbon/Carbon.h>
772++
773++ #include "lisp.h"
774++ #include "blockinput.h"
775++
776++ enum output_method
777++ {
778++ output_initial,
779++ output_termcap,
780++ output_x_window,
781++ output_msdos_raw,
782++ output_w32,
783++ output_mac,
784++ output_ns
785++ } output_method;
786++
787++ #include "termhooks.h"
788++ #include "keyboard.h"
789++ #include "buffer.h"
790++
791++ //extern Lisp_Object Qcurrent_input_method;
792++ //extern int cursor_in_echo_area;
793++ static Lisp_Object Qmac_keys_passed_to_system;
794++
795++ void mac_init_input_method ();
796++ int mac_pass_key_to_system (int code, int modifiers);
797++ int mac_pass_key_directly_to_emacs ();
798++ int mac_store_change_input_method_event ();
799++
800++ DEFUN ("mac-input-source-is-ascii-capable", Fmac_input_source_is_ascii_capable, Smac_input_source_is_ascii_capable,
801++ 0, 0, 0,
802++ doc: /* Is current input source ascii capable? */)
803++ (void)
804++ {
805++ TISInputSourceRef is = TISCopyCurrentKeyboardInputSource();
806++ CFBooleanRef ret = TISGetInputSourceProperty(is, kTISPropertyInputSourceIsASCIICapable);
807++
808++ return CFBooleanGetValue(ret)? Qt : Qnil;
809++ }
810++
811++ DEFUN ("mac-get-input-source-list", Fmac_get_input_source_list, Smac_get_input_source_list,
812++ 0, 0, 0,
813++ doc: /* get input source list on MacOSX */)
814++ (void)
815++ {
816++ NSArray *is_list = (NSArray *)TISCreateInputSourceList(NULL, false);
817++ int list_size = [is_list count];
818++ Lisp_Object list[list_size];
819++ int i;
820++
821++ for (i = 0; i < list_size; i++) {
822++ TISInputSourceRef is = (TISInputSourceRef)[is_list objectAtIndex:i];
823++ NSString *id = (NSString *)TISGetInputSourceProperty(is, kTISPropertyInputSourceID);
824++ list[i] = make_string([id UTF8String],
825++ [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
826++ }
827++
828++ return Flist(list_size, list);
829++ }
830++
831++ DEFUN ("mac-get-current-input-source", Fmac_get_current_input_source, Smac_get_current_input_source,
832++ 0, 0, 0,
833++ doc: /* get current input source on MacOSX */)
834++ (void)
835++ {
836++ TISInputSourceRef is = TISCopyCurrentKeyboardInputSource();
837++ NSString *id = (NSString *)TISGetInputSourceProperty(is, kTISPropertyInputSourceID);
838++
839++ return make_string([id UTF8String],
840++ [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
841++ }
842++
843++ DEFUN ("mac-toggle-input-source", Fmac_toggle_input_source, Smac_toggle_input_source,
844++ 1, 1, 0,
845++ doc: /* toggle input source on MacOSX */)
846++ (arg)
847++ Lisp_Object arg;
848++ {
849++ TISInputSourceRef is = NULL;
850++
851++ if (NILP (arg))
852++ {
853++ is = TISCopyCurrentASCIICapableKeyboardInputSource();
854++ }
855++ else
856++ {
857++ NSString *locale;
858++ NSArray *languages = [NSLocale preferredLanguages];
859++ if (languages != nil) {
860++ locale = [languages objectAtIndex:0];
861++ } else {
862++ locale = [[NSLocale currentLocale]
863++ objectForKey:NSLocaleLanguageCode];
864++ }
865++ is = TISCopyInputSourceForLanguage((CFStringRef)locale);
866++ }
867++ if (is) TISSelectInputSource(is);
868++
869++ return arg;
870++ }
871++
872++ int
873++ mac_store_change_input_method_event ()
874++ {
875++ Lisp_Object dim;
876++ int ret = FALSE;
877++
878++ dim = Fsymbol_value (intern ("default-input-method"));
879++ if (STRINGP (dim) && strcmp(SDATA (dim), "MacOSX") == 0)
880++ {
881++ ret = TRUE;
882++ }
883++
884++ return ret;
885++ }
886++
887++ int
888++ mac_pass_key_to_system (int code, int modifiers)
889++ {
890++ Lisp_Object keys = Fsymbol_value (Qmac_keys_passed_to_system);
891++ Lisp_Object m, k;
892++
893++ while (!NILP (keys))
894++ {
895++ m = XCAR (XCAR (keys));
896++ k = XCDR (XCAR (keys));
897++ keys = XCDR (keys);
898++
899++ if (NUMBERP (m) && modifiers == XINT (m))
900++ if (NILP (k)
901++ || (NUMBERP (k) && code == XINT (k)))
902++ return TRUE;
903++ }
904++
905++ return FALSE;
906++ }
907++
908++ int
909++ mac_pass_key_directly_to_emacs (void)
910++ {
911++
912++ if (NILP (Fmac_input_source_is_ascii_capable()))
913++ {
914++ if (NILP (Vmac_use_input_method_on_system)
915++ || this_command_key_count
916++ || cursor_in_echo_area
917++ || !NILP (BVAR (current_buffer, read_only)))
918++ return TRUE;
919++ }
920++
921++ return FALSE;
922++ }
923++
924++
925++ void mac_init_input_method (void)
926++ {
927++ Qmac_keys_passed_to_system = intern ("mac-keys-passed-to-system");
928++ staticpro (&Qmac_keys_passed_to_system);
929++
930++ DEFVAR_LISP ("mac-use-input-method-on-system", Vmac_use_input_method_on_system,
931++ doc: /* If it is non-nil, use input method on system. */);
932++ Vmac_use_input_method_on_system = Qt;
933++
934++ defsubr (&Smac_input_source_is_ascii_capable);
935++ defsubr (&Smac_get_input_source_list);
936++ defsubr (&Smac_get_current_input_source);
937++ defsubr (&Smac_toggle_input_source);
938++ }
939++ #endif
940+diff -r -N -p ../emacs-24.3.org/src/nsfns.m src/nsfns.m
941+*** ../emacs-24.3.org/src/nsfns.m 2013-01-02 05:37:17.000000000 +0900
942+--- src/nsfns.m 2013-04-13 21:49:53.000000000 +0900
943+*************** static ptrdiff_t image_cache_refcount;
944+*** 107,113 ****
945+
946+ ========================================================================== */
947+
948+-
949+ void
950+ check_ns (void)
951+ {
952+--- 107,112 ----
953+*************** be used as the image of the icon represe
954+*** 2702,2707 ****
955+--- 2701,2724 ----
956+ doc: /* Toolkit version for NS Windowing. */);
957+ Vns_version_string = ns_appkit_version_str ();
958+
959++
960++ DEFVAR_LISP ("ns-shift-key-mask", Vns_shift_key_mask,
961++ doc: /* Shift key mask defined in system. */);
962++ Vns_shift_key_mask = make_number (NSShiftKeyMask);
963++
964++ DEFVAR_LISP ("ns-control-key-mask", Vns_control_key_mask,
965++ doc: /* Control key mask defined in system. */);
966++ Vns_control_key_mask = make_number (NSControlKeyMask);
967++
968++ DEFVAR_LISP ("ns-alternate-key-mask", Vns_alternate_key_mask,
969++ doc: /* Alternate key mask defined in system. */);
970++ Vns_alternate_key_mask = make_number (NSAlternateKeyMask);
971++
972++ DEFVAR_LISP ("ns-command-key-mask", Vns_command_key_mask,
973++ doc: /* Command key mask defined in system. */);
974++ Vns_command_key_mask = make_number (NSCommandKeyMask);
975++
976++
977+ defsubr (&Sns_read_file_name);
978+ defsubr (&Sns_get_resource);
979+ defsubr (&Sns_set_resource);
980+*************** be used as the image of the icon represe
981+*** 2746,2751 ****
982+--- 2763,2772 ----
983+ defsubr (&Sx_show_tip);
984+ defsubr (&Sx_hide_tip);
985+
986++ #ifdef NS_IMPL_COCOA
987++ mac_init_input_method ();
988++ #endif
989++
990+ /* used only in fontset.c */
991+ check_window_system_func = check_ns;
992+
993+diff -r -N -p ../emacs-24.3.org/src/nsterm.h src/nsterm.h
994+*** ../emacs-24.3.org/src/nsterm.h 2013-01-02 05:37:17.000000000 +0900
995+--- src/nsterm.h 2013-04-13 21:49:53.000000000 +0900
996+*************** typedef unsigned int NSUInteger;
997+*** 420,425 ****
998+--- 420,427 ----
999+ #define KEY_NS_NEW_FRAME ((1<<28)|(0<<16)|12)
1000+ #define KEY_NS_TOGGLE_TOOLBAR ((1<<28)|(0<<16)|13)
1001+ #define KEY_NS_SHOW_PREFS ((1<<28)|(0<<16)|14)
1002++ #define KEY_MAC_CHANGE_INPUT_METHOD ((1<<28)|(0<<16)|15)
1003++ #define KEY_NS_PUT_MARKED_TEXT ((1<<28)|(0<<16)|16)
1004+
1005+ /* could use list to store these, but rest of emacs has a big infrastructure
1006+ for managing a table of bitmap "records" */
1007+diff -r -N -p ../emacs-24.3.org/src/nsterm.m src/nsterm.m
1008+*** ../emacs-24.3.org/src/nsterm.m 2013-01-04 18:38:13.000000000 +0900
1009+--- src/nsterm.m 2013-04-13 21:53:51.000000000 +0900
1010+*************** ns_term_init (Lisp_Object display_name)
1011+*** 4049,4054 ****
1012+--- 4049,4057 ----
1013+ /* [[NSNotificationCenter defaultCenter] addObserver: NSApp
1014+ selector: @selector (logNotification:)
1015+ name: nil object: nil]; */
1016++ [[NSDistributedNotificationCenter defaultCenter] addObserver: NSApp
1017++ selector: @selector (changeInputMethod:)
1018++ name: @"AppleSelectedInputSourcesChangedNotification" object: nil];
1019+
1020+ dpyinfo = xzalloc (sizeof *dpyinfo);
1021+
1022+*************** ns_term_shutdown (int sig)
1023+*** 4278,4283 ****
1024+--- 4281,4301 ----
1025+ NSLog (@"notification: '%@'", [notification name]);
1026+ }
1027+
1028++ - (void)changeInputMethod: (NSNotification *)notification
1029++ {
1030++
1031++ struct frame *emacsframe = SELECTED_FRAME ();
1032++
1033++ if (mac_store_change_input_method_event())
1034++ {
1035++ if (!emacs_event)
1036++ return;
1037++ emacs_event->kind = NS_NONKEY_EVENT;
1038++ emacs_event->code = KEY_MAC_CHANGE_INPUT_METHOD;
1039++ emacs_event->modifiers = 0;
1040++ EV_TRAILER ((id)nil);
1041++ }
1042++ }
1043+
1044+ - (void)sendEvent: (NSEvent *)theEvent
1045+ /* --------------------------------------------------------------------------
1046+*************** not_in_argv (NSString *arg)
1047+*** 4957,4963 ****
1048+ code, fnKeysym, flags, emacs_event->modifiers);
1049+
1050+ /* if it was a function key or had modifiers, pass it directly to emacs */
1051+! if (fnKeysym || (emacs_event->modifiers
1052+ && (emacs_event->modifiers != shift_modifier)
1053+ && [[theEvent charactersIgnoringModifiers] length] > 0))
1054+ /*[[theEvent characters] length] */
1055+--- 4975,4982 ----
1056+ code, fnKeysym, flags, emacs_event->modifiers);
1057+
1058+ /* if it was a function key or had modifiers, pass it directly to emacs */
1059+! if (mac_pass_key_directly_to_emacs ()
1060+! ||fnKeysym || (emacs_event->modifiers
1061+ && (emacs_event->modifiers != shift_modifier)
1062+ && [[theEvent charactersIgnoringModifiers] length] > 0))
1063+ /*[[theEvent characters] length] */
1064+*************** not_in_argv (NSString *arg)
1065+*** 4972,4979 ****
1066+ ? MULTIBYTE_CHAR_KEYSTROKE_EVENT : ASCII_KEYSTROKE_EVENT;
1067+
1068+ emacs_event->code = code;
1069+! EV_TRAILER (theEvent);
1070+! return;
1071+ }
1072+ }
1073+
1074+--- 4991,5008 ----
1075+ ? MULTIBYTE_CHAR_KEYSTROKE_EVENT : ASCII_KEYSTROKE_EVENT;
1076+
1077+ emacs_event->code = code;
1078+! /* The function mac_pass_key_to_system decides
1079+! whether it is passed directly to emacs or not. */
1080+! if (emacs_event->kind == NON_ASCII_KEYSTROKE_EVENT
1081+! || !mac_pass_key_to_system (code, flags
1082+! & (NSShiftKeyMask
1083+! | NSControlKeyMask
1084+! | NSAlternateKeyMask
1085+! | NSCommandKeyMask)))
1086+! {
1087+! EV_TRAILER (theEvent);
1088+! return;
1089+! }
1090+ }
1091+ }
1092+
1093+*************** not_in_argv (NSString *arg)
1094+*** 5067,5076 ****
1095+ NSLog (@"setMarkedText '%@' len =%d range %d from %d", str, [str length],
1096+ selRange.length, selRange.location);
1097+
1098+- if (workingText != nil)
1099+- [self deleteWorkingText];
1100+ if ([str length] == 0)
1101+! return;
1102+
1103+ if (!emacs_event)
1104+ return;
1105+--- 5096,5114 ----
1106+ NSLog (@"setMarkedText '%@' len =%d range %d from %d", str, [str length],
1107+ selRange.length, selRange.location);
1108+
1109+ if ([str length] == 0)
1110+! {
1111+! [self deleteWorkingText];
1112+! return;
1113+! }
1114+! else
1115+! {
1116+! if (workingText != nil) {
1117+! [workingText release];
1118+! workingText = nil;
1119+! processingCompose = NO;
1120+! }
1121+! }
1122+
1123+ if (!emacs_event)
1124+ return;
1125+*************** not_in_argv (NSString *arg)
1126+*** 5080,5086 ****
1127+ ns_working_text = build_string ([workingText UTF8String]);
1128+
1129+ emacs_event->kind = NS_TEXT_EVENT;
1130+! emacs_event->code = KEY_NS_PUT_WORKING_TEXT;
1131+ EV_TRAILER ((id)nil);
1132+ }
1133+
1134+--- 5118,5126 ----
1135+ ns_working_text = build_string ([workingText UTF8String]);
1136+
1137+ emacs_event->kind = NS_TEXT_EVENT;
1138+! emacs_event->code = KEY_NS_PUT_MARKED_TEXT;
1139+! emacs_event->arg = Fcons (make_number (selRange.location),
1140+! Fcons (make_number (selRange.length), Qnil));
1141+ EV_TRAILER ((id)nil);
1142+ }
1143+
1144+*************** not_in_argv (NSString *arg)
1145+*** 5135,5149 ****
1146+ {
1147+ NSRect rect;
1148+ NSPoint pt;
1149+! struct window *win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
1150+ if (NS_KEYLOG)
1151+ NSLog (@"firstRectForCharRange request");
1152+
1153+ rect.size.width = theRange.length * FRAME_COLUMN_WIDTH (emacsframe);
1154+ rect.size.height = FRAME_LINE_HEIGHT (emacsframe);
1155+ pt.x = WINDOW_TEXT_TO_FRAME_PIXEL_X (win, win->phys_cursor.x);
1156+ pt.y = WINDOW_TO_FRAME_PIXEL_Y (win, win->phys_cursor.y
1157+! +FRAME_LINE_HEIGHT (emacsframe));
1158+
1159+ pt = [self convertPoint: pt toView: nil];
1160+ pt = [[self window] convertBaseToScreen: pt];
1161+--- 5175,5197 ----
1162+ {
1163+ NSRect rect;
1164+ NSPoint pt;
1165+! // struct window *win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
1166+! struct window *win;
1167+ if (NS_KEYLOG)
1168+ NSLog (@"firstRectForCharRange request");
1169++
1170++ if (NILP (Vmac_in_echo_area))
1171++ win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
1172++ else if (WINDOWP (echo_area_window))
1173++ win = XWINDOW (echo_area_window);
1174++ else
1175++ win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
1176+
1177+ rect.size.width = theRange.length * FRAME_COLUMN_WIDTH (emacsframe);
1178+ rect.size.height = FRAME_LINE_HEIGHT (emacsframe);
1179+ pt.x = WINDOW_TEXT_TO_FRAME_PIXEL_X (win, win->phys_cursor.x);
1180+ pt.y = WINDOW_TO_FRAME_PIXEL_Y (win, win->phys_cursor.y
1181+! +FRAME_LINE_HEIGHT (emacsframe)+2);
1182+
1183+ pt = [self convertPoint: pt toView: nil];
1184+ pt = [[self window] convertBaseToScreen: pt];
1185+*************** variable `x-use-underline-position-prope
1186+*** 7173,7178 ****
1187+--- 7221,7230 ----
1188+ baseline level. The default value is nil. */);
1189+ x_underline_at_descent_line = 0;
1190+
1191++ DEFVAR_LISP ("mac-in-echo-area", Vmac_in_echo_area,
1192++ doc: /* state of cursor in echo area. */);
1193++ Vmac_in_echo_area = Qnil;
1194++
1195+ /* Tell emacs about this window system. */
1196+ Fprovide (intern ("ns"), Qnil);
1197+ }
1198+*** ../emacs-24.3.org/configure 2013-03-08 17:13:36.000000000 +0900
1199+--- configure 2013-04-13 23:11:56.000000000 +0900
1200+*************** if test "${HAVE_NS}" = yes; then
1201+*** 9650,9656 ****
1202+ leimdir="\${ns_appresdir}/leim"
1203+ INSTALL_ARCH_INDEP_EXTRA=
1204+ fi
1205+! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
1206+ fi
1207+ CFLAGS="$tmp_CFLAGS"
1208+ CPPFLAGS="$tmp_CPPFLAGS"
1209+--- 9650,9656 ----
1210+ leimdir="\${ns_appresdir}/leim"
1211+ INSTALL_ARCH_INDEP_EXTRA=
1212+ fi
1213+! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macim.o"
1214+ fi
1215+ CFLAGS="$tmp_CFLAGS"
1216+ CPPFLAGS="$tmp_CPPFLAGS"
1217+*************** case "$opsys" in
1218+*** 24618,24624 ****
1219+ ## 0x690 is the total size of 30 segment load commands (at 56
1220+ ## each); under Cocoa 31 commands are required.
1221+ if test "$HAVE_NS" = "yes"; then
1222+! libs_nsgui="-framework AppKit"
1223+ headerpad_extra=6C8
1224+ else
1225+ libs_nsgui=
1226+--- 24618,24624 ----
1227+ ## 0x690 is the total size of 30 segment load commands (at 56
1228+ ## each); under Cocoa 31 commands are required.
1229+ if test "$HAVE_NS" = "yes"; then
1230+! libs_nsgui="-framework AppKit -framework Carbon -framework Cocoa"
1231+ headerpad_extra=6C8
1232+ else
1233+ libs_nsgui=
1234+*** ../emacs-24.3.org/configure.ac 2013-03-05 17:24:59.000000000 +0900
1235+--- configure.ac 2013-04-13 23:11:56.000000000 +0900
1236+*************** if test "${HAVE_NS}" = yes; then
1237+*** 1571,1577 ****
1238+ leimdir="\${ns_appresdir}/leim"
1239+ INSTALL_ARCH_INDEP_EXTRA=
1240+ fi
1241+! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
1242+ fi
1243+ CFLAGS="$tmp_CFLAGS"
1244+ CPPFLAGS="$tmp_CPPFLAGS"
1245+--- 1571,1577 ----
1246+ leimdir="\${ns_appresdir}/leim"
1247+ INSTALL_ARCH_INDEP_EXTRA=
1248+ fi
1249+! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macim.o"
1250+ fi
1251+ CFLAGS="$tmp_CFLAGS"
1252+ CPPFLAGS="$tmp_CPPFLAGS"
1253+*************** case "$opsys" in
1254+*** 4322,4328 ****
1255+ ## 0x690 is the total size of 30 segment load commands (at 56
1256+ ## each); under Cocoa 31 commands are required.
1257+ if test "$HAVE_NS" = "yes"; then
1258+! libs_nsgui="-framework AppKit"
1259+ headerpad_extra=6C8
1260+ else
1261+ libs_nsgui=
1262+--- 4322,4328 ----
1263+ ## 0x690 is the total size of 30 segment load commands (at 56
1264+ ## each); under Cocoa 31 commands are required.
1265+ if test "$HAVE_NS" = "yes"; then
1266+! libs_nsgui="-framework AppKit -framework Carbon -framework Cocoa"
1267+ headerpad_extra=6C8
1268+ else
1269+ libs_nsgui=
Show on old repository browser