Fix that executing applescript may hang emacs uninterruptedly.
authorJan Djärv <jan.h.d@swipnet.se>
Sun, 14 Aug 2011 10:39:38 +0000 (12:39 +0200)
committerJan Djärv <jan.h.d@swipnet.se>
Sun, 14 Aug 2011 10:39:38 +0000 (12:39 +0200)
commit08e3161a51ae1547c486d6603059711370d11118
treee42b435b7f061f932bad860d2b2d1d0301fdd878
parent7417b37cce372cb5a04e06ebce999aa26f387002
Fix that executing applescript may hang emacs uninterruptedly.

* nsfns.m (as_script, as_result, as_status): New static variables.
(ns_run_ascript): New function.
(Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
the event loop.  Get status from as_status.

* nsterm.h (ns_run_ascript): Declare.
(NSAPP_DATA2_RUNASSCRIPT): Define.

* nsterm.m (sendEvent): If event is NSApplicationDefined and
data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
the event loop (Bug#7276).
src/ChangeLog
src/nsfns.m
src/nsterm.h
src/nsterm.m