components/emacs/patches/tty_startup_hang.patch
changeset 1147 6095231b2f75
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/emacs/patches/tty_startup_hang.patch	Thu Feb 07 15:54:53 2013 -0700
@@ -0,0 +1,45 @@
+*** emacs-23.4.orig/src/lisp.h	Wed Jan 11 05:35:01 2012
+--- emacs-23.4/src/lisp.h	Fri Feb  1 11:12:55 2013
+***************
+*** 3435,3440 ****
+--- 3435,3441 ----
+  #ifdef HAVE_X_WINDOWS
+  /* Defined in xfns.c */
+  extern void syms_of_xfns P_ ((void));
++ extern int x_in_use;
+  
+  /* Defined in xsmfns.c */
+  extern void syms_of_xsmfns P_ ((void));
+*** emacs-23.4.orig/src/xfns.c	Wed Jan 11 05:35:01 2012
+--- emacs-23.4/src/xfns.c	Fri Feb  1 11:13:27 2013
+***************
+*** 183,189 ****
+  
+  /* Nonzero if using X.  */
+  
+! static int x_in_use;
+  
+  /* Non nil if no window manager is in use.  */
+  
+--- 183,189 ----
+  
+  /* Nonzero if using X.  */
+  
+! int x_in_use;
+  
+  /* Non nil if no window manager is in use.  */
+  
+*** emacs-23.4.orig/src/xgselect.c	Wed Jan 11 05:35:01 2012
+--- emacs-23.4/src/xgselect.c	Fri Feb  1 11:13:54 2013
+***************
+*** 44,49 ****
+--- 44,52 ----
+    int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0;
+    int prio, i, nfds, tmo_in_millisec;
+  
++   if (!x_in_use)
++     return select (max_fds, rfds, wfds, efds, timeout);
++ 
+    if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds));
+    else FD_ZERO (&all_rfds);
+    if (wfds) memcpy (&all_wfds, wfds, sizeof (all_rfds));