all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 21435@debbugs.gnu.org
Subject: bug#21435: 25.0.50; file-notify has problems after renames
Date: Tue, 08 Sep 2015 21:47:50 +0200	[thread overview]
Message-ID: <87oahcg0bd.fsf@gnu.org> (raw)
In-Reply-To: <831te87m7p.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 08 Sep 2015 22:19:38 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> I stepped through inotify_callback in inotify.c which can read 64
>> byte from inotifyfd where the size of one inotify event is 32 and
>> that produces 2 emacs events (although I cannot see which events are
>> created).  The Locals GUD frame always shows just nil for the `event'
>> local variable even after the assignments to it and I stepped into
>> the then-branch of an `if (!NILP(event.arg))' which makes it pretty
>> clear that it cannot be nil.  Why is that?
>
> Could be some gud bug.  Do you see the same when you invoke GDB from
> the shell?

Oh, my GDB foo on the command line ends with making backtraces. ;-)

But just typing in "info locals" in the *gud-bootstrap-emacs* buffer is
about the same, no?  And that shows

  event = {kind = FILE_NOTIFY_EVENT, part = scroll_bar_nowhere, code = 0, modifiers = 0, x = 0, y = 0, timestamp = 0, frame_or_window = 0, arg = 0}

whereas the relevant line in the locals GUD window is just

  struct input_event event        nil

So that looks like a bug.  I guess I should report this, or will you fix
this right now?

>> Is that expected that when edebugging event handlers one might miss
>> events?
>
> I always use 'message' when debugging event-driven code.  I just don't
> trust edebug enough in these cases.

Ok.

>> Anyway, eventually I found and fixed the culprit which simply was
>> that the watch descriptors of the pending and the current event were
>> compared with `eq' which is not valid because inotify descriptors are
>> conses.  I've changed the comparison to `equal' which fixes the
>> double-reporting issue.
>
> Thanks.  But meanwhile Michale explained that this behavior was on
> purpose, due to a recent change.  Do you see 2 events only when a file
> was moved to a different directory, or also when it is renamed in the
> same directory?

When renaming in the same directory.  I think Michaels case is where you
move a file from watched directory A to watched directory B, and then
you want the rename event reported to both handlers.  The case I fixed
is just that both source and target watch descriptor are actually the
same but not identical Lisp objects.

Bye,
Tassilo





  reply	other threads:[~2015-09-08 19:47 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-08  8:47 bug#21435: 25.0.50; file-notify has problems after renames Tassilo Horn
2015-09-08 16:03 ` Eli Zaretskii
2015-09-08 18:04   ` Michael Albinus
2015-09-08 18:21     ` Eli Zaretskii
2015-09-08 19:28       ` Tassilo Horn
2015-09-09 18:15         ` Michael Albinus
2015-09-09 19:01           ` Tassilo Horn
2015-09-09 20:23             ` Tassilo Horn
2015-09-10 11:23               ` Michael Albinus
2015-09-10 15:31                 ` Tassilo Horn
2015-09-10 17:50                   ` Michael Albinus
2015-09-10 19:22                     ` Tassilo Horn
2015-09-11  9:53                       ` Michael Albinus
2015-09-11 12:17                         ` Tassilo Horn
2015-09-11 12:32                           ` Eli Zaretskii
2015-09-12  8:44                           ` Michael Albinus
2015-09-11  9:45                     ` Michael Albinus
2015-09-11 12:11                       ` Tassilo Horn
2015-09-09 18:41       ` Michael Albinus
2015-09-09 19:21         ` Eli Zaretskii
2015-09-10 11:09           ` Michael Albinus
2015-09-10 15:45             ` Eli Zaretskii
2015-09-10 17:37               ` Michael Albinus
2015-09-10 18:03                 ` Eli Zaretskii
2015-09-10 18:20                   ` Michael Albinus
2015-09-10 18:55                     ` Eli Zaretskii
2015-09-11 12:51                       ` Michael Albinus
2015-09-08 19:05   ` Tassilo Horn
2015-09-08 19:19     ` Eli Zaretskii
2015-09-08 19:47       ` Tassilo Horn [this message]
2015-09-09  2:39         ` Eli Zaretskii
2015-09-09  6:13           ` Tassilo Horn
2015-09-20 17:26 ` Michael Albinus
2015-09-20 19:36   ` Eli Zaretskii
2015-09-21  6:25     ` Michael Albinus
2015-09-21  7:54       ` Eli Zaretskii
2015-09-21 10:13         ` Michael Albinus
2015-09-21 10:14           ` Eli Zaretskii
2015-09-21 13:11             ` Michael Albinus
2015-09-21 13:31               ` Eli Zaretskii
2015-09-21 13:38                 ` 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=87oahcg0bd.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=21435@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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.