aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2005-12-26 03:16:59 +0000
committerKaroly Lorentey2005-12-26 03:16:59 +0000
commitfeba0cd6405ebb80af743e2f978442d9c837bcd2 (patch)
tree1cb964aa641bee514d9cda2eafe27a0a97e65ad1 /src
parent30663b475e57197c9896a252e1d4ca31c579fa2b (diff)
parent7a32e81fb608282314e27db21a00138aaa91f29a (diff)
downloademacs-feba0cd6405ebb80af743e2f978442d9c837bcd2.tar.gz
emacs-feba0cd6405ebb80af743e2f978442d9c837bcd2.zip
Merged from miles@gnu.org--gnu-2005 (patch 677)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-677 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-463
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog54
-rw-r--r--src/category.c6
-rw-r--r--src/category.h5
-rw-r--r--src/ccl.c5
-rw-r--r--src/ccl.h5
-rw-r--r--src/charset.c5
-rw-r--r--src/charset.h5
-rw-r--r--src/coding.c5
-rw-r--r--src/coding.h5
-rw-r--r--src/composite.c5
-rw-r--r--src/composite.h5
-rw-r--r--src/fontset.c5
-rw-r--r--src/fontset.h7
-rw-r--r--src/keyboard.c13
-rw-r--r--src/mac.c138
-rw-r--r--src/macmenu.c3
-rw-r--r--src/macterm.c131
-rw-r--r--src/macterm.h2
-rw-r--r--src/termhooks.h8
-rw-r--r--src/w32menu.c3
-rw-r--r--src/w32term.c4
-rw-r--r--src/xfns.c9
-rw-r--r--src/xmenu.c5
-rw-r--r--src/xselect.c4
24 files changed, 237 insertions, 200 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 275477a765f..969f9f6c46d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,57 @@
12005-12-20 Juri Linkov <juri@jurta.org>
2
3 * xmenu.c (Fx_popup_menu): Set Vmenu_updating_frame to f if
4 position is non-nil, else set it to nil.
5
6 * macmenu.c (Fx_popup_menu): Add `else' to set
7 Vmenu_updating_frame to nil only if position is nil.
8
9 * w32menu.c (Fx_popup_menu): Add `else' to set
10 Vmenu_updating_frame to nil only if position is nil.
11
122005-12-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13
14 * keyboard.c (make_lispy_event): Drag-and-drop items are now
15 stored in member `args' of struct input_event.
16
17 * termhooks.h (struct input_event): Fix comment for DRAG_N_DROP_EVENT.
18
19 * xselect.c (x_handle_dnd_message): Drag-and-drop items are now
20 stored in member `args' of struct input_event.
21
22 * w32term.c (construct_drag_n_drop): Likewise.
23
24 * macterm.c (mac_do_receive_drag): Likewise.
25 (x_use_underline_position_properties): Undo 2005-07-13 change.
26 (syms_of_macterm) <x-use-underline-position-properties>: Likewise.
27 (mac_use_core_graphics, mac_wheel_button_is_mouse_2)
28 (mac_pass_command_to_system, mac_pass_control_to_system): New
29 boolean variables renamed from Lisp_Object ones
30 Vmac_use_core_graphics, Vmac_wheel_button_is_mouse_2,
31 Vmac_pass_command_to_system, and Vmac_pass_control_to_system. All
32 uses changed.
33 (syms_of_macterm): DEFVAR_BOOL them. Remove previous DEFVAR_LISPs.
34 Make them user options.
35 (mac_handle_command_event, mac_store_services_event): Call
36 create_apple_event_from_event_ref without 5th argument.
37 (backtranslate_modified_keycode): Mask off modifier keys that are
38 mapped to some Emacs modifiers before passing it to KeyTranslate.
39 (syms_of_macterm): Make variables `mac-emulate-three-button-mouse',
40 `mac-wheel-button-is-mouse-2', and `mac-*-modifier' user options.
41 Fix docstrings of `mac-*-modifier'.
42
43 * mac.c (create_apple_event_from_event_ref): Remove arg `types'.
44 (do_applescript): Change argument types to Lisp_Object. All uses
45 changed.
46
47 * macterm.h (create_apple_event_from_event_ref): Remove 5th
48 argument from extern.
49
502005-12-18 Dan Nicolaescu <dann@ics.uci.edu>
51
52 * xfns.c (Fx_backspace_delete_keys_p): In case we cannot determine
53 the answer, return `lambda', not nil.
54
12005-12-17 Eli Zaretskii <eliz@gnu.org> 552005-12-17 Eli Zaretskii <eliz@gnu.org>
2 56
3 * makefile.w32-in (bootstrap-temacs): Warn that parts of commands 57 * makefile.w32-in (bootstrap-temacs): Warn that parts of commands
diff --git a/src/category.c b/src/category.c
index e1e59a317a1..866a7cdd429 100644
--- a/src/category.c
+++ b/src/category.c
@@ -1,6 +1,8 @@
1/* GNU Emacs routines to deal with category tables. 1/* GNU Emacs routines to deal with category tables.
2 Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1998, 2001, 2004 Free Software Foundation, Inc.
3 Licensed to the Free Software Foundation. 3 Copyright (C) 1995, 1997, 1998, 1999
4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H14PRO021
4 6
5This file is part of GNU Emacs. 7This file is part of GNU Emacs.
6 8
diff --git a/src/category.h b/src/category.h
index ac79c13a83b..ade8704db09 100644
--- a/src/category.h
+++ b/src/category.h
@@ -1,6 +1,7 @@
1/* Declarations having to do with Emacs category tables. 1/* Declarations having to do with Emacs category tables.
2 Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1995, 1998, 1999
3 Licensed to the Free Software Foundation. 3 National Institute of Advanced Industrial Science and Technology (AIST)
4 Registration Number H14PRO021
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
diff --git a/src/ccl.c b/src/ccl.c
index a5a39ca0d4b..69658f779a7 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1,7 +1,8 @@
1/* CCL (Code Conversion Language) interpreter. 1/* CCL (Code Conversion Language) interpreter.
2 Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 2 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1997, 1998, 2003, 2004, 2005
4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H14PRO021
5 6
6This file is part of GNU Emacs. 7This file is part of GNU Emacs.
7 8
diff --git a/src/ccl.h b/src/ccl.h
index 0a897835388..21a72df1d0b 100644
--- a/src/ccl.h
+++ b/src/ccl.h
@@ -1,6 +1,7 @@
1/* Header for CCL (Code Conversion Language) interpreter. 1/* Header for CCL (Code Conversion Language) interpreter.
2 Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1995, 1998, 2000
3 Licensed to the Free Software Foundation. 3 National Institute of Advanced Industrial Science and Technology (AIST)
4 Registration Number H14PRO021
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
diff --git a/src/charset.c b/src/charset.c
index 23b2cc75c1f..2c985b14dbc 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1,7 +1,8 @@
1/* Basic multilingual character support. 1/* Basic multilingual character support.
2 Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 2 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001
4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H14PRO021
5 6
6This file is part of GNU Emacs. 7This file is part of GNU Emacs.
7 8
diff --git a/src/charset.h b/src/charset.h
index b487e1d220e..d6b1dee187f 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -1,7 +1,8 @@
1/* Header for multibyte character handler. 1/* Header for multibyte character handler.
2 Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 2 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1997, 1998, 2003
4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H14PRO021
5 6
6This file is part of GNU Emacs. 7This file is part of GNU Emacs.
7 8
diff --git a/src/coding.c b/src/coding.c
index 0ffb37f4bfa..759a97567c1 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -1,7 +1,8 @@
1/* Coding system handler (conversion, detection, and etc). 1/* Coding system handler (conversion, detection, and etc).
2 Copyright (C) 1995,97,1998,2002,2003 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 2 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1997, 1998, 2002, 2003, 2004, 2005
4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H14PRO021
5 6
6This file is part of GNU Emacs. 7This file is part of GNU Emacs.
7 8
diff --git a/src/coding.h b/src/coding.h
index 42e73a36430..609720b9751 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -1,7 +1,8 @@
1/* Header for coding system handler. 1/* Header for coding system handler.
2 Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation.
4 Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 2 Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1997, 1998, 2000
4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H14PRO021
5 6
6This file is part of GNU Emacs. 7This file is part of GNU Emacs.
7 8
diff --git a/src/composite.c b/src/composite.c
index f03d5054c33..54aa2ed9840 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1,7 +1,8 @@
1/* Composite sequence support. 1/* Composite sequence support.
2 Copyright (C) 1999 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 2 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Copyright (C) 1999
4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H14PRO021
5 6
6This file is part of GNU Emacs. 7This file is part of GNU Emacs.
7 8
diff --git a/src/composite.h b/src/composite.h
index cdcc9301792..99db0506814 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -1,7 +1,8 @@
1/* Header for composite sequence handler. 1/* Header for composite sequence handler.
2 Copyright (C) 1999 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 2 Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Copyright (C) 1997
4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H14PRO021
5 6
6This file is part of GNU Emacs. 7This file is part of GNU Emacs.
7 8
diff --git a/src/fontset.c b/src/fontset.c
index 4529e6c2134..871ce9926f7 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1,7 +1,8 @@
1/* Fontset handler. 1/* Fontset handler.
2 Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation.
4 Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 2 Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Copyright (C) 1995, 1997, 1998, 2000, 2003, 2004, 2005
4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H14PRO021
5 6
6This file is part of GNU Emacs. 7This file is part of GNU Emacs.
7 8
diff --git a/src/fontset.h b/src/fontset.h
index 3a4932af6c0..aaf12facf94 100644
--- a/src/fontset.h
+++ b/src/fontset.h
@@ -1,7 +1,8 @@
1/* Header for fontset handler. 1/* Header for fontset handler.
2 Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1998, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Licensed to the Free Software Foundation. 3 Copyright (C) 1995, 1997, 2000
4 Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 4 National Institute of Advanced Industrial Science and Technology (AIST)
5 Registration Number H14PRO021
5 6
6This file is part of GNU Emacs. 7This file is part of GNU Emacs.
7 8
diff --git a/src/keyboard.c b/src/keyboard.c
index 95f2daf78ac..76ff053410e 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -5854,14 +5854,8 @@ make_lispy_event (event)
5854 Lisp_Object head, position; 5854 Lisp_Object head, position;
5855 Lisp_Object files; 5855 Lisp_Object files;
5856 5856
5857 /* The frame_or_window field should be a cons of the frame in 5857 f = XFRAME (event->frame_or_window);
5858 which the event occurred and a list of the filenames 5858 files = event->arg;
5859 dropped. */
5860 if (! CONSP (event->frame_or_window))
5861 abort ();
5862
5863 f = XFRAME (XCAR (event->frame_or_window));
5864 files = XCDR (event->frame_or_window);
5865 5859
5866 /* Ignore mouse events that were made on frames that 5860 /* Ignore mouse events that were made on frames that
5867 have been deleted. */ 5861 have been deleted. */
@@ -11721,6 +11715,9 @@ active keymaps have no binding for the current key sequence but
11721string, `read-key-sequence' replaces the matching suffix with its 11715string, `read-key-sequence' replaces the matching suffix with its
11722binding, and continues with the new sequence. 11716binding, and continues with the new sequence.
11723 11717
11718If the binding is a function, it is called with one argument (the prompt)
11719and its return value (a key sequence) is used.
11720
11724The events that come from bindings in `local-function-key-map' are not 11721The events that come from bindings in `local-function-key-map' are not
11725themselves looked up in `local-function-key-map'. 11722themselves looked up in `local-function-key-map'.
11726 11723
diff --git a/src/mac.c b/src/mac.c
index 1d306c429d7..d81c6d6a0ae 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -399,19 +399,17 @@ mac_aedesc_to_lisp (desc)
399 399
400#if TARGET_API_MAC_CARBON 400#if TARGET_API_MAC_CARBON
401OSErr 401OSErr
402create_apple_event_from_event_ref (event, num_params, names, 402create_apple_event_from_event_ref (event, num_params, names, types, result)
403 types, sizes, result)
404 EventRef event; 403 EventRef event;
405 UInt32 num_params; 404 UInt32 num_params;
406 EventParamName *names; 405 EventParamName *names;
407 EventParamType *types; 406 EventParamType *types;
408 UInt32 *sizes;
409 AppleEvent *result; 407 AppleEvent *result;
410{ 408{
411 OSErr err; 409 OSErr err;
412 static const ProcessSerialNumber psn = {0, kCurrentProcess}; 410 static const ProcessSerialNumber psn = {0, kCurrentProcess};
413 AEAddressDesc address_desc; 411 AEAddressDesc address_desc;
414 UInt32 i; 412 UInt32 i, size;
415 CFStringRef string; 413 CFStringRef string;
416 CFDataRef data; 414 CFDataRef data;
417 char *buf; 415 char *buf;
@@ -452,13 +450,17 @@ create_apple_event_from_event_ref (event, num_params, names,
452#endif 450#endif
453 451
454 default: 452 default:
455 buf = xmalloc (sizes[i]); 453 err = GetEventParameter (event, names[i], types[i], NULL,
454 0, &size, NULL);
455 if (err != noErr)
456 break;
457 buf = xmalloc (size);
456 if (buf == NULL) 458 if (buf == NULL)
457 break; 459 break;
458 err = GetEventParameter (event, names[i], types[i], NULL, 460 err = GetEventParameter (event, names[i], types[i], NULL,
459 sizes[i], NULL, buf); 461 size, NULL, buf);
460 if (err == noErr) 462 if (err == noErr)
461 AEPutParamPtr (result, names[i], types[i], buf, sizes[i]); 463 AEPutParamPtr (result, names[i], types[i], buf, size);
462 xfree (buf); 464 xfree (buf);
463 break; 465 break;
464 } 466 }
@@ -3189,7 +3191,10 @@ mystrcpy (char *to, char *from)
3189 wildcard filename expansion. Since we don't really have a shell on 3191 wildcard filename expansion. Since we don't really have a shell on
3190 the Mac, this case is detected and the starting of the shell is 3192 the Mac, this case is detected and the starting of the shell is
3191 by-passed. We really need to add code here to do filename 3193 by-passed. We really need to add code here to do filename
3192 expansion to support such functionality. */ 3194 expansion to support such functionality.
3195
3196 We can't use this strategy in Carbon because the High Level Event
3197 APIs are not available. */
3193 3198
3194int 3199int
3195run_mac_command (argv, workdir, infn, outfn, errfn) 3200run_mac_command (argv, workdir, infn, outfn, errfn)
@@ -3933,84 +3938,53 @@ CODE must be a 4-character string. Return non-nil if successful. */)
3933 3938
3934/* Compile and execute the AppleScript SCRIPT and return the error 3939/* Compile and execute the AppleScript SCRIPT and return the error
3935 status as function value. A zero is returned if compilation and 3940 status as function value. A zero is returned if compilation and
3936 execution is successful, in which case RESULT returns a pointer to 3941 execution is successful, in which case *RESULT is set to a Lisp
3937 a string containing the resulting script value. Otherwise, the Mac 3942 string containing the resulting script value. Otherwise, the Mac
3938 error code is returned and RESULT returns a pointer to an error 3943 error code is returned and *RESULT is set to an error Lisp string.
3939 string. In both cases the caller should deallocate the storage 3944 For documentation on the MacOS scripting architecture, see Inside
3940 used by the string pointed to by RESULT if it is non-NULL. For 3945 Macintosh - Interapplication Communications: Scripting
3941 documentation on the MacOS scripting architecture, see Inside 3946 Components. */
3942 Macintosh - Interapplication Communications: Scripting Components. */
3943 3947
3944static long 3948static long
3945do_applescript (char *script, char **result) 3949do_applescript (script, result)
3950 Lisp_Object script, *result;
3946{ 3951{
3947 AEDesc script_desc, result_desc, error_desc; 3952 AEDesc script_desc, result_desc, error_desc, *desc = NULL;
3948 OSErr error; 3953 OSErr error;
3949 OSAError osaerror; 3954 OSAError osaerror;
3950 long length;
3951 3955
3952 *result = 0; 3956 *result = Qnil;
3953 3957
3954 if (!as_scripting_component) 3958 if (!as_scripting_component)
3955 initialize_applescript(); 3959 initialize_applescript();
3956 3960
3957 error = AECreateDesc (typeChar, script, strlen(script), &script_desc); 3961 error = AECreateDesc (typeChar, SDATA (script), SBYTES (script),
3962 &script_desc);
3958 if (error) 3963 if (error)
3959 return error; 3964 return error;
3960 3965
3961 osaerror = OSADoScript (as_scripting_component, &script_desc, kOSANullScript, 3966 osaerror = OSADoScript (as_scripting_component, &script_desc, kOSANullScript,
3962 typeChar, kOSAModeNull, &result_desc); 3967 typeChar, kOSAModeNull, &result_desc);
3963 3968
3964 if (osaerror == errOSAScriptError) 3969 if (osaerror == noErr)
3965 { 3970 /* success: retrieve resulting script value */
3966 /* error executing AppleScript: retrieve error message */ 3971 desc = &result_desc;
3967 if (!OSAScriptError (as_scripting_component, kOSAErrorMessage, typeChar, 3972 else if (osaerror == errOSAScriptError)
3968 &error_desc)) 3973 /* error executing AppleScript: retrieve error message */
3969 { 3974 if (!OSAScriptError (as_scripting_component, kOSAErrorMessage, typeChar,
3970#if TARGET_API_MAC_CARBON 3975 &error_desc))
3971 length = AEGetDescDataSize (&error_desc); 3976 desc = &error_desc;
3972 *result = (char *) xmalloc (length + 1); 3977
3973 if (*result) 3978 if (desc)
3974 {
3975 AEGetDescData (&error_desc, *result, length);
3976 *(*result + length) = '\0';
3977 }
3978#else /* not TARGET_API_MAC_CARBON */
3979 HLock (error_desc.dataHandle);
3980 length = GetHandleSize(error_desc.dataHandle);
3981 *result = (char *) xmalloc (length + 1);
3982 if (*result)
3983 {
3984 memcpy (*result, *(error_desc.dataHandle), length);
3985 *(*result + length) = '\0';
3986 }
3987 HUnlock (error_desc.dataHandle);
3988#endif /* not TARGET_API_MAC_CARBON */
3989 AEDisposeDesc (&error_desc);
3990 }
3991 }
3992 else if (osaerror == noErr) /* success: retrieve resulting script value */
3993 { 3979 {
3994#if TARGET_API_MAC_CARBON 3980#if TARGET_API_MAC_CARBON
3995 length = AEGetDescDataSize (&result_desc); 3981 *result = make_uninit_string (AEGetDescDataSize (desc));
3996 *result = (char *) xmalloc (length + 1); 3982 AEGetDescData (desc, SDATA (*result), SBYTES (*result));
3997 if (*result)
3998 {
3999 AEGetDescData (&result_desc, *result, length);
4000 *(*result + length) = '\0';
4001 }
4002#else /* not TARGET_API_MAC_CARBON */ 3983#else /* not TARGET_API_MAC_CARBON */
4003 HLock (result_desc.dataHandle); 3984 *result = make_uninit_string (GetHandleSize (desc->dataHandle));
4004 length = GetHandleSize(result_desc.dataHandle); 3985 memcpy (SDATA (*result), *(desc->dataHandle), SBYTES (*result));
4005 *result = (char *) xmalloc (length + 1);
4006 if (*result)
4007 {
4008 memcpy (*result, *(result_desc.dataHandle), length);
4009 *(*result + length) = '\0';
4010 }
4011 HUnlock (result_desc.dataHandle);
4012#endif /* not TARGET_API_MAC_CARBON */ 3986#endif /* not TARGET_API_MAC_CARBON */
4013 AEDisposeDesc (&result_desc); 3987 AEDisposeDesc (desc);
4014 } 3988 }
4015 3989
4016 AEDisposeDesc (&script_desc); 3990 AEDisposeDesc (&script_desc);
@@ -4028,38 +4002,20 @@ component. */)
4028 (script) 4002 (script)
4029 Lisp_Object script; 4003 Lisp_Object script;
4030{ 4004{
4031 char *result, *temp; 4005 Lisp_Object result;
4032 Lisp_Object lisp_result;
4033 long status; 4006 long status;
4034 4007
4035 CHECK_STRING (script); 4008 CHECK_STRING (script);
4036 4009
4037 BLOCK_INPUT; 4010 BLOCK_INPUT;
4038 status = do_applescript (SDATA (script), &result); 4011 status = do_applescript (script, &result);
4039 UNBLOCK_INPUT; 4012 UNBLOCK_INPUT;
4040 if (status) 4013 if (status == 0)
4041 { 4014 return result;
4042 if (!result) 4015 else if (!STRINGP (result))
4043 error ("AppleScript error %d", status); 4016 error ("AppleScript error %d", status);
4044 else
4045 {
4046 /* Unfortunately only OSADoScript in do_applescript knows how
4047 how large the resulting script value or error message is
4048 going to be and therefore as caller memory must be
4049 deallocated here. It is necessary to free the error
4050 message before calling error to avoid a memory leak. */
4051 temp = (char *) alloca (strlen (result) + 1);
4052 strcpy (temp, result);
4053 xfree (result);
4054 error (temp);
4055 }
4056 }
4057 else 4017 else
4058 { 4018 error ("%s", SDATA (result));
4059 lisp_result = build_string (result);
4060 xfree (result);
4061 return lisp_result;
4062 }
4063} 4019}
4064 4020
4065 4021
diff --git a/src/macmenu.c b/src/macmenu.c
index a68ff04e405..064cec57486 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -746,7 +746,8 @@ no quit occurs and `x-popup-menu' returns nil. */)
746 746
747 XSETFRAME (Vmenu_updating_frame, f); 747 XSETFRAME (Vmenu_updating_frame, f);
748 } 748 }
749 Vmenu_updating_frame = Qnil; 749 else
750 Vmenu_updating_frame = Qnil;
750#endif /* HAVE_MENUS */ 751#endif /* HAVE_MENUS */
751 752
752 title = Qnil; 753 title = Qnil;
diff --git a/src/macterm.c b/src/macterm.c
index ba39450b4b4..cbf7078cb25 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -93,8 +93,9 @@ Boston, MA 02110-1301, USA. */
93 93
94Lisp_Object Vx_toolkit_scroll_bars; 94Lisp_Object Vx_toolkit_scroll_bars;
95 95
96/* If Non-nil, the text will be rendered using Core Graphics text rendering which may anti-alias the text. */ 96/* If non-zero, the text will be rendered using Core Graphics text
97Lisp_Object Vmac_use_core_graphics; 97 rendering which may anti-alias the text. */
98int mac_use_core_graphics;
98 99
99 100
100/* Non-zero means that a HELP_EVENT has been generated since Emacs 101/* Non-zero means that a HELP_EVENT has been generated since Emacs
@@ -105,6 +106,10 @@ static int any_help_event_p;
105/* Last window where we saw the mouse. Used by mouse-autoselect-window. */ 106/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
106static Lisp_Object last_window; 107static Lisp_Object last_window;
107 108
109/* Non-zero means make use of UNDERLINE_POSITION font properties.
110 (Not yet supported.) */
111int x_use_underline_position_properties;
112
108/* This is a chain of structures for all the X displays currently in 113/* This is a chain of structures for all the X displays currently in
109 use. */ 114 use. */
110 115
@@ -199,8 +204,7 @@ extern EMACS_INT extra_keyboard_modifiers;
199 204
200/* The keysyms to use for the various modifiers. */ 205/* The keysyms to use for the various modifiers. */
201 206
202static Lisp_Object Qalt, Qhyper, Qsuper, Qcontrol, 207static Lisp_Object Qalt, Qhyper, Qsuper, Qcontrol, Qmeta, Qmodifier_value;
203 Qmeta, Qmodifier_value;
204 208
205extern int inhibit_window_system; 209extern int inhibit_window_system;
206 210
@@ -687,7 +691,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, mode, bytes_per_char)
687{ 691{
688#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 692#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
689 UInt32 textFlags, savedFlags; 693 UInt32 textFlags, savedFlags;
690 if (!NILP(Vmac_use_core_graphics)) { 694 if (mac_use_core_graphics) {
691 textFlags = kQDUseCGTextRendering; 695 textFlags = kQDUseCGTextRendering;
692 savedFlags = SwapQDTextFlags(textFlags); 696 savedFlags = SwapQDTextFlags(textFlags);
693 } 697 }
@@ -723,7 +727,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, mode, bytes_per_char)
723 if (err == noErr) 727 if (err == noErr)
724 { 728 {
725#ifdef MAC_OSX 729#ifdef MAC_OSX
726 if (NILP (Vmac_use_core_graphics)) 730 if (!mac_use_core_graphics)
727 { 731 {
728#endif 732#endif
729 mac_begin_clip (GC_CLIP_REGION (gc)); 733 mac_begin_clip (GC_CLIP_REGION (gc));
@@ -802,7 +806,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, mode, bytes_per_char)
802 if (mode != srcOr) 806 if (mode != srcOr)
803 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f))); 807 RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
804#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 808#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
805 if (!NILP(Vmac_use_core_graphics)) 809 if (mac_use_core_graphics)
806 SwapQDTextFlags(savedFlags); 810 SwapQDTextFlags(savedFlags);
807#endif 811#endif
808} 812}
@@ -895,7 +899,7 @@ mac_draw_string_cg (f, gc, x, y, buf, nchars)
895 CGGlyph *glyphs; 899 CGGlyph *glyphs;
896 CGSize *advances; 900 CGSize *advances;
897 901
898 if (NILP (Vmac_use_core_graphics) || GC_FONT (gc)->cg_font == NULL) 902 if (!mac_use_core_graphics || GC_FONT (gc)->cg_font == NULL)
899 return 0; 903 return 0;
900 904
901 port = GetWindowPort (FRAME_MAC_WINDOW (f)); 905 port = GetWindowPort (FRAME_MAC_WINDOW (f));
@@ -8109,17 +8113,17 @@ Lisp_Object Vmac_function_modifier;
8109Lisp_Object Vmac_emulate_three_button_mouse; 8113Lisp_Object Vmac_emulate_three_button_mouse;
8110 8114
8111#if USE_CARBON_EVENTS 8115#if USE_CARBON_EVENTS
8112/* True if the mouse wheel button (i.e. button 4) should map to 8116/* Non-zero if the mouse wheel button (i.e. button 4) should map to
8113 mouse-2, instead of mouse-3. */ 8117 mouse-2, instead of mouse-3. */
8114Lisp_Object Vmac_wheel_button_is_mouse_2; 8118int mac_wheel_button_is_mouse_2;
8115 8119
8116/* If Non-nil, the Mac "Command" key is passed on to the Mac Toolbox 8120/* If non-zero, the Mac "Command" key is passed on to the Mac Toolbox
8117 for processing before Emacs sees it. */ 8121 for processing before Emacs sees it. */
8118Lisp_Object Vmac_pass_command_to_system; 8122int mac_pass_command_to_system;
8119 8123
8120/* If Non-nil, the Mac "Control" key is passed on to the Mac Toolbox 8124/* If non-zero, the Mac "Control" key is passed on to the Mac Toolbox
8121 for processing before Emacs sees it. */ 8125 for processing before Emacs sees it. */
8122Lisp_Object Vmac_pass_control_to_system; 8126int mac_pass_control_to_system;
8123#endif 8127#endif
8124 8128
8125/* Points to the variable `inev' in the function XTread_socket. It is 8129/* Points to the variable `inev' in the function XTread_socket. It is
@@ -8176,8 +8180,6 @@ mac_to_emacs_modifiers (EventModifiers mods)
8176 if (mods & shiftKey) 8180 if (mods & shiftKey)
8177 result |= shift_modifier; 8181 result |= shift_modifier;
8178 8182
8179
8180
8181 /* Deactivated to simplify configuration: 8183 /* Deactivated to simplify configuration:
8182 if Vmac_option_modifier is non-NIL, we fully process the Option 8184 if Vmac_option_modifier is non-NIL, we fully process the Option
8183 key. Otherwise, we only process it if an additional Ctrl or Command 8185 key. Otherwise, we only process it if an additional Ctrl or Command
@@ -8265,10 +8267,10 @@ mac_get_mouse_btn (EventRef ref)
8265 return mac_get_emulated_btn(mods); 8267 return mac_get_emulated_btn(mods);
8266 } 8268 }
8267 case kEventMouseButtonSecondary: 8269 case kEventMouseButtonSecondary:
8268 return NILP (Vmac_wheel_button_is_mouse_2) ? 1 : 2; 8270 return mac_wheel_button_is_mouse_2 ? 2 : 1;
8269 case kEventMouseButtonTertiary: 8271 case kEventMouseButtonTertiary:
8270 case 4: /* 4 is the number for the mouse wheel button */ 8272 case 4: /* 4 is the number for the mouse wheel button */
8271 return NILP (Vmac_wheel_button_is_mouse_2) ? 2 : 1; 8273 return mac_wheel_button_is_mouse_2 ? 1 : 2;
8272 default: 8274 default:
8273 return 0; 8275 return 0;
8274 } 8276 }
@@ -8779,10 +8781,8 @@ mac_handle_command_event (next_handler, event, data)
8779 kEventParamKeyModifiers}; 8781 kEventParamKeyModifiers};
8780 static EventParamType types[] = {typeHICommand, 8782 static EventParamType types[] = {typeHICommand,
8781 typeUInt32}; 8783 typeUInt32};
8782 static UInt32 sizes[] = {sizeof (HICommand),
8783 sizeof (UInt32)};
8784 err = create_apple_event_from_event_ref (event, 2, names, types, 8784 err = create_apple_event_from_event_ref (event, 2, names, types,
8785 sizes, &apple_event); 8785 &apple_event);
8786 if (err == noErr) 8786 if (err == noErr)
8787 { 8787 {
8788 err = mac_store_apple_event (class_key, id_key, &apple_event); 8788 err = mac_store_apple_event (class_key, id_key, &apple_event);
@@ -8966,8 +8966,8 @@ mac_store_services_event (event)
8966 { 8966 {
8967 case kEventServicePaste: 8967 case kEventServicePaste:
8968 id_key = Qpaste; 8968 id_key = Qpaste;
8969 err = create_apple_event_from_event_ref (event, 0, NULL, 8969 err = create_apple_event_from_event_ref (event, 0, NULL, NULL,
8970 NULL, NULL, &apple_event); 8970 &apple_event);
8971 break; 8971 break;
8972 8972
8973 case kEventServicePerform: 8973 case kEventServicePerform:
@@ -8976,12 +8976,10 @@ mac_store_services_event (event)
8976 kEventParamServiceUserData}; 8976 kEventParamServiceUserData};
8977 static EventParamType types[] = {typeCFStringRef, 8977 static EventParamType types[] = {typeCFStringRef,
8978 typeCFStringRef}; 8978 typeCFStringRef};
8979 static UInt32 sizes[] = {sizeof (CFStringRef),
8980 sizeof (CFStringRef)};
8981 8979
8982 id_key = Qperform; 8980 id_key = Qperform;
8983 err = create_apple_event_from_event_ref (event, 2, names, types, 8981 err = create_apple_event_from_event_ref (event, 2, names, types,
8984 sizes, &apple_event); 8982 &apple_event);
8985 } 8983 }
8986 break; 8984 break;
8987 8985
@@ -9191,8 +9189,8 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
9191 XSETINT (event.x, mouse.h); 9189 XSETINT (event.x, mouse.h);
9192 XSETINT (event.y, mouse.v); 9190 XSETINT (event.y, mouse.v);
9193 XSETFRAME (frame, f); 9191 XSETFRAME (frame, f);
9194 event.frame_or_window = Fcons (frame, file_list); 9192 event.frame_or_window = frame;
9195 event.arg = Qnil; 9193 event.arg = file_list;
9196 /* Post to the interrupt queue */ 9194 /* Post to the interrupt queue */
9197 kbd_buffer_store_event (&event); 9195 kbd_buffer_store_event (&event);
9198 /* MAC_TODO: Mimic behavior of windows by switching contexts to Emacs */ 9196 /* MAC_TODO: Mimic behavior of windows by switching contexts to Emacs */
@@ -9411,10 +9409,12 @@ convert_fn_keycode (EventRef eventRef, int keyCode, int *newCode)
9411static int 9409static int
9412backtranslate_modified_keycode(int mods, int keycode, int def) 9410backtranslate_modified_keycode(int mods, int keycode, int def)
9413{ 9411{
9414 if (mods & 9412 EventModifiers mapped_modifiers =
9415 (controlKey | 9413 (NILP (Vmac_control_modifier) ? 0 : controlKey)
9416 (NILP (Vmac_option_modifier) ? 0 : optionKey) | 9414 | (NILP (Vmac_option_modifier) ? 0 : optionKey)
9417 cmdKey)) 9415 | (NILP (Vmac_command_modifier) ? 0 : cmdKey);
9416
9417 if (mods & mapped_modifiers)
9418 { 9418 {
9419 /* This code comes from Keyboard Resource, 9419 /* This code comes from Keyboard Resource,
9420 Appendix C of IM - Text. This is necessary 9420 Appendix C of IM - Text. This is necessary
@@ -9429,14 +9429,15 @@ backtranslate_modified_keycode(int mods, int keycode, int def)
9429 to preserve key combinations translated by the OS 9429 to preserve key combinations translated by the OS
9430 such as Alt-3. 9430 such as Alt-3.
9431 */ 9431 */
9432 /* mask off option and command */ 9432 /* Mask off modifier keys that are mapped to some Emacs
9433 int new_modifiers = mods & 0xe600; 9433 modifiers. */
9434 int new_modifiers = mods & ~mapped_modifiers;
9434 /* set high byte of keycode to modifier high byte*/ 9435 /* set high byte of keycode to modifier high byte*/
9435 int new_keycode = keycode | new_modifiers; 9436 int new_keycode = keycode | new_modifiers;
9436 Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache); 9437 Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);
9437 unsigned long some_state = 0; 9438 unsigned long some_state = 0;
9438 return (int) KeyTranslate (kchr_ptr, new_keycode, 9439 return (int) KeyTranslate (kchr_ptr, new_keycode,
9439 &some_state) & 0xff; 9440 &some_state) & 0xff;
9440 /* TO DO: Recognize two separate resulting characters, "for 9441 /* TO DO: Recognize two separate resulting characters, "for
9441 example, when the user presses Option-E followed by N, you 9442 example, when the user presses Option-E followed by N, you
9442 can map this through the KeyTranslate function using the 9443 can map this through the KeyTranslate function using the
@@ -9990,9 +9991,9 @@ XTread_socket (sd, expected, hold_quit)
9990 will pass back noErr, otherwise it will pass back 9991 will pass back noErr, otherwise it will pass back
9991 "eventNotHandledErr" and we can process it 9992 "eventNotHandledErr" and we can process it
9992 normally. */ 9993 normally. */
9993 if ((!NILP (Vmac_pass_command_to_system) 9994 if ((mac_pass_command_to_system
9994 || !(er.modifiers & cmdKey)) 9995 || !(er.modifiers & cmdKey))
9995 && (!NILP (Vmac_pass_control_to_system) 9996 && (mac_pass_control_to_system
9996 || !(er.modifiers & controlKey)) 9997 || !(er.modifiers & controlKey))
9997 && (NILP (Vmac_option_modifier) 9998 && (NILP (Vmac_option_modifier)
9998 || !(er.modifiers & optionKey))) 9999 || !(er.modifiers & optionKey)))
@@ -10061,12 +10062,10 @@ XTread_socket (sd, expected, hold_quit)
10061 } 10062 }
10062 else 10063 else
10063 { 10064 {
10064
10065 inev.code = 10065 inev.code =
10066 backtranslate_modified_keycode(er.modifiers, keycode, 10066 backtranslate_modified_keycode(er.modifiers, keycode,
10067 er.message & charCodeMask); 10067 er.message & charCodeMask);
10068 inev.kind = ASCII_KEYSTROKE_EVENT; 10068 inev.kind = ASCII_KEYSTROKE_EVENT;
10069
10070 } 10069 }
10071 } 10070 }
10072 10071
@@ -10711,6 +10710,18 @@ syms_of_macterm ()
10711 atsu_font_id_hash = Qnil; 10710 atsu_font_id_hash = Qnil;
10712#endif 10711#endif
10713 10712
10713 /* We don't yet support this, but defining this here avoids whining
10714 from cus-start.el and other places, like "M-x set-variable". */
10715 DEFVAR_BOOL ("x-use-underline-position-properties",
10716 &x_use_underline_position_properties,
10717 doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
10718nil means ignore them. If you encounter fonts with bogus
10719UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
10720to 4.1, set this to nil.
10721
10722NOTE: Not supported on Mac yet. */);
10723 x_use_underline_position_properties = 0;
10724
10714 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, 10725 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
10715 doc: /* If not nil, Emacs uses toolkit scroll bars. */); 10726 doc: /* If not nil, Emacs uses toolkit scroll bars. */);
10716#ifdef USE_TOOLKIT_SCROLL_BARS 10727#ifdef USE_TOOLKIT_SCROLL_BARS
@@ -10725,35 +10736,35 @@ syms_of_macterm ()
10725/* Variables to configure modifier key assignment. */ 10736/* Variables to configure modifier key assignment. */
10726 10737
10727 DEFVAR_LISP ("mac-control-modifier", &Vmac_control_modifier, 10738 DEFVAR_LISP ("mac-control-modifier", &Vmac_control_modifier,
10728 doc: /* Modifier key assumed when the Mac control key is pressed. 10739 doc: /* *Modifier key assumed when the Mac control key is pressed.
10729The value can be `alt', `control', `hyper', or `super' for the 10740The value can be `control', `meta', `alt', `hyper', or `super' for the
10730respective modifier. The default is `control'. */); 10741respective modifier. The default is `control'. */);
10731 Vmac_control_modifier = Qcontrol; 10742 Vmac_control_modifier = Qcontrol;
10732 10743
10733 DEFVAR_LISP ("mac-option-modifier", &Vmac_option_modifier, 10744 DEFVAR_LISP ("mac-option-modifier", &Vmac_option_modifier,
10734 doc: /* Modifier key assumed when the Mac alt/option key is pressed. 10745 doc: /* *Modifier key assumed when the Mac alt/option key is pressed.
10735The value can be `alt', `control', `hyper', or `super' for the 10746The value can be `control', `meta', `alt', `hyper', or `super' for the
10736respective modifier. If the value is nil then the key will act as the 10747respective modifier. If the value is nil then the key will act as the
10737normal Mac control modifier, and the option key can be used to compose 10748normal Mac control modifier, and the option key can be used to compose
10738characters depending on the chosen Mac keyboard setting. */); 10749characters depending on the chosen Mac keyboard setting. */);
10739 Vmac_option_modifier = Qnil; 10750 Vmac_option_modifier = Qnil;
10740 10751
10741 DEFVAR_LISP ("mac-command-modifier", &Vmac_command_modifier, 10752 DEFVAR_LISP ("mac-command-modifier", &Vmac_command_modifier,
10742 doc: /* Modifier key assumed when the Mac command key is pressed. 10753 doc: /* *Modifier key assumed when the Mac command key is pressed.
10743The value can be `alt', `control', `hyper', or `super' for the 10754The value can be `control', `meta', `alt', `hyper', or `super' for the
10744respective modifier. The default is `meta'. */); 10755respective modifier. The default is `meta'. */);
10745 Vmac_command_modifier = Qmeta; 10756 Vmac_command_modifier = Qmeta;
10746 10757
10747 DEFVAR_LISP ("mac-function-modifier", &Vmac_function_modifier, 10758 DEFVAR_LISP ("mac-function-modifier", &Vmac_function_modifier,
10748 doc: /* Modifier key assumed when the Mac function key is pressed. 10759 doc: /* *Modifier key assumed when the Mac function key is pressed.
10749The value can be `alt', `control', `hyper', or `super' for the 10760The value can be `control', `meta', `alt', `hyper', or `super' for the
10750respective modifier. Note that remapping the function key may lead to 10761respective modifier. Note that remapping the function key may lead to
10751unexpected results for some keys on non-US/GB keyboards. */); 10762unexpected results for some keys on non-US/GB keyboards. */);
10752 Vmac_function_modifier = Qnil; 10763 Vmac_function_modifier = Qnil;
10753 10764
10754 DEFVAR_LISP ("mac-emulate-three-button-mouse", 10765 DEFVAR_LISP ("mac-emulate-three-button-mouse",
10755 &Vmac_emulate_three_button_mouse, 10766 &Vmac_emulate_three_button_mouse,
10756 doc: /* Specify a way of three button mouse emulation. 10767 doc: /* *Specify a way of three button mouse emulation.
10757The value can be nil, t, or the symbol `reverse'. 10768The value can be nil, t, or the symbol `reverse'.
10758nil means that no emulation should be done and the modifiers should be 10769nil means that no emulation should be done and the modifiers should be
10759placed on the mouse-1 event. 10770placed on the mouse-1 event.
@@ -10765,27 +10776,27 @@ mouse-3 and the command-key will register for mouse-2. */);
10765 Vmac_emulate_three_button_mouse = Qnil; 10776 Vmac_emulate_three_button_mouse = Qnil;
10766 10777
10767#if USE_CARBON_EVENTS 10778#if USE_CARBON_EVENTS
10768 DEFVAR_LISP ("mac-wheel-button-is-mouse-2", &Vmac_wheel_button_is_mouse_2, 10779 DEFVAR_BOOL ("mac-wheel-button-is-mouse-2", &mac_wheel_button_is_mouse_2,
10769 doc: /* Non-nil if the wheel button is mouse-2 and the right click mouse-3. 10780 doc: /* *Non-nil if the wheel button is mouse-2 and the right click mouse-3.
10770Otherwise, the right click will be treated as mouse-2 and the wheel 10781Otherwise, the right click will be treated as mouse-2 and the wheel
10771button will be mouse-3. */); 10782button will be mouse-3. */);
10772 Vmac_wheel_button_is_mouse_2 = Qt; 10783 mac_wheel_button_is_mouse_2 = 1;
10773 10784
10774 DEFVAR_LISP ("mac-pass-command-to-system", &Vmac_pass_command_to_system, 10785 DEFVAR_BOOL ("mac-pass-command-to-system", &mac_pass_command_to_system,
10775 doc: /* Non-nil if command key presses are passed on to the Mac Toolbox. */); 10786 doc: /* *Non-nil if command key presses are passed on to the Mac Toolbox. */);
10776 Vmac_pass_command_to_system = Qt; 10787 mac_pass_command_to_system = 1;
10777 10788
10778 DEFVAR_LISP ("mac-pass-control-to-system", &Vmac_pass_control_to_system, 10789 DEFVAR_BOOL ("mac-pass-control-to-system", &mac_pass_control_to_system,
10779 doc: /* Non-nil if control key presses are passed on to the Mac Toolbox. */); 10790 doc: /* *Non-nil if control key presses are passed on to the Mac Toolbox. */);
10780 Vmac_pass_control_to_system = Qt; 10791 mac_pass_control_to_system = 1;
10781 10792
10782#endif 10793#endif
10783 10794
10784 DEFVAR_LISP ("mac-allow-anti-aliasing", &Vmac_use_core_graphics, 10795 DEFVAR_BOOL ("mac-allow-anti-aliasing", &mac_use_core_graphics,
10785 doc: /* If non-nil, allow anti-aliasing. 10796 doc: /* *If non-nil, allow anti-aliasing.
10786The text will be rendered using Core Graphics text rendering which 10797The text will be rendered using Core Graphics text rendering which
10787may anti-alias the text. */); 10798may anti-alias the text. */);
10788 Vmac_use_core_graphics = Qnil; 10799 mac_use_core_graphics = 0;
10789 10800
10790 /* Register an entry for `mac-roman' so that it can be used when 10801 /* Register an entry for `mac-roman' so that it can be used when
10791 creating the terminal frame on Mac OS 9 before loading 10802 creating the terminal frame on Mac OS 9 before loading
diff --git a/src/macterm.h b/src/macterm.h
index 916a461f67e..08c2f058cde 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -583,7 +583,7 @@ extern Lisp_Object mac_aedesc_to_lisp P_ ((AEDesc *));
583extern OSErr create_apple_event_from_event_ref P_ ((EventRef, UInt32, 583extern OSErr create_apple_event_from_event_ref P_ ((EventRef, UInt32,
584 EventParamName *, 584 EventParamName *,
585 EventParamType *, 585 EventParamType *,
586 UInt32 *, AppleEvent *)); 586 AppleEvent *));
587extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *)); 587extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
588extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object)); 588extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object));
589extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef)); 589extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef));
diff --git a/src/termhooks.h b/src/termhooks.h
index 7920b6597aa..c925a85b484 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -144,14 +144,14 @@ enum event_kind
144 DRAG_N_DROP_EVENT, /* A drag-n-drop event is generated when 144 DRAG_N_DROP_EVENT, /* A drag-n-drop event is generated when
145 files selected outside of Emacs are dropped 145 files selected outside of Emacs are dropped
146 onto an Emacs window. 146 onto an Emacs window.
147 Currently used only on Windows NT.
148 .modifiers holds the state of the 147 .modifiers holds the state of the
149 modifier keys. 148 modifier keys.
150 .x and .y give the mouse position, 149 .x and .y give the mouse position,
151 in characters, within the window. 150 in characters, within the window.
152 .frame_or_window is a cons of the frame 151 .frame_or_window is the frame in
153 in which the drop was made and a list of 152 which the drop was made.
154 the filenames of the dropped files. 153 .arg is a platform-dependent
154 representation of the dropped items.
155 .timestamp gives a timestamp (in 155 .timestamp gives a timestamp (in
156 milliseconds) for the click. */ 156 milliseconds) for the click. */
157 USER_SIGNAL_EVENT, /* A user signal. 157 USER_SIGNAL_EVENT, /* A user signal.
diff --git a/src/w32menu.c b/src/w32menu.c
index d441d14b259..dfd885eee08 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -738,7 +738,8 @@ cached information about equivalent key sequences. */)
738 738
739 XSETFRAME (Vmenu_updating_frame, f); 739 XSETFRAME (Vmenu_updating_frame, f);
740 } 740 }
741 Vmenu_updating_frame = Qnil; 741 else
742 Vmenu_updating_frame = Qnil;
742#endif /* HAVE_MENUS */ 743#endif /* HAVE_MENUS */
743 744
744 title = Qnil; 745 title = Qnil;
diff --git a/src/w32term.c b/src/w32term.c
index 14b5d0ffb79..79f6ae5206b 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3187,8 +3187,8 @@ construct_drag_n_drop (result, msg, f)
3187 DragFinish (hdrop); 3187 DragFinish (hdrop);
3188 3188
3189 XSETFRAME (frame, f); 3189 XSETFRAME (frame, f);
3190 result->frame_or_window = Fcons (frame, files); 3190 result->frame_or_window = frame;
3191 result->arg = Qnil; 3191 result->arg = files;
3192 return Qnil; 3192 return Qnil;
3193} 3193}
3194 3194
diff --git a/src/xfns.c b/src/xfns.c
index 5610aa95e9d..acd63125e87 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -5524,7 +5524,8 @@ DEFUN ("x-backspace-delete-keys-p", Fx_backspace_delete_keys_p,
5524 doc: /* Check if both Backspace and Delete keys are on the keyboard of FRAME. 5524 doc: /* Check if both Backspace and Delete keys are on the keyboard of FRAME.
5525FRAME nil means use the selected frame. 5525FRAME nil means use the selected frame.
5526Value is t if we know that both keys are present, and are mapped to the 5526Value is t if we know that both keys are present, and are mapped to the
5527usual X keysyms. */) 5527usual X keysyms. Value is `lambda' if we cannot determine if both keys are
5528present and mapped to the usual X keysyms. */)
5528 (frame) 5529 (frame)
5529 Lisp_Object frame; 5530 Lisp_Object frame;
5530{ 5531{
@@ -5543,7 +5544,7 @@ usual X keysyms. */)
5543 if (!XkbLibraryVersion (&major, &minor)) 5544 if (!XkbLibraryVersion (&major, &minor))
5544 { 5545 {
5545 UNBLOCK_INPUT; 5546 UNBLOCK_INPUT;
5546 return Qnil; 5547 return Qlambda;
5547 } 5548 }
5548 5549
5549 /* Check that the server supports XKB. */ 5550 /* Check that the server supports XKB. */
@@ -5552,7 +5553,7 @@ usual X keysyms. */)
5552 if (!XkbQueryExtension (dpy, &op, &event, &error, &major, &minor)) 5553 if (!XkbQueryExtension (dpy, &op, &event, &error, &major, &minor))
5553 { 5554 {
5554 UNBLOCK_INPUT; 5555 UNBLOCK_INPUT;
5555 return Qnil; 5556 return Qlambda;
5556 } 5557 }
5557 5558
5558 /* In this code we check that the keyboard has physical keys with names 5559 /* In this code we check that the keyboard has physical keys with names
@@ -5607,7 +5608,7 @@ usual X keysyms. */)
5607 UNBLOCK_INPUT; 5608 UNBLOCK_INPUT;
5608 return have_keys; 5609 return have_keys;
5609#else /* not HAVE_XKBGETKEYBOARD */ 5610#else /* not HAVE_XKBGETKEYBOARD */
5610 return Qnil; 5611 return Qlambda;
5611#endif /* not HAVE_XKBGETKEYBOARD */ 5612#endif /* not HAVE_XKBGETKEYBOARD */
5612} 5613}
5613 5614
diff --git a/src/xmenu.c b/src/xmenu.c
index 3fd88a7ac2f..36f95d911f0 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -905,8 +905,11 @@ no quit occurs and `x-popup-menu' returns nil. */)
905 905
906 if (! FRAME_X_P (f)) 906 if (! FRAME_X_P (f))
907 error ("Can not put X menu on non-X terminal"); 907 error ("Can not put X menu on non-X terminal");
908
909 XSETFRAME (Vmenu_updating_frame, f);
908 } 910 }
909 Vmenu_updating_frame = Qnil; 911 else
912 Vmenu_updating_frame = Qnil;
910#endif /* HAVE_MENUS */ 913#endif /* HAVE_MENUS */
911 914
912 record_unwind_protect (unuse_menu_items, Qnil); 915 record_unwind_protect (unuse_menu_items, Qnil);
diff --git a/src/xselect.c b/src/xselect.c
index 432365fdb63..16fb7187474 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2759,11 +2759,11 @@ x_handle_dnd_message (f, event, dpyinfo, bufp)
2759 2759
2760 mouse_position_for_drop (f, &x, &y); 2760 mouse_position_for_drop (f, &x, &y);
2761 bufp->kind = DRAG_N_DROP_EVENT; 2761 bufp->kind = DRAG_N_DROP_EVENT;
2762 bufp->frame_or_window = Fcons (frame, vec); 2762 bufp->frame_or_window = frame;
2763 bufp->timestamp = CurrentTime; 2763 bufp->timestamp = CurrentTime;
2764 bufp->x = make_number (x); 2764 bufp->x = make_number (x);
2765 bufp->y = make_number (y); 2765 bufp->y = make_number (y);
2766 bufp->arg = Qnil; 2766 bufp->arg = vec;
2767 bufp->modifiers = 0; 2767 bufp->modifiers = 0;
2768 2768
2769 return 1; 2769 return 1;