GNU bug report logs - #30080
24.5; write-region can reset idle time

Previous Next

Package: emacs;

Reported by: Cecil Westerhof <Cecil <at> decebal.nl>

Date: Thu, 11 Jan 2018 21:02:02 UTC

Severity: normal

Found in version 24.5

Fixed in version 25.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Forwarded to http://lists.gnu.org/r/help-gnu-emacs/2018-01/msg00143.html

Full log


Message #28 received at 30080 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Cecil Westerhof <Cecil <at> decebal.nl>
Cc: 30080 <at> debbugs.gnu.org
Subject: Re: bug#30080: 24.5; write-region can reset idle time
Date: Fri, 12 Jan 2018 09:56:48 -0500
>>>     (global-auto-revert-mode 1)
>> Ha, I think you have your culprit right there: my crystal ball says that
>> if you have auto-revert active on the file you modify with
>> `write-region` (or maybe even just a file in the same directory) any
>> modification to the file (e.g. via `write-region`) will send
>> a pseudo-event, which Emacs's command-loop will confuse for an actual
>> user event!
> The problem being that until the 19th of December it worked without a
> problem. I did not change my .emacs.

And I see also that keyboard.c does seem to do it right:

      if (CONSP (c)
          && (EQ (XCAR (c), Qselect_window)
#ifdef HAVE_DBUS
	      || EQ (XCAR (c), Qdbus_event)
#endif
#ifdef USE_FILE_NOTIFY
	      || EQ (XCAR (c), Qfile_notify)
#endif
	      || EQ (XCAR (c), Qconfig_changed_event))
          && !end_time)
	/* We stopped being idle for this event; undo that.  This
	   prevents automatic window selection (under
	   mouse-autoselect-window) from acting as a real input event, for
	   example banishing the mouse under mouse-avoidance-mode.  */
	timer_resume_idle ();

Hmm...

> It is even more funny: when I play a video with mpv, idle time is also
> reset. And this I find really odd.

Can you try to run Emacs under GDB?
Then start Emacs to try and reproduce the problem with mpv.
Once ready to start mpv, hit `C-c C-z` in GDB, then type

    break timer_stop_idle
    continue

then launch mpv and try to see the backtrace (with command `bt`) when
the timer_stop_idle breakpoint is triggered.
[ Then again, maybe this will trigger all the time, but is a false
  alarm because it would be undone right after by the above code.  ]


        Stefan




This bug report was last modified 7 years and 180 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.