emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111308: * nsfns.m (Fns_do_applescrip


From: Jan D.
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111308: * nsfns.m (Fns_do_applescript): Run event loop until script has
Date: Sun, 23 Dec 2012 13:35:37 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111308
fixes bug: http://debbugs.gnu.org/12969
committer: Jan D. <address@hidden>
branch nick: trunk
timestamp: Sun 2012-12-23 13:35:37 +0100
message:
  * nsfns.m (Fns_do_applescript): Run event loop until script has
  been executed.
  (ns_run_ascript): Chech as_script for nil, set to nil after
  executing script.
modified:
  src/ChangeLog
  src/nsfns.m
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-12-22 19:09:52 +0000
+++ b/src/ChangeLog     2012-12-23 12:35:37 +0000
@@ -1,3 +1,10 @@
+2012-12-23  Jan Djärv  <address@hidden>
+
+       * nsfns.m (Fns_do_applescript): Run event loop until script has
+       been executed (Bug#12969).
+       (ns_run_ascript): Chech as_script for nil, set to nil after
+       executing script.
+
 2012-12-22  Martin Rudalics  <address@hidden>
 
        * window.c (Fselect_window): Reword doc-string (Bug#13248).

=== modified file 'src/nsfns.m'
--- a/src/nsfns.m       2012-12-06 13:48:11 +0000
+++ b/src/nsfns.m       2012-12-23 12:35:37 +0000
@@ -2106,7 +2106,9 @@
 void
 ns_run_ascript (void)
 {
-  as_status = ns_do_applescript (as_script, as_result);
+  if (! NILP (as_script))
+    as_status = ns_do_applescript (as_script, as_result);
+  as_script = Qnil;
 }
 
 DEFUN ("ns-do-applescript", Fns_do_applescript, Sns_do_applescript, 1, 1, 0,
@@ -2143,11 +2145,14 @@
                                data2: NSAPP_DATA2_RUNASSCRIPT];
 
   [NSApp postEvent: nxev atStart: NO];
-  [NSApp run];
+
+  // If there are other events, the event loop may exit.  Keep running
+  // until the script has been handeled.  */
+  while (! NILP (as_script))
+    [NSApp run];
 
   status = as_status;
   as_status = 0;
-  as_script = Qnil;
   as_result = 0;
   unblock_input ();
   if (status == 0)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]