aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2014-05-26 13:26:24 +0200
committerJan Djärv2014-05-26 13:26:24 +0200
commit858e55f412a35ca8e2c0b68eef61c6c864e5ce24 (patch)
treebbbaf44e12e4cad32f8aa0014e78407e79bcb3c4 /src
parent6cf4e5d6f677c1a03076b16d6c265c7b0d9711d6 (diff)
downloademacs-858e55f412a35ca8e2c0b68eef61c6c864e5ce24.tar.gz
emacs-858e55f412a35ca8e2c0b68eef61c6c864e5ce24.zip
* nsfns.m (Fns_do_applescript): Put code in the wrong place. Here is correct.
Fixes: debbugs:17424
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/nsfns.m5
2 files changed, 6 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 06f3a9403e3..fd840e0c07b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12014-05-26 Jan Djärv <jan.h.d@swipnet.se> 12014-05-26 Jan Djärv <jan.h.d@swipnet.se>
2 2
3 * nsfns.m (Fns_do_applescript): Surround NSApp run
4 with calls to ns_init_events, ns_finish_events (Bug#17424).
5
3 * nsterm.h (ns_init_events, ns_finish_events): Declare. 6 * nsterm.h (ns_init_events, ns_finish_events): Declare.
4 7
5 * nsterm.m (ns_init_events, ns_finish_events): New functions. 8 * nsterm.m (ns_init_events, ns_finish_events): New functions.
diff --git a/src/nsfns.m b/src/nsfns.m
index 0f2c2e693f7..00a488079c4 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -2094,10 +2094,8 @@ ns_do_applescript (Lisp_Object script, Lisp_Object *result)
2094 [[NSAppleScript alloc] initWithSource: 2094 [[NSAppleScript alloc] initWithSource:
2095 [NSString stringWithUTF8String: SSDATA (script)]]; 2095 [NSString stringWithUTF8String: SSDATA (script)]];
2096 2096
2097 ns_init_events ();
2098 returnDescriptor = [scriptObject executeAndReturnError: &errorDict]; 2097 returnDescriptor = [scriptObject executeAndReturnError: &errorDict];
2099 [scriptObject release]; 2098 [scriptObject release];
2100 ns_finish_events ();
2101 *result = Qnil; 2099 *result = Qnil;
2102 2100
2103 if (returnDescriptor != NULL) 2101 if (returnDescriptor != NULL)
@@ -2158,6 +2156,7 @@ In case the execution fails, an error is signaled. */)
2158 Lisp_Object result; 2156 Lisp_Object result;
2159 int status; 2157 int status;
2160 NSEvent *nxev; 2158 NSEvent *nxev;
2159 struct input_event ev;
2161 2160
2162 CHECK_STRING (script); 2161 CHECK_STRING (script);
2163 check_window_system (NULL); 2162 check_window_system (NULL);
@@ -2185,8 +2184,10 @@ In case the execution fails, an error is signaled. */)
2185 2184
2186 // If there are other events, the event loop may exit. Keep running 2185 // If there are other events, the event loop may exit. Keep running
2187 // until the script has been handled. */ 2186 // until the script has been handled. */
2187 ns_init_events (&ev);
2188 while (! NILP (as_script)) 2188 while (! NILP (as_script))
2189 [NSApp run]; 2189 [NSApp run];
2190 ns_finish_events ();
2190 2191
2191 status = as_status; 2192 status = as_status;
2192 as_status = 0; 2193 as_status = 0;