Subject: Re: bug#9754: Issue with Emacs 23.4

From: Ken Brown <[email-masked]>
Date: Thu, 17 May 2012 08:43:39 -0400

On 5/17/2012 7:04 AM, Ken Brown wrote:
> So maybe the test
>
> if (inhibit_window_system || !display_arg)
>
> in my patch should be replaced by
>
> if (!x_in_use)

Here's the patch (against the trunk) that goes along with my suggestion:

=== modified file 'src/xfns.c'
--- src/xfns.c  2012-05-02 10:20:35 +0000
+++ src/xfns.c  2012-05-17 12:29:53 +0000
@@ -136,7 +136,7 @@

  /* Nonzero if using X.  */

-static int x_in_use;
+int x_in_use;

  static Lisp_Object Qnone;
  static Lisp_Object Qsuppress_icon;

=== modified file 'src/xgselect.c'
--- src/xgselect.c      2012-05-16 02:22:53 +0000
+++ src/xgselect.c      2012-05-17 12:31:09 +0000
@@ -28,6 +28,8 @@
  #include <errno.h>
  #include <setjmp.h>

+extern int x_in_use;
+
  static GPollFD *gfds;
  static ptrdiff_t gfds_size;

@@ -43,7 +45,7 @@
    int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0;
    int i, nfds, fds_lim, tmo_in_millisec;

-  if (inhibit_window_system || !display_arg)
+  if (!x_in_use)
      return select (max_fds, rfds, wfds, efds, timeout);

    if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds));