Subject: bug#9754: Issue with Emacs 23.4

From: Ken Brown <[email-masked]>
Date: Tue, 15 May 2012 15:08:55 -0400

I'm resending this because I got back a message saying I had to 
unarchive bug 9754 before I could add to it.

On 5/10/2012 5:36 PM, Paul Eggert wrote:
> On 05/10/2012 02:25 PM, Douglas, William wrote:
>> Is there any chance of getting the fix for this applied or am I left
>> distro patching and waiting for 24?
>
> The latter -- at least, that's the current plan.

I think this bug still exists, in slightly different form, in emacs-24. 
   The call of g_main_context_query in xgselect.c:62 still uses the 
variables gfds and gfds_size, which are not initialized by 
xgselect_initialize if we're running emacs -nw.  But, more 
fundamentally, it doesn't make sense for emacs -nw to be interacting 
with GLib at all.  I suggest the attached patch.

Ken

--- xgselect.c.orig	2012-05-15 13:53:13.000000000 -0400
+++ xgselect.c	2012-05-15 14:09:19.093750000 -0400
@@ -35,6 +35,9 @@
 xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
 	   EMACS_TIME *timeout)
 {
+  if (inhibit_window_system || !display_arg)
+    return select (max_fds, rfds, wfds, efds, timeout);
+
   SELECT_TYPE all_rfds, all_wfds;
   EMACS_TIME tmo, *tmop = timeout;