From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#16519: 24.3.50; gfile notifications not received in batch mode Date: Wed, 29 Jan 2014 20:14:19 +0200 Message-ID: <83vbx27j0k.fsf@gnu.org> References: <87obft367u.fsf@gnu.org> <87fvomstx8.fsf@gmx.de> <83zjmkb0yu.fsf@gnu.org> <87zjmi67yl.fsf_-_@gmx.de> <87y521if0c.fsf@gmx.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1391019312 27336 80.91.229.3 (29 Jan 2014 18:15:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Jan 2014 18:15:12 +0000 (UTC) Cc: 16519@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 29 19:15:19 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 1W8ZfQ-0002UT-Fk for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Jan 2014 19:15:16 +0100 Original-Received: from localhost ([::1]:44380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8ZfP-0004Aj-QG for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Jan 2014 13:15:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8ZfH-00047U-Pw for bug-gnu-emacs@gnu.org; Wed, 29 Jan 2014 13:15:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8ZfC-0004YL-L3 for bug-gnu-emacs@gnu.org; Wed, 29 Jan 2014 13:15:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8ZfC-0004Xf-Gz for bug-gnu-emacs@gnu.org; Wed, 29 Jan 2014 13:15:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W8ZfB-0005fQ-SH for bug-gnu-emacs@gnu.org; Wed, 29 Jan 2014 13:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Jan 2014 18:15:01 +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.139101926521714 (code B ref 16519); Wed, 29 Jan 2014 18:15:01 +0000 Original-Received: (at 16519) by debbugs.gnu.org; 29 Jan 2014 18:14:25 +0000 Original-Received: from localhost ([127.0.0.1]:40521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W8Zea-0005e8-UY for submit@debbugs.gnu.org; Wed, 29 Jan 2014 13:14:25 -0500 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:50649) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W8ZeX-0005dx-A2 for 16519@debbugs.gnu.org; Wed, 29 Jan 2014 13:14:22 -0500 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0N0600J00D8EJO00@mtaout25.012.net.il> for 16519@debbugs.gnu.org; Wed, 29 Jan 2014 20:13:53 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N0600JJEDB5GJ00@mtaout25.012.net.il>; Wed, 29 Jan 2014 20:13:53 +0200 (IST) In-reply-to: <87y521if0c.fsf@gmx.de> X-012-Sender: halo1@inter.net.il 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:84223 Archived-At: > From: Michael Albinus > Cc: 16519@debbugs.gnu.org > Date: Mon, 27 Jan 2014 17:08:35 +0100 > > Michael Albinus writes: > > > I don't know what it needs on w32 to get the file notification > > events. Is it sit-for? No, it seems to be read-event, see below. > Finally, the following seems to work for all three file notification > libraries in interactive mode, and for inotify in batch mode: > > (defmacro file-notify--wait-for-events (timeout until) > "Wait for file notification events until form UNTIL is true. > TIMEOUT is the maximum time to wait for, in seconds." > `(with-timeout (,timeout (ignore)) > (while (null ,until) > (let (noninteractive) > (sit-for 0.1 'nodisplay))))) > > I am not able to test w32notify in batch mode. The following call from a > CMD terminal works fine for me: > > C:\>"C:\Program Files\emacs\bin\runemacs.exe" -Q -l Y:\file-notify-tests.el -f ert How do you mean "works for me"? The 02 test fails, doesn't it? If I type "2" to the prompt, I get 1 unexpected failure and 1 skipped test. I need this change to file-notify-tests.el to get it to work with w32 in interactive mode (both -nw and GUI sessions work): === modified file 'test/automated/file-notify-tests.el' --- test/automated/file-notify-tests.el 2014-01-27 19:10:02 +0000 +++ test/automated/file-notify-tests.el 2014-01-29 18:05:42 +0000 @@ -188,7 +188,8 @@ TIMEOUT is the maximum time to wait for, `(with-timeout (,timeout (ignore)) (while (null ,until) (let (noninteractive) - (sit-for 0.1 'nodisplay))))) + (sit-for 0.1 'nodisplay) + (read-event))))) (ert-deftest file-notify-test02-events () "Check file creation/removal notifications." If we don't call read-event, the notifications are not read, since evidently the read_socket_hook isn't called. > However, the batch-mode equivalent returns immediately without running > the test: > > C:\>"C:\Program Files\emacs\bin\runemacs.exe" -batch -Q -l Y:\file-notify-tests.el -f ert-run-tests-batch-and-exit > > What do I miss? Don't run runemacs.exe, run emacs.exe instead. I have no idea what will runemacs do in batch mode. (I also run emacs.exe in the interactive invocation. runemacs.exe has only one purpose: to invoke Emacs from a desktop icon without opening a console window.) Anyway, the read-event thing doesn't solve the -batch operation: notifications don't come in and Emacs is stuck until I type something on the keyboard. I will need more debugging to understand what is going on. One thing is clear: the way the notifications get to the event queue is different for every back-end, so naive assumptions, like just let it sit-for for a while, are usually wrong. Btw, why did you need to bind noninteractive to nil?