From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#16519: 24.3.50; gfile notifications not received in batch mode Date: Fri, 24 Jan 2014 12:23:44 +0100 Message-ID: <8738kdpqrj.fsf@gmx.de> References: <87zjmoz6pd.fsf@gmx.de> <83k3dsf242.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1390562663 12097 80.91.229.3 (24 Jan 2014 11:24:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jan 2014 11:24:23 +0000 (UTC) Cc: 16519@debbugs.gnu.org To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 24 12:24:30 2014 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 1W6es9-0000Zf-IH for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Jan 2014 12:24:29 +0100 Original-Received: from localhost ([::1]:45817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6es9-0008Hy-0f for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Jan 2014 06:24:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6ero-0008HC-KF for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2014 06:24:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6eri-0007Jj-Q6 for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2014 06:24:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6eri-0007Jc-Mf for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2014 06:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W6eri-0002CR-8X for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2014 06:24:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87zjmoz6pd.fsf@gmx.de> Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Jan 2014 11:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16519 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16519-submit@debbugs.gnu.org id=B16519.13905626358442 (code B ref 16519); Fri, 24 Jan 2014 11:24:02 +0000 Original-Received: (at 16519) by debbugs.gnu.org; 24 Jan 2014 11:23:55 +0000 Original-Received: from localhost ([127.0.0.1]:34175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W6erb-0002C6-2I for submit@debbugs.gnu.org; Fri, 24 Jan 2014 06:23:55 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:49405) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W6erY-0002Bx-IE for 16519@debbugs.gnu.org; Fri, 24 Jan 2014 06:23:53 -0500 Original-Received: from detlef.gmx.de ([93.209.81.88]) by mail.gmx.com (mrgmx103) with ESMTPS (Nemesis) id 0MQih7-1Vjmnb2NPJ-00Tzx9 for <16519@debbugs.gnu.org>; Fri, 24 Jan 2014 12:23:51 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V03:K0:CLjmQYpzK1B+3pRJDAJPBDrLsZ4IwXA4sABBnH160P96g8RLWR7 v6EMMy8fwiUhbwU7gN2CYxiERbno6StuRnMo3uIENL/x+XddvBThqlUSTXinGa8KiAySiWs orqYQ80EKi+7WEPqBoDHVe8b8ZjKDDIBqhYm4V9AvKZrpO+3XpElA/9rsAy4v+/sKbgPmQp fQUsVVXzqlduBMgoR6brA== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:83932 Archived-At: Eli Zaretskii writes: >> File notifications via gfilenotify are not received in batch >> mode. Likely, the following actions must be taken (quoting Jan Dj=C3=A4r= v): >> >> So just switching to xg_select will not do. You have to explicitly >> check if in batch mode, then check if GLib has file descriptors we >> don't know about, and then call xg_select in the main thread. > > You will see that I needed to do something very similar for the w32 > build. Thanks for the pointer. However, gio's file notifications are not handled by selects, AFAIU. The events are put into the main context of glib, and must be read by g_main_context_dispatch. In the interactive case, this is done by xg_select indeed, but that is activated by other file descriptors not related to the file notifications machinery. So we must apply g_main_context_dispatch somewhere in Emacs' main loop, when we are in noninteractive mode. I'm not so skilled with the main loop, so I have no idea where to do. When I add something like this in wait_reading_process_output, I don't get the file notification events, but an error message: #if defined (HAVE_GLIB) if (noninteractive) { GMainContext *context; context =3D g_main_context_default (); while (g_main_context_pending (context)) g_main_context_dispatch (context); } #endif The error message is (file-error "Failed select" "resource temporarily unavailable") I don't know what to check further :-( Maybe some missing initialization? Best regards, Michael.