From unknown Sat Aug 16 22:47:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23207: 25.1.50; file-notify event restarts the idle timer Resent-From: Johan Claesson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Apr 2016 13:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23207 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 23207@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.145968974817710 (code B ref -1); Sun, 03 Apr 2016 13:23:01 +0000 Received: (at submit) by debbugs.gnu.org; 3 Apr 2016 13:22:28 +0000 Received: from localhost ([127.0.0.1]:49510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amhz2-0004bZ-96 for submit@debbugs.gnu.org; Sun, 03 Apr 2016 09:22:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59167) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amhz0-0004bL-1D for submit@debbugs.gnu.org; Sun, 03 Apr 2016 09:22:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amhys-00008m-S8 for submit@debbugs.gnu.org; Sun, 03 Apr 2016 09:22:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amhys-00008i-OM for submit@debbugs.gnu.org; Sun, 03 Apr 2016 09:22:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amhyp-0006mo-IM for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2016 09:22:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amhym-000082-6p for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2016 09:22:15 -0400 Received: from smtprelay-h31.telenor.se ([213.150.131.4]:36019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amhyl-00007t-LP for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2016 09:22:12 -0400 Received: from ipb4.telenor.se (ipb4.telenor.se [195.54.127.167]) by smtprelay-h31.telenor.se (Postfix) with ESMTP id AE44DC7E1 for ; Sun, 3 Apr 2016 15:22:06 +0200 (CEST) X-SENDER-IP: [213.114.146.248] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DBCQDFFwFXPPiSctVWBxwBgxoeNS5PgnGDebQ3AQ1bgRcSB4cWORQBAQEBAQEBBgEBAQFCQIUeEwEnJA8lAQQZDApLiA0BmgGhEhmGB4hkBgEBBQNjhQgFjU2JcESPcI0nhhqJAB4BAYF4DD8DARiBTDowhk0BCBcDgRoBAQE X-IPAS-Result: A2DBCQDFFwFXPPiSctVWBxwBgxoeNS5PgnGDebQ3AQ1bgRcSB4cWORQBAQEBAQEBBgEBAQFCQIUeEwEnJA8lAQQZDApLiA0BmgGhEhmGB4hkBgEBBQNjhQgFjU2JcESPcI0nhhqJAB4BAYF4DD8DARiBTDowhk0BCBcDgRoBAQE X-IronPort-AV: E=Sophos;i="5.24,436,1454972400"; d="scan'208";a="270430269" Received: from c-f89272d5.04-99-73746f3.cust.bredbandsbolaget.se (HELO goblin) ([213.114.146.248]) by ipb4.telenor.se with ESMTP; 03 Apr 2016 15:22:06 +0200 From: Johan Claesson Date: Sun, 03 Apr 2016 15:22:05 +0200 Message-ID: <87d1q6kete.fsf@bredband.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.4 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.4 (----) Hi, Every time there is a file-notify event the idle timer is restarted. This will postpone the triggering of idle timers. If there are periodical file-notify events they may prevent idle timers from ever triggering. The following recipe creates periodical file-notify events with the help of a normal non-idle timer. The poor idle timer started last in the recipe will never get to run. emacs -Q (with-current-buffer (find-file-noselect "/tmp/changing.txt") (setq auto-revert-interval 0.5) (auto-revert-mode)) (run-with-timer 1 1 (lambda () (write-region "x" nil "/tmp/changing.txt"))) (run-with-idle-timer 3 t (lambda () (message "Just idling"))) The same behavior is also present in 24.4 and 24.5 (i have not checked older versions). The idle timer gets restarted in read_char in keyboard.c. The following patch avoids this (but i am not sure it is the right thing to do). diff --git a/src/keyboard.c b/src/keyboard.c index 1a5dbd0..b71c656 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2834,7 +2834,9 @@ read_char (int commandflag, Lisp_Object map, last_input_event = c; call4 (Qcommand_execute, tem, Qnil, Fvector (1, &last_input_event), Qt); - if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time) + if (CONSP (c) + && (EQ (XCAR (c), Qselect_window) || EQ (XCAR (c), Qfile_notify)) + && !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 This is in the handing of special-event-map which includes file-notify. special-event-map includes some events that should restart the idle timer because they are user input (like drag-n-drop). But file-notify is not user input so i think it should not restart the idle timer. The same probably goes for dbus-event and config-changed-event that also are in the special-event-map. Maybe they also should be exempted in the same way. Also i don't understand why this code checks for Qselect_window. select-window is not included in special-event-map so that should never turn up there. Regards, /Johan In GNU Emacs 25.1.50.2 (x86_64-unknown-linux-gnu, X toolkit) of 2016-04-01 built on goblin Repository revision: 46edc38005ce47bdaae656a541858735a8ba5f26 Windowing system distributor 'The X.Org Foundation', version 11.0.11702000 System Description: Ubuntu 15.10 Configured using: 'configure --prefix=/ssd/home/jcl/usr --with-x-toolkit=lucid --without-toolkit-scroll-bars --disable-silent-rules --without-compress-install --enable-link-time-optimization PKG_CONFIG_PATH=/home/jcl/usr/lib/pkgconfig' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB LUCID X11 Important settings: value of $LC_MONETARY: en_GB.UTF-8 value of $LC_NUMERIC: en_GB.UTF-8 value of $LC_TIME: en_GB.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix Major mode: Text Minor modes in effect: magit-auto-revert-mode: t display-time-mode: t minibuffer-depth-indicate-mode: t num3-mode: t minibuffer-electric-default-mode: t icomplete-mode: t diff-auto-refine-mode: t erc-list-mode: t erc-menu-mode: t erc-autojoin-mode: t erc-ring-mode: t erc-networks-mode: t erc-pcomplete-mode: t erc-track-mode: t erc-match-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-netsplit-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t shell-dirtrack-mode: t wc-mode: t whitespace-mode: t winner-mode: t ido-everywhere: t which-function-mode: t global-eldoc-mode: t electric-layout-mode: t electric-indent-mode: t mouse-wheel-mode: t global-prettify-symbols-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t temp-buffer-resize-mode: t line-number-mode: t auto-fill-function: do-auto-fill transient-mark-mode: t Recent messages: Replaced 0 occurrences Spell-checking region using aspell with default dictionary...done Spell-checking suspended; use C-u M-$ to resume Saving file /ssd/home/jcl/IDLE_TIMER_REPORT.el... Wrote /ssd/home/jcl/IDLE_TIMER_REPORT.el Saving file /ssd/home/jcl/IDLE_TIMER_REPORT.el... Wrote /ssd/home/jcl/IDLE_TIMER_REPORT.el Mark set Saving file /ssd/home/jcl/IDLE_TIMER_REPORT.el... Wrote /ssd/home/jcl/IDLE_TIMER_REPORT.el Load-path shadows: None found. Features: (nnir emacsbug nndoc gnus-dup esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell esh-module esh-mode esh-util tree-widget inferior-slime slime-banner slime-cl-indent cl-indent elp gud tar-mode edmacro let-alist color calc-bin calc-ext flow-fill shadow semantic/symref/grep semantic/symref semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs tabify gnus-dired tramp-cache hippie-exp bug-reference w3m-form gnus-cite mail-extr gnus-async pulse w3m-cookie smiley jcl-replace jcl-games-init jcl-muse-init htmlize-hack htmlize muse-latex muse-html muse-xml-common muse-colors muse-publish muse-project muse-protocols muse-regexps muse muse-nested-tags muse-mode jcl-yaoddmuse-init yaoddmuse-extension yaoddmuse skeleton sgml-mode eieio-opt speedbar sb-image ezimage dframe wiki-summary autoload lisp-mnt cus-edit cus-start cus-load time-stamp misearch multi-isearch jcl-renegade-goblin jcl-home-boot vc vc-dispatcher vc-git org-rmail org-mhe org-irc org-info org-gnus org-docview org-bibtex bibtex org-bbdb org-w3m jcl-load jcl-billboard-init typing-practice jcl-elisp-init profiler tagbag-init jcl-grep-init jcl-abbrev-init jcl-ediff-init jcl-term-init jcl-erlang-init jcl-sbg jcl-erlang-log bookmark jcl-erlang-man man jcl-midnite-init jcl-midnite midnight jcl-picpocket-init picpocket-test jcl-erc-init jcl-ido-init jcl-dired-init image-file wdired jcl-register-init jcl-command-subset-init jcl-generic-init generic-x jcl-eww-init eww url-queue shr svg dom jcl-org-init poporg ob-latex ox-beamer org-feed org-capture jcl-shell-init jcl-haskell-init jcl-haskell-old inf-haskell haskell-decl-scan haskell-mode haskell-cabal haskell-utils haskell-font-lock haskell-indentation haskell-string haskell-sort-imports haskell-lexeme haskell-align-imports haskell-compat haskell-complete-module flymake dabbrev haskell-customize jcl-mentor-init mentor xml-rpc url-scgi jcl-google-init jcl-modes-init checkdoc magit-blame magit-stash magit-bisect magit-remote magit-commit magit-sequence magit magit-apply magit-wip magit-log magit-diff smerge-mode magit-core magit-autorevert magit-process magit-popup magit-mode magit-git crm magit-section magit-utils calc calc-loaddefs calc-macs jcl-rfc rfcview goto-addr proced nroff-mode table picture python rx jcl-ruby inf-ruby ruby-mode fpl macrostep-c cmacexp cwarn grep jcl-elpa-init ffap view jcl-global-init time printing mb-depth saveplace num3-mode minibuf-eldef icomplete jcl-sl-init jcl-keys-init kmacro diff-mode jcl-sbg-ssit jcl-google google-translate google-translate-default-ui google-translate-core-ui google-translate-core google-translate-tk jcl-imenu jcl-wesnoth wesnoth-mode wesnoth-wml-data wesnoth-update jcl-erlang jcl-sbg-compile jcl-picpocket jcl-goblin jcl-dired jcl-dired-lexical picpocket fuzzy-match jcl-ediff jcl-elisp jcl-grep edebug jcl-stumpwm jcl-org jcl-erc erc-list erc-menu erc-join erc-ring erc-networks erc-pcomplete erc-track erc-match erc-button erc-fill erc-stamp erc-netsplit erc-goodies erc erc-backend erc-compat jcl-vbox jcl-lxc jcl-keys windmove jcl-debbugs-init debbugs-org debbugs-gnu debbugs soap-client warnings rng-xsd rng-dt rng-util xsd-regexp jcl-isearch jcl-sbg-scan tagbag sbg filecache jcl-bugfix loadhist git-commit help-fns with-editor async-bytecomp async tramp-sh tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell log-edit pcvs-util add-log dash apropos jcl-merge jcl-wip jcl-work-buffer ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff jcl-sty jcl-epresent face-remap org-indent epresent ox-latex ox-icalendar ox-html ox-ascii ox-publish ox org-element avl-tree diet ps-print ps-print-loaddefs ps-def lpr jcl-template jcl-copyright jcl-template-lib cperl-mode cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs erlang tempo wc-mode jcl-register jcl-advice jcl-command-subset jcl-duff clearcase reporter jcl-motion jcl-safe-init jcl-site-start jpt-mode erlang-start qp gnus-ml gnus-topic cursor-sensor mm-archive network-stream nsm url-http url-gw puny url-cache url-auth nnrss mm-url nndraft nnmh nnfolder nnml jcl-master jcl-calendar-init jcl-emms-init emms-playlist-limit emms-volume emms-volume-amixer emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon emms-browser sort emms-playlist-sort emms-last-played emms-player-xine emms-player-mpd tq emms-streams emms-show-all emms-tag-editor emms-mark emms-cache emms-info-ogginfo emms-info-mp3info emms-player-vlc emms-player-mplayer jcl-emms emms-mode-line emms-librefm-stream emms-librefm-scrobbler emms-playing-time emms-info later-do emms-playlist-mode emms-source-playlist xml emms-setup emms-lyrics emms-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf emms-source-file locate emms-player-simple emms emms-compat jcl-gnus-init jcl-gnus jcl-w3m-init jcl-term ange-ftp w3m-search w3m-bookmark w3m-antenna w3m-rss jcl-org-import-icalendar jcl-status jcl-buffer-init org-location-google-maps org-agenda google-maps google-maps-static url-util google-maps-geocode google-maps-base json map org org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs org-loaddefs autorevert filenotify appt jcl-calendar jcl-swedish-postfix quail holidays hol-loaddefs icalendar diary-lib diary-loaddefs cal-menu calendar cal-loaddefs w3m doc-view jka-compr image-mode timezone w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util dired-aux dired-x gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-cache gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range gnus-win mailcap starttls smtpmail sendmail message format-spec rfc822 mml mml-sec epa derived epg mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils mm-util mail-prsvr wid-edit jcl-boot jcl-slime-init slime-fancy slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-compiler-notes-tree slime-scratch slime-presentations bridge slime-macrostep macrostep slime-mdot-fu slime-enclosing-context slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-autodoc jcl-misc jcl-ert ispell find-lisp jcl-misc-lexical whitespace winner jcl-windows jcl-buffer ido ert find-func ewoc debug jcl-compile slime-editing-commands slime-repl slime-parse slime compile etags xref project arc-mode archive-mode noutline outline easy-mmode pp comint ansi-color hyperspec thingatpt browse-url jcl-face hi-lock dired dired-loaddefs paren mic-paren which-func imenu hl-line jcl-times-init jcl-early-init jcl-compat-init advice jcl-util seq subr-x jcl-times server term disp-table ehelp ring sh-script smie executable jcl-load-path tex-site eimp-autoloads gnugo-autoloads ascii-art-to-unicode-autoloads htmlize-autoloads ipython-autoloads list-utils-autoloads cl memory-usage-autoloads muse-autoloads num3-mode-autoloads finder-inf python-autoloads slime-autoloads info package epg-config url-handlers url-parse auth-source cl-seq eieio byte-opt bytecomp byte-compile cl-extra help-mode easymenu cconv eieio-core cl-macs gv eieio-loaddefs cl-loaddefs pcase cl-lib password-cache url-vars time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 2659061 392210) (symbols 48 102906 0) (miscs 40 6241 8580) (strings 32 502665 71858) (string-bytes 1 17223972) (vectors 16 136297) (vector-slots 8 2761520 106348) (floats 8 1490 1629) (intervals 56 317146 3703) (buffers 976 171) (heap 1024 216403 18278)) From unknown Sat Aug 16 22:47:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23207: 25.1.50; file-notify event restarts the idle timer Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Apr 2016 16:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23207 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Johan Claesson Cc: 23207@debbugs.gnu.org Received: via spool by 23207-submit@debbugs.gnu.org id=B23207.1459699529514 (code B ref 23207); Sun, 03 Apr 2016 16:06:02 +0000 Received: (at 23207) by debbugs.gnu.org; 3 Apr 2016 16:05:29 +0000 Received: from localhost ([127.0.0.1]:50117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amkWn-000089-3G for submit@debbugs.gnu.org; Sun, 03 Apr 2016 12:05:29 -0400 Received: from mout.gmx.net ([212.227.15.19]:60445) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amkWk-00007v-IH for 23207@debbugs.gnu.org; Sun, 03 Apr 2016 12:05:27 -0400 Received: from detlef.gmx.de ([87.146.46.179]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0LslCb-1boQv13Rpx-012Kzr; Sun, 03 Apr 2016 18:05:18 +0200 From: Michael Albinus References: <87d1q6kete.fsf@bredband.net> Date: Sun, 03 Apr 2016 18:05:17 +0200 In-Reply-To: <87d1q6kete.fsf@bredband.net> (Johan Claesson's message of "Sun, 03 Apr 2016 15:22:05 +0200") Message-ID: <8760vyoeyq.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:WjRKiHO9uo9VnCi9zXIZqxh4S9gvKe/IvBHVi1fGRFkRAtPfu6w z1+W2MuFanAi9FH89nxr4m/045uAA+aHicOsABfN/aT758tf1VsATXlohXFuiIOq1qtk/t4 CWU+55PIkgz9IBoCwFqhWOWNm/O2uOhK7Ewj6Ts1+4+ELaxaNT7Iv0zcVNKrYp4Xu0igiXV /vvYkwSlYZZKL3LnjCh9Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:blf2+gSoH0M=:OzJEreKP0vUXgyKwTVljJu ow6DqKHdCpSWNmIlgHzMt8Mo8F+eFDYDu+Sb3e0rLJ+4kLGovPjOb36l3lae8h4zURO/Npaji Bd+YUyVN0WlkvfMFgMBrSBqvyWDF+5K4gI3qHppmA2LOHHc/uhJpH4PgHg8T6pLk8I0aHXX8q 5vGKZqjfpR1s9ZvXeCh6VQx9ulKt/SgdTZWIXBg+ECRaJvFKROZsKUc3q+Es5m4q4aH7IsyEm f6ZnGDzgIZ+ROwg8WUIrc79ej2JeyeMkWHtMqg0wn9VPUewevfU6rSR1OlF0PjoY3iwcUWPHb N6/PiTe3QLHvLNfxNwYxm5WT4qzTAuRwVsOaJOk1z+GG5bkR3+90WeKiqZ7Lp9H981CBilR2i fbbrHC0NVUxBkgLO6Eg6J7mzGB8sCPzI9rawE3Jimmw8q15UhwRt0cGHsScFowsD8qegKJ1TY ii+FmwwW7lFuRNP/H2cq7C55TM4VkRvwnEzyA1bXsUbfY6MPun5R9tfabHQvzGVbxpvVcEmpl PZroqhFAbt3Bl1agvMomMufSsMj2kxNH24jtck4ft1LKoJwMp8/QdvDpT5NXqnC0iJVZtIiJt qsSfHldmoPQkX+9R/NoT91/IFhnMkaryGwXDgGXdz8qmoUqJT083M62dCNl+qmQXX62bLcTe+ 4x+SHWBSDu5ed9lc40iMm1P8xBatcQBYbjljvi0WewedX5zB5Oi14yoqnWZPqZ1qqy+s44uz7 u+tG0zycyLGr8M0ovcbF57GyorpKlpZ3yhZmCzkrkjOf/fZxo/Fl9tau6sDbW6nWVtWMyzpuu tCk6/pi X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Johan Claesson writes: > Hi, Hi Johan, > Every time there is a file-notify event the idle timer is restarted. > This will postpone the triggering of idle timers. If there are > periodical file-notify events they may prevent idle timers from ever > triggering. The following recipe creates periodical file-notify > events with the help of a normal non-idle timer. The poor idle timer > started last in the recipe will never get to run. > > emacs -Q > > (with-current-buffer (find-file-noselect "/tmp/changing.txt") > (setq auto-revert-interval 0.5) > (auto-revert-mode)) > (run-with-timer 1 1 (lambda () (write-region "x" nil "/tmp/changing.txt")= )) > (run-with-idle-timer 3 t (lambda () (message "Just idling"))) > > The same behavior is also present in 24.4 and 24.5 (i have not checked > older versions). Thanks for the report. There is a problem, indeed! > The idle timer gets restarted in read_char in keyboard.c. The > following patch avoids this (but i am not sure it is the right > thing to do). > > diff --git a/src/keyboard.c b/src/keyboard.c > index 1a5dbd0..b71c656 100644 > --- a/src/keyboard.c > +++ b/src/keyboard.c > @@ -2834,7 +2834,9 @@ read_char (int commandflag, Lisp_Object map, > last_input_event =3D c; > call4 (Qcommand_execute, tem, Qnil, Fvector (1, &last_input_event)= , Qt); >=20=20 > - if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time) > + if (CONSP (c) > + && (EQ (XCAR (c), Qselect_window) || EQ (XCAR (c), Qfile_notif= y)) > + && !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 Looks good to me. Of course, we must wrap EQ (XCAR (c), Qfile_notify) by #ifdef USE_FILE_NOTIFY; not all Emacs instances are configured to use file notifications. > This is in the handing of special-event-map which includes > file-notify. special-event-map includes some events that should > restart the idle timer because they are user input (like drag-n-drop). > But file-notify is not user input so i think it should not restart the > idle timer. > > The same probably goes for dbus-event and config-changed-event that > also are in the special-event-map. Maybe they also should be exempted > in the same way. I agree for dbus-event. Don't know whether we need it also for config-changed-event, my na=C3=AFve gut feeling tells me that this doesn't happen very often. Maybe somebody else knows better. > Also i don't understand why this code checks for Qselect_window. > select-window is not included in special-event-map so that should > never turn up there. Same here. Let's wait for some few days. If nobody else contributes further, I would apply your patch, including dbus-event. > Regards, > > /Johan Best regards, Michael. From unknown Sat Aug 16 22:47:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23207: 25.1.50; file-notify event restarts the idle timer Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Apr 2016 17:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23207 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Albinus Cc: 23207@debbugs.gnu.org, johanclaesson@bredband.net Reply-To: Eli Zaretskii Received: via spool by 23207-submit@debbugs.gnu.org id=B23207.14597038606736 (code B ref 23207); Sun, 03 Apr 2016 17:18:02 +0000 Received: (at 23207) by debbugs.gnu.org; 3 Apr 2016 17:17:40 +0000 Received: from localhost ([127.0.0.1]:50142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amlee-0001ka-7I for submit@debbugs.gnu.org; Sun, 03 Apr 2016 13:17:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amled-0001kO-I8 for 23207@debbugs.gnu.org; Sun, 03 Apr 2016 13:17:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amleR-0004fk-Jq for 23207@debbugs.gnu.org; Sun, 03 Apr 2016 13:17:32 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amleR-0004fe-GZ; Sun, 03 Apr 2016 13:17:27 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3501 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1amleQ-0005th-Ny; Sun, 03 Apr 2016 13:17:27 -0400 Date: Sun, 03 Apr 2016 20:16:59 +0300 Message-Id: <83vb3ypq7o.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <8760vyoeyq.fsf@gmx.de> (message from Michael Albinus on Sun, 03 Apr 2016 18:05:17 +0200) References: <87d1q6kete.fsf@bredband.net> <8760vyoeyq.fsf@gmx.de> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.0 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Michael Albinus > Date: Sun, 03 Apr 2016 18:05:17 +0200 > Cc: 23207@debbugs.gnu.org > > > diff --git a/src/keyboard.c b/src/keyboard.c > > index 1a5dbd0..b71c656 100644 > > --- a/src/keyboard.c > > +++ b/src/keyboard.c > > @@ -2834,7 +2834,9 @@ read_char (int commandflag, Lisp_Object map, > > last_input_event = c; > > call4 (Qcommand_execute, tem, Qnil, Fvector (1, &last_input_event), Qt); > > > > - if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time) > > + if (CONSP (c) > > + && (EQ (XCAR (c), Qselect_window) || EQ (XCAR (c), Qfile_notify)) > > + && !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 > > Looks good to me. Of course, we must wrap EQ (XCAR (c), Qfile_notify) by > #ifdef USE_FILE_NOTIFY; not all Emacs instances are configured to use > file notifications. Right. > > This is in the handing of special-event-map which includes > > file-notify. special-event-map includes some events that should > > restart the idle timer because they are user input (like drag-n-drop). > > But file-notify is not user input so i think it should not restart the > > idle timer. > > > > The same probably goes for dbus-event and config-changed-event that > > also are in the special-event-map. Maybe they also should be exempted > > in the same way. > > I agree for dbus-event. Don't know whether we need it also for > config-changed-event, my naïve gut feeling tells me that this doesn't > happen very often. Maybe somebody else knows better. Why does frequency matter here? > > Also i don't understand why this code checks for Qselect_window. > > select-window is not included in special-event-map so that should > > never turn up there. > > Same here. Couldn't someone bind select-window in special-event-map? Anyway, I think we should simply check all the special events that are not user events here. If they don't have a binding in special-event-map, then the test will always fail. What about focus-in/out events? Or xwidget-event? From unknown Sat Aug 16 22:47:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23207: 25.1.50; file-notify event restarts the idle timer Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Apr 2016 17:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23207 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 23207@debbugs.gnu.org, johanclaesson@bredband.net Received: via spool by 23207-submit@debbugs.gnu.org id=B23207.145970604710028 (code B ref 23207); Sun, 03 Apr 2016 17:55:01 +0000 Received: (at 23207) by debbugs.gnu.org; 3 Apr 2016 17:54:07 +0000 Received: from localhost ([127.0.0.1]:50186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ammDv-0002bg-JO for submit@debbugs.gnu.org; Sun, 03 Apr 2016 13:54:07 -0400 Received: from mout.gmx.net ([212.227.15.18]:65263) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ammDu-0002bC-3Q for 23207@debbugs.gnu.org; Sun, 03 Apr 2016 13:54:06 -0400 Received: from detlef.gmx.de ([87.146.46.179]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0LyF3F-1brgjg46fF-015dW9; Sun, 03 Apr 2016 19:53:58 +0200 From: Michael Albinus References: <87d1q6kete.fsf@bredband.net> <8760vyoeyq.fsf@gmx.de> <83vb3ypq7o.fsf@gnu.org> Date: Sun, 03 Apr 2016 19:53:56 +0200 In-Reply-To: <83vb3ypq7o.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 03 Apr 2016 20:16:59 +0300") Message-ID: <87k2kemvd7.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:Ul6gfnNitU3BX9GwVAQ3Z2nyVC0rk7291Kb3bJTGsqrk7hQ0+6t t9jDWlRG+QN+OQK6YXFikQovkiNHpoPvHKOAFQ1izVHPziQiD/gHXyDmXCbyG1RbIz1PDx9 Mnl8jR/nQCU6Eaqw+1CrnZarIZ8BCyAKSMBlZNR6nwYMnPxpvG3JIdSthPUoKbRDogZHYN5 5mbMWjZf27sIeFlmMNNCw== X-UI-Out-Filterresults: notjunk:1;V01:K0:fl6f1QQtSB8=:f6WnfGu19ekKYlk80HycNu NtDk+jgfUDRF/5YG0jlVLirVIId8IohYQ+TMUf1e8o4oW8495j9U2LdW2CRqjIwtbt2Pq5nL/ yrcij3q6a/LLoKT63TT5BmGowkmKvgBWlMvph5A3EPBFeQlPOYAseWTnQZsFDZW0JDq4yqKnt e6OGTFZq286H3qsHwoLnaFjJzJFLcDAbbTBbS42jhzTSiX1ycZy67fJo6dFi1s95tNLVqm6vJ SD2RLpmCtnOidVmLicX4Qo36aRat8Z5f+gEOkCcMwbG4Dq3gNQlg7wJuSM5th6ykiUW9rKnBG OO6Xzp+D698nN/bWRvpj/+P3Oj85ndRyIOcLNG4Zlzg6UBOLRfwwCwgBpH9l0HxRpQoI4fUCl GU0c8rRhr6ZmZoW+MD0WnxKNl07pb9CgCG2UVKWVmQeO3GRSsAUjYpG8bz0I6Bhy/Jm4O5++O gnVJNeDKNE8YeN8/xgw5KdZE6dQtXR5HUa2CS3FExx/zOtiERBXTgUd5coClM1JfFHyiu5zJW Lk66ZJo/Yr3cDi4aO2ze40n+LSN/xcPKBrGy8anfGnOpw4dfLQck1HpkGmbnt7WQjk+qDLcQe SM5aNLgE1CvQgh8qsCh/2iDnk4xTIZ9XokkvGKUSuGTZHU57k2anGXdtKmDYQkUSrQNnYZVDf 4OQ9KlHrAlqiK8CVI89phA2Ui3aNvx2h1GO2BOAJR/P0WOPJ8kv3MzdvZ8QvCSAc6/Md5bNXW eOQRpTzQlIrGRWavS4hcZGVSj/iSnX5sO68wRvTOf4XDpeyZRfpjIRrlK6fWtDH5Eksv8zB27 0xtuM33 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: >> I agree for dbus-event. Don't know whether we need it also for >> config-changed-event, my na=C3=AFve gut feeling tells me that this doesn= 't >> happen very often. Maybe somebody else knows better. > > Why does frequency matter here? I have no strict preferences. So we could check also for config-changed-eve= nt. > Anyway, I think we should simply check all the special events that are > not user events here. If they don't have a binding in > special-event-map, then the test will always fail. > > What about focus-in/out events? Or xwidget-event? focus-in/out events sound like triggered by a user action. So it is OK to restart an idle-timer. My Emacs hasn't compiled them in. For xwidget-event, I don't know whether it is based on a user action, or something else. My Emacs isn't compiled with it. OTOH, my Emacs knows ns-unput-working-text and ns-put-working-text in special-event-map. Is that OK? I'm running Emacs on GNU/Linux. Best regards, Michael. From unknown Sat Aug 16 22:47:46 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Johan Claesson Subject: bug#23207: closed (Re: bug#23207: 25.1.50; file-notify event restarts the idle timer) Message-ID: References: <871t6dlw6d.fsf@gmx.de> <87d1q6kete.fsf@bredband.net> X-Gnu-PR-Message: they-closed 23207 X-Gnu-PR-Package: emacs Reply-To: 23207@debbugs.gnu.org Date: Sun, 10 Apr 2016 08:13:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1460275982-2231-1" This is a multi-part message in MIME format... ------------=_1460275982-2231-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #23207: 25.1.50; file-notify event restarts the idle timer which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 23207@debbugs.gnu.org. --=20 23207: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D23207 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1460275982-2231-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 23207-done) by debbugs.gnu.org; 10 Apr 2016 08:12:33 +0000 Received: from localhost ([127.0.0.1]:56541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apATx-0000ZF-5S for submit@debbugs.gnu.org; Sun, 10 Apr 2016 04:12:33 -0400 Received: from mout.gmx.net ([212.227.15.15]:49839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apATv-0000Z0-Ic for 23207-done@debbugs.gnu.org; Sun, 10 Apr 2016 04:12:32 -0400 Received: from detlef.gmx.de ([87.146.53.247]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MfVYB-1b8lea0bW7-00P6Ju; Sun, 10 Apr 2016 10:12:11 +0200 From: Michael Albinus To: Johan Claesson Subject: Re: bug#23207: 25.1.50; file-notify event restarts the idle timer References: <87d1q6kete.fsf@bredband.net> Date: Sun, 10 Apr 2016 10:12:10 +0200 In-Reply-To: <87d1q6kete.fsf@bredband.net> (Johan Claesson's message of "Sun, 03 Apr 2016 15:22:05 +0200") Message-ID: <871t6dlw6d.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:RiDbpePiQMRFvaVMuhs8ON0CWb4NephsHSTyByDCkcwbfYU65xx dgIkR2P2e56UiBI/M1MGankhj31/npmpfcxxEcOPGPe0ZywMR6IxguiOE8AGcY1cq/YJsG9 ieHAjTmWU1EJE1oF8Y/HPCgfpv5k/m4QEVdCH0mmLTboLlGZxKRWvx3MEhzhdzU6TIW+tI2 U9coxqeDZaeehvJ2NCKkQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:bJ4K2oeKNoo=:QkDY3KGZ7nsGpeQ4Ff6tOT bid6dNgWTXSpA63LDAreJgYyX4wSCYYkfBzPHZTtXQgtJm6oXzZUHR+mNKZOcqqMDHpPw8pFQ gDnLIpeQ1ZMRehpBX/MMgHRyW2dEtTpHpF/UhFh6p27haDYJ00QmWro4GjWNSkbgc/OEFLJHu 1THiOZ77bX/iDVaYWLg4wD2o70EF3mcGt3I3Qn9anjlz6qz4n+VTI3g4r1inSrjiNJmQbahOn D+QdOTQJ2vixgoK833BLCpYQk88vJOLmKP51RmnRbNbGgH6HlOex2cONkk4euCV+inInHSRA0 1PlmiRlWOAFJtuFYsPAXEJcq7Wyim3zSU9mwJtLzXhSaT7bhTz2dsaMYxu0oKtVHiLU3gZOjg WKnG5ImwKyq9OUrfKHfjO1la9pog4PD8O6xTB+a7TufFEAQ7ELSEiwl23uuSkdOwK3SvFwp5M oupmqWyW7+O2pvitgE9QqIhwlczwtJyI15+cJaC/3EWKcvG9VaX0HRK/QR9RJMbr6mlo/OGGT VWwGbdYWN4vExju24JrRp/nKSli38RgtPnaBQxbVEgPdppuGca1I/oA2rF3AP1mSN230WTApI 0Z877z2kmq8kTqX+ZvQMD823iEbYjZS7l6f9759YzV9TtTkrpwRK0nLaxCnt8gdYRHm/wGJ/p 0wg5jeabA+t+PO5wWT4dmDWe7AQ4RYqjbq+SIH2fDqnTc1G9MWkYVZuKkYWVCaXDy4l4LLi2G Jhz3lMo8eGBpdjHRLm4ZMoyV/ZubuPUqsg5zk+qZHzCC/QeGaUkeeGp6ZHYoieuDrR8nk9G3Q PNNWwzS X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23207-done Cc: 23207-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Johan Claesson writes: > Hi, Hi Johan, > The idle timer gets restarted in read_char in keyboard.c. The > following patch avoids this (but i am not sure it is the right > thing to do). I have committed an extended version of your patch to the master branch. Closing the bug. I've also tried to add a test to filenotify-tests.el, but I failed. Testing idle timers isn't easy. Best regards, Michael. ------------=_1460275982-2231-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 3 Apr 2016 13:22:28 +0000 Received: from localhost ([127.0.0.1]:49510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amhz2-0004bZ-96 for submit@debbugs.gnu.org; Sun, 03 Apr 2016 09:22:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59167) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amhz0-0004bL-1D for submit@debbugs.gnu.org; Sun, 03 Apr 2016 09:22:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amhys-00008m-S8 for submit@debbugs.gnu.org; Sun, 03 Apr 2016 09:22:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amhys-00008i-OM for submit@debbugs.gnu.org; Sun, 03 Apr 2016 09:22:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amhyp-0006mo-IM for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2016 09:22:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amhym-000082-6p for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2016 09:22:15 -0400 Received: from smtprelay-h31.telenor.se ([213.150.131.4]:36019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amhyl-00007t-LP for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2016 09:22:12 -0400 Received: from ipb4.telenor.se (ipb4.telenor.se [195.54.127.167]) by smtprelay-h31.telenor.se (Postfix) with ESMTP id AE44DC7E1 for ; Sun, 3 Apr 2016 15:22:06 +0200 (CEST) X-SENDER-IP: [213.114.146.248] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DBCQDFFwFXPPiSctVWBxwBgxoeNS5PgnGDebQ3AQ1bgRcSB4cWORQBAQEBAQEBBgEBAQFCQIUeEwEnJA8lAQQZDApLiA0BmgGhEhmGB4hkBgEBBQNjhQgFjU2JcESPcI0nhhqJAB4BAYF4DD8DARiBTDowhk0BCBcDgRoBAQE X-IPAS-Result: A2DBCQDFFwFXPPiSctVWBxwBgxoeNS5PgnGDebQ3AQ1bgRcSB4cWORQBAQEBAQEBBgEBAQFCQIUeEwEnJA8lAQQZDApLiA0BmgGhEhmGB4hkBgEBBQNjhQgFjU2JcESPcI0nhhqJAB4BAYF4DD8DARiBTDowhk0BCBcDgRoBAQE X-IronPort-AV: E=Sophos;i="5.24,436,1454972400"; d="scan'208";a="270430269" Received: from c-f89272d5.04-99-73746f3.cust.bredbandsbolaget.se (HELO goblin) ([213.114.146.248]) by ipb4.telenor.se with ESMTP; 03 Apr 2016 15:22:06 +0200 From: Johan Claesson To: bug-gnu-emacs@gnu.org Subject: 25.1.50; file-notify event restarts the idle timer Date: Sun, 03 Apr 2016 15:22:05 +0200 Message-ID: <87d1q6kete.fsf@bredband.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.4 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.4 (----) Hi, Every time there is a file-notify event the idle timer is restarted. This will postpone the triggering of idle timers. If there are periodical file-notify events they may prevent idle timers from ever triggering. The following recipe creates periodical file-notify events with the help of a normal non-idle timer. The poor idle timer started last in the recipe will never get to run. emacs -Q (with-current-buffer (find-file-noselect "/tmp/changing.txt") (setq auto-revert-interval 0.5) (auto-revert-mode)) (run-with-timer 1 1 (lambda () (write-region "x" nil "/tmp/changing.txt"))) (run-with-idle-timer 3 t (lambda () (message "Just idling"))) The same behavior is also present in 24.4 and 24.5 (i have not checked older versions). The idle timer gets restarted in read_char in keyboard.c. The following patch avoids this (but i am not sure it is the right thing to do). diff --git a/src/keyboard.c b/src/keyboard.c index 1a5dbd0..b71c656 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2834,7 +2834,9 @@ read_char (int commandflag, Lisp_Object map, last_input_event = c; call4 (Qcommand_execute, tem, Qnil, Fvector (1, &last_input_event), Qt); - if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time) + if (CONSP (c) + && (EQ (XCAR (c), Qselect_window) || EQ (XCAR (c), Qfile_notify)) + && !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 This is in the handing of special-event-map which includes file-notify. special-event-map includes some events that should restart the idle timer because they are user input (like drag-n-drop). But file-notify is not user input so i think it should not restart the idle timer. The same probably goes for dbus-event and config-changed-event that also are in the special-event-map. Maybe they also should be exempted in the same way. Also i don't understand why this code checks for Qselect_window. select-window is not included in special-event-map so that should never turn up there. Regards, /Johan In GNU Emacs 25.1.50.2 (x86_64-unknown-linux-gnu, X toolkit) of 2016-04-01 built on goblin Repository revision: 46edc38005ce47bdaae656a541858735a8ba5f26 Windowing system distributor 'The X.Org Foundation', version 11.0.11702000 System Description: Ubuntu 15.10 Configured using: 'configure --prefix=/ssd/home/jcl/usr --with-x-toolkit=lucid --without-toolkit-scroll-bars --disable-silent-rules --without-compress-install --enable-link-time-optimization PKG_CONFIG_PATH=/home/jcl/usr/lib/pkgconfig' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB LUCID X11 Important settings: value of $LC_MONETARY: en_GB.UTF-8 value of $LC_NUMERIC: en_GB.UTF-8 value of $LC_TIME: en_GB.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix Major mode: Text Minor modes in effect: magit-auto-revert-mode: t display-time-mode: t minibuffer-depth-indicate-mode: t num3-mode: t minibuffer-electric-default-mode: t icomplete-mode: t diff-auto-refine-mode: t erc-list-mode: t erc-menu-mode: t erc-autojoin-mode: t erc-ring-mode: t erc-networks-mode: t erc-pcomplete-mode: t erc-track-mode: t erc-match-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-netsplit-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t shell-dirtrack-mode: t wc-mode: t whitespace-mode: t winner-mode: t ido-everywhere: t which-function-mode: t global-eldoc-mode: t electric-layout-mode: t electric-indent-mode: t mouse-wheel-mode: t global-prettify-symbols-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t temp-buffer-resize-mode: t line-number-mode: t auto-fill-function: do-auto-fill transient-mark-mode: t Recent messages: Replaced 0 occurrences Spell-checking region using aspell with default dictionary...done Spell-checking suspended; use C-u M-$ to resume Saving file /ssd/home/jcl/IDLE_TIMER_REPORT.el... Wrote /ssd/home/jcl/IDLE_TIMER_REPORT.el Saving file /ssd/home/jcl/IDLE_TIMER_REPORT.el... Wrote /ssd/home/jcl/IDLE_TIMER_REPORT.el Mark set Saving file /ssd/home/jcl/IDLE_TIMER_REPORT.el... Wrote /ssd/home/jcl/IDLE_TIMER_REPORT.el Load-path shadows: None found. Features: (nnir emacsbug nndoc gnus-dup esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell esh-module esh-mode esh-util tree-widget inferior-slime slime-banner slime-cl-indent cl-indent elp gud tar-mode edmacro let-alist color calc-bin calc-ext flow-fill shadow semantic/symref/grep semantic/symref semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs tabify gnus-dired tramp-cache hippie-exp bug-reference w3m-form gnus-cite mail-extr gnus-async pulse w3m-cookie smiley jcl-replace jcl-games-init jcl-muse-init htmlize-hack htmlize muse-latex muse-html muse-xml-common muse-colors muse-publish muse-project muse-protocols muse-regexps muse muse-nested-tags muse-mode jcl-yaoddmuse-init yaoddmuse-extension yaoddmuse skeleton sgml-mode eieio-opt speedbar sb-image ezimage dframe wiki-summary autoload lisp-mnt cus-edit cus-start cus-load time-stamp misearch multi-isearch jcl-renegade-goblin jcl-home-boot vc vc-dispatcher vc-git org-rmail org-mhe org-irc org-info org-gnus org-docview org-bibtex bibtex org-bbdb org-w3m jcl-load jcl-billboard-init typing-practice jcl-elisp-init profiler tagbag-init jcl-grep-init jcl-abbrev-init jcl-ediff-init jcl-term-init jcl-erlang-init jcl-sbg jcl-erlang-log bookmark jcl-erlang-man man jcl-midnite-init jcl-midnite midnight jcl-picpocket-init picpocket-test jcl-erc-init jcl-ido-init jcl-dired-init image-file wdired jcl-register-init jcl-command-subset-init jcl-generic-init generic-x jcl-eww-init eww url-queue shr svg dom jcl-org-init poporg ob-latex ox-beamer org-feed org-capture jcl-shell-init jcl-haskell-init jcl-haskell-old inf-haskell haskell-decl-scan haskell-mode haskell-cabal haskell-utils haskell-font-lock haskell-indentation haskell-string haskell-sort-imports haskell-lexeme haskell-align-imports haskell-compat haskell-complete-module flymake dabbrev haskell-customize jcl-mentor-init mentor xml-rpc url-scgi jcl-google-init jcl-modes-init checkdoc magit-blame magit-stash magit-bisect magit-remote magit-commit magit-sequence magit magit-apply magit-wip magit-log magit-diff smerge-mode magit-core magit-autorevert magit-process magit-popup magit-mode magit-git crm magit-section magit-utils calc calc-loaddefs calc-macs jcl-rfc rfcview goto-addr proced nroff-mode table picture python rx jcl-ruby inf-ruby ruby-mode fpl macrostep-c cmacexp cwarn grep jcl-elpa-init ffap view jcl-global-init time printing mb-depth saveplace num3-mode minibuf-eldef icomplete jcl-sl-init jcl-keys-init kmacro diff-mode jcl-sbg-ssit jcl-google google-translate google-translate-default-ui google-translate-core-ui google-translate-core google-translate-tk jcl-imenu jcl-wesnoth wesnoth-mode wesnoth-wml-data wesnoth-update jcl-erlang jcl-sbg-compile jcl-picpocket jcl-goblin jcl-dired jcl-dired-lexical picpocket fuzzy-match jcl-ediff jcl-elisp jcl-grep edebug jcl-stumpwm jcl-org jcl-erc erc-list erc-menu erc-join erc-ring erc-networks erc-pcomplete erc-track erc-match erc-button erc-fill erc-stamp erc-netsplit erc-goodies erc erc-backend erc-compat jcl-vbox jcl-lxc jcl-keys windmove jcl-debbugs-init debbugs-org debbugs-gnu debbugs soap-client warnings rng-xsd rng-dt rng-util xsd-regexp jcl-isearch jcl-sbg-scan tagbag sbg filecache jcl-bugfix loadhist git-commit help-fns with-editor async-bytecomp async tramp-sh tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell log-edit pcvs-util add-log dash apropos jcl-merge jcl-wip jcl-work-buffer ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff jcl-sty jcl-epresent face-remap org-indent epresent ox-latex ox-icalendar ox-html ox-ascii ox-publish ox org-element avl-tree diet ps-print ps-print-loaddefs ps-def lpr jcl-template jcl-copyright jcl-template-lib cperl-mode cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs erlang tempo wc-mode jcl-register jcl-advice jcl-command-subset jcl-duff clearcase reporter jcl-motion jcl-safe-init jcl-site-start jpt-mode erlang-start qp gnus-ml gnus-topic cursor-sensor mm-archive network-stream nsm url-http url-gw puny url-cache url-auth nnrss mm-url nndraft nnmh nnfolder nnml jcl-master jcl-calendar-init jcl-emms-init emms-playlist-limit emms-volume emms-volume-amixer emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon emms-browser sort emms-playlist-sort emms-last-played emms-player-xine emms-player-mpd tq emms-streams emms-show-all emms-tag-editor emms-mark emms-cache emms-info-ogginfo emms-info-mp3info emms-player-vlc emms-player-mplayer jcl-emms emms-mode-line emms-librefm-stream emms-librefm-scrobbler emms-playing-time emms-info later-do emms-playlist-mode emms-source-playlist xml emms-setup emms-lyrics emms-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf emms-source-file locate emms-player-simple emms emms-compat jcl-gnus-init jcl-gnus jcl-w3m-init jcl-term ange-ftp w3m-search w3m-bookmark w3m-antenna w3m-rss jcl-org-import-icalendar jcl-status jcl-buffer-init org-location-google-maps org-agenda google-maps google-maps-static url-util google-maps-geocode google-maps-base json map org org-macro org-footnote org-pcomplete pcomplete org-list org-faces org-entities org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs org-loaddefs autorevert filenotify appt jcl-calendar jcl-swedish-postfix quail holidays hol-loaddefs icalendar diary-lib diary-loaddefs cal-menu calendar cal-loaddefs w3m doc-view jka-compr image-mode timezone w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util dired-aux dired-x gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-cache gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range gnus-win mailcap starttls smtpmail sendmail message format-spec rfc822 mml mml-sec epa derived epg mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils mm-util mail-prsvr wid-edit jcl-boot jcl-slime-init slime-fancy slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-compiler-notes-tree slime-scratch slime-presentations bridge slime-macrostep macrostep slime-mdot-fu slime-enclosing-context slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-autodoc jcl-misc jcl-ert ispell find-lisp jcl-misc-lexical whitespace winner jcl-windows jcl-buffer ido ert find-func ewoc debug jcl-compile slime-editing-commands slime-repl slime-parse slime compile etags xref project arc-mode archive-mode noutline outline easy-mmode pp comint ansi-color hyperspec thingatpt browse-url jcl-face hi-lock dired dired-loaddefs paren mic-paren which-func imenu hl-line jcl-times-init jcl-early-init jcl-compat-init advice jcl-util seq subr-x jcl-times server term disp-table ehelp ring sh-script smie executable jcl-load-path tex-site eimp-autoloads gnugo-autoloads ascii-art-to-unicode-autoloads htmlize-autoloads ipython-autoloads list-utils-autoloads cl memory-usage-autoloads muse-autoloads num3-mode-autoloads finder-inf python-autoloads slime-autoloads info package epg-config url-handlers url-parse auth-source cl-seq eieio byte-opt bytecomp byte-compile cl-extra help-mode easymenu cconv eieio-core cl-macs gv eieio-loaddefs cl-loaddefs pcase cl-lib password-cache url-vars time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 2659061 392210) (symbols 48 102906 0) (miscs 40 6241 8580) (strings 32 502665 71858) (string-bytes 1 17223972) (vectors 16 136297) (vector-slots 8 2761520 106348) (floats 8 1490 1629) (intervals 56 317146 3703) (buffers 976 171) (heap 1024 216403 18278)) ------------=_1460275982-2231-1-- From unknown Sat Aug 16 22:47:46 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23207: 25.1.50; file-notify event restarts the idle timer Resent-From: Johan Claesson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Apr 2016 14:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23207 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Albinus Cc: 23207-done@debbugs.gnu.org Received: via spool by 23207-done@debbugs.gnu.org id=D23207.146029811910370 (code D ref 23207); Sun, 10 Apr 2016 14:22:02 +0000 Received: (at 23207-done) by debbugs.gnu.org; 10 Apr 2016 14:21:59 +0000 Received: from localhost ([127.0.0.1]:57355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apGFS-0002hC-PY for submit@debbugs.gnu.org; Sun, 10 Apr 2016 10:21:58 -0400 Received: from smtprelay-b21.telenor.se ([195.54.99.212]:39479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apGFQ-0002gy-Gv for 23207-done@debbugs.gnu.org; Sun, 10 Apr 2016 10:21:57 -0400 Received: from ipb3.telenor.se (ipb3.telenor.se [195.54.127.166]) by smtprelay-b21.telenor.se (Postfix) with ESMTP id 15DD1C836 for <23207-done@debbugs.gnu.org>; Sun, 10 Apr 2016 16:21:49 +0200 (CEST) X-SENDER-IP: [213.114.152.163] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2C3DwBvYApXPKOYctVcGwEBgxqBUIZrtWuGDQKBID0QAQEBAQEBAQYBAQEBQkCEQgEBAwFWIwULCAMhJQ8BBBkMChoTiBIDCgwBu24BAQEHAh4ZhgiDSYECgkGHVAEEh22HE4kEj12NPI8mN4QUOjCKKwEBAQ X-IPAS-Result: A2C3DwBvYApXPKOYctVcGwEBgxqBUIZrtWuGDQKBID0QAQEBAQEBAQYBAQEBQkCEQgEBAwFWIwULCAMhJQ8BBBkMChoTiBIDCgwBu24BAQEHAh4ZhgiDSYECgkGHVAEEh22HE4kEj12NPI8mN4QUOjCKKwEBAQ X-IronPort-AV: E=Sophos;i="5.24,462,1454972400"; d="scan'208";a="1187997391" Received: from c-a39872d5.04-99-73746f3.cust.bredbandsbolaget.se (HELO goblin) ([213.114.152.163]) by ipb3.telenor.se with ESMTP; 10 Apr 2016 16:21:50 +0200 From: Johan Claesson In-Reply-To: <871t6dlw6d.fsf@gmx.de> (Michael Albinus's message of "Sun, 10 Apr 2016 10:12:10 +0200") References: <87d1q6kete.fsf@bredband.net> <871t6dlw6d.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Date: Sun, 10 Apr 2016 16:21:49 +0200 Message-ID: <87wpo54k8y.fsf@bredband.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hi, Great. Thanks, Michael. Regards, /Johan Michael Albinus writes: > Johan Claesson writes: > >> Hi, > > Hi Johan, > >> The idle timer gets restarted in read_char in keyboard.c. The >> following patch avoids this (but i am not sure it is the right >> thing to do). > > I have committed an extended version of your patch to the master > branch. Closing the bug. > > I've also tried to add a test to filenotify-tests.el, but I > failed. Testing idle timers isn't easy. > > Best regards, Michael.