all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 16519@debbugs.gnu.org
Subject: bug#16519: 24.3.50; gfile notifications not received in batch mode
Date: Wed, 29 Jan 2014 20:14:19 +0200	[thread overview]
Message-ID: <83vbx27j0k.fsf@gnu.org> (raw)
In-Reply-To: <87y521if0c.fsf@gmx.de>

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: 16519@debbugs.gnu.org
> Date: Mon, 27 Jan 2014 17:08:35 +0100
> 
> Michael Albinus <michael.albinus@gmx.de> 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?





  reply	other threads:[~2014-01-29 18:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-09 14:35 bug#13662: 24.3.50; inotify-add-watch fails in batch mode Chong Yidong
2014-01-17 11:56 ` Michael Albinus
2014-01-25 14:16   ` Eli Zaretskii
2014-01-26 15:55     ` Michael Albinus
2014-01-26 16:09     ` bug#16519: 24.3.50; gfile notifications not received " Michael Albinus
2014-01-26 17:43       ` Michael Albinus
2014-01-27 16:08       ` Michael Albinus
2014-01-29 18:14         ` Eli Zaretskii [this message]
2014-01-30 10:03           ` Michael Albinus
2014-01-30 17:03             ` Eli Zaretskii
2014-01-31 14:11               ` Michael Albinus
2014-01-31 15:17                 ` Eli Zaretskii
2014-01-31 16:00                   ` Michael Albinus
2014-01-31 16:53                     ` Eli Zaretskii
2014-02-03 13:31                       ` Michael Albinus
2014-02-03 16:13                         ` Eli Zaretskii
2014-02-04 11:43                           ` Michael Albinus
  -- strict thread matches above, loose matches on Subject: below --
2014-01-22  9:50 Michael Albinus
2014-01-22 15:49 ` Eli Zaretskii
2014-01-24 11:23   ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83vbx27j0k.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=16519@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.