aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/nsfns.m11
2 files changed, 15 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f8f0b82d3da..2723d8f92ec 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsfns.m (Fns_do_applescript): Run event loop until script has
4 been executed (Bug#12969).
5 (ns_run_ascript): Chech as_script for nil, set to nil after
6 executing script.
7
12012-12-22 Martin Rudalics <rudalics@gmx.at> 82012-12-22 Martin Rudalics <rudalics@gmx.at>
2 9
3 * window.c (Fselect_window): Reword doc-string (Bug#13248). 10 * window.c (Fselect_window): Reword doc-string (Bug#13248).
diff --git a/src/nsfns.m b/src/nsfns.m
index 428cfcb9a10..7b70793258b 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -2106,7 +2106,9 @@ ns_do_applescript (Lisp_Object script, Lisp_Object *result)
2106void 2106void
2107ns_run_ascript (void) 2107ns_run_ascript (void)
2108{ 2108{
2109 as_status = ns_do_applescript (as_script, as_result); 2109 if (! NILP (as_script))
2110 as_status = ns_do_applescript (as_script, as_result);
2111 as_script = Qnil;
2110} 2112}
2111 2113
2112DEFUN ("ns-do-applescript", Fns_do_applescript, Sns_do_applescript, 1, 1, 0, 2114DEFUN ("ns-do-applescript", Fns_do_applescript, Sns_do_applescript, 1, 1, 0,
@@ -2143,11 +2145,14 @@ In case the execution fails, an error is signaled. */)
2143 data2: NSAPP_DATA2_RUNASSCRIPT]; 2145 data2: NSAPP_DATA2_RUNASSCRIPT];
2144 2146
2145 [NSApp postEvent: nxev atStart: NO]; 2147 [NSApp postEvent: nxev atStart: NO];
2146 [NSApp run]; 2148
2149 // If there are other events, the event loop may exit. Keep running
2150 // until the script has been handeled. */
2151 while (! NILP (as_script))
2152 [NSApp run];
2147 2153
2148 status = as_status; 2154 status = as_status;
2149 as_status = 0; 2155 as_status = 0;
2150 as_script = Qnil;
2151 as_result = 0; 2156 as_result = 0;
2152 unblock_input (); 2157 unblock_input ();
2153 if (status == 0) 2158 if (status == 0)