From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#9754: Issue with Emacs 23.4 Date: Tue, 15 May 2012 14:51:53 -0700 Organization: UCLA Computer Science Department Message-ID: <4FB2CFF9.70309@cs.ucla.edu> References: <4FAC34DA.7040606@cs.ucla.edu> <4FB2A9C7.3070604@cornell.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1337118784 32706 80.91.229.3 (15 May 2012 21:53:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 15 May 2012 21:53:04 +0000 (UTC) Cc: 9754@debbugs.gnu.org, "Douglas, William" To: Ken Brown Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 15 23:53:03 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SUPfx-0000IY-QZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 May 2012 23:53:02 +0200 Original-Received: from localhost ([::1]:40363 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUPfx-0002nM-3d for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 May 2012 17:53:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUPfu-0002nD-3V for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 17:52:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUPfs-0005c5-B1 for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 17:52:57 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUPfs-0005c0-7B for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 17:52:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SUPfx-0008Qi-Ju for bug-gnu-emacs@gnu.org; Tue, 15 May 2012 17:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 May 2012 21:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9754 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 9754-submit@debbugs.gnu.org id=B9754.133711872832336 (code B ref 9754); Tue, 15 May 2012 21:53:01 +0000 Original-Received: (at 9754) by debbugs.gnu.org; 15 May 2012 21:52:08 +0000 Original-Received: from localhost ([127.0.0.1]:56750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUPf5-0008PU-4H for submit@debbugs.gnu.org; Tue, 15 May 2012 17:52:08 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:43607) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUPf3-0008Ox-7f for 9754@debbugs.gnu.org; Tue, 15 May 2012 17:52:06 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id E3F3939E800A; Tue, 15 May 2012 14:51:53 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OjGy5BgdXpOz; Tue, 15 May 2012 14:51:53 -0700 (PDT) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 818A839E8006; Tue, 15 May 2012 14:51:53 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 In-Reply-To: <4FB2A9C7.3070604@cornell.edu> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:60049 Archived-At: On 05/15/2012 12:08 PM, Ken Brown wrote: > 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. They are initialized to NULL and zero, which should work for all their uses. > more fundamentally, it doesn't make sense for emacs -nw to be interacting > with GLib at all. I suggest the attached patch. That patch assumes C99's statements before declarations. I assume the following minor rewrite of it is OK too? === modified file 'src/xgselect.c' --- src/xgselect.c 2012-05-10 05:27:24 +0000 +++ src/xgselect.c 2012-05-15 21:30:36 +0000 @@ -38,17 +38,21 @@ xg_select (int max_fds, SELECT_TYPE *rfd SELECT_TYPE all_rfds, all_wfds; EMACS_TIME tmo, *tmop = timeout; - GMainContext *context = g_main_context_default (); + GMainContext *context; int have_wfds = wfds != NULL; 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) + 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)); else FD_ZERO (&all_wfds); /* Update event sources in GLib. */ + context = g_main_context_default (); g_main_context_pending (context); do {