{
Lisp_Object array[2];
array[0] = list;
- array[1] = Fcons (item, Qnil);
+ array[1] = list1 (item);
return Fnconc (2, &array[0]);
}
/* Inform fd_handler that select should be called */
c = 'g';
- emacs_write (selfds[1], &c, 1);
+ emacs_write_sig (selfds[1], &c, 1);
}
else if (nr == 0 && timeout)
{
if (nr > 0 && readfds)
{
c = 's';
- emacs_write (selfds[1], &c, 1);
+ emacs_write_sig (selfds[1], &c, 1);
}
unblock_input ();
if (selfds[0] == -1)
{
- if (pipe (selfds) == -1)
+ if (pipe2 (selfds, O_CLOEXEC) != 0)
{
fprintf (stderr, "Failed to create pipe: %s\n",
emacs_strerror (errno));
[NSApp run];
ns_do_open_file = YES;
+
+#ifdef NS_IMPL_GNUSTEP
+ /* GNUstep steals SIGCHLD for use in NSTask, but we don't use NSTask.
+ We must re-catch it so subprocess works. */
+ catch_child_signal ();
+#endif
return dpyinfo;
}
/* NSTRACE (sendEvent); */
/*fprintf (stderr, "received event of type %d\t%d\n", type);*/
-#ifdef NS_IMPL_COCOA
- if (type == NSApplicationDefined
- && [theEvent data2] == NSAPP_DATA2_RUNASSCRIPT)
+#ifdef NS_IMPL_GNUSTEP
+ // Keyboard events aren't propagated to file dialogs for some reason.
+ if ([NSApp modalWindow] != nil &&
+ (type == NSKeyDown || type == NSKeyUp || type == NSFlagsChanged))
{
- ns_run_ascript ();
- [self stop: self];
+ [[NSApp modalWindow] sendEvent: theEvent];
return;
}
#endif
+ if (type == NSApplicationDefined)
+ {
+ switch ([theEvent data2])
+ {
+#ifdef NS_IMPL_COCOA
+ case NSAPP_DATA2_RUNASSCRIPT:
+ ns_run_ascript ();
+ [self stop: self];
+ return;
+#endif
+ case NSAPP_DATA2_RUNFILEDIALOG:
+ ns_run_file_dialog ();
+ [self stop: self];
+ return;
+ }
+ }
+
if (type == NSCursorUpdate && window == nil)
{
fprintf (stderr, "Dropping external cursor update event.\n");