From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#35418: [PATCH] Don't poll auto-revert files that use notification Date: Mon, 29 Apr 2019 09:53:36 +0200 Message-ID: <877ebdqmbj.fsf@gmx.de> References: <83sgu71b91.fsf@gnu.org> <74CB5185-5DA1-4786-BD9C-9EEB3D43B3C1@acm.org> <83o94uz9h2.fsf@gnu.org> <875zqzssql.fsf@gmx.de> <83d0l7v193.fsf@gnu.org> <86EFE367-90FF-4786-BC91-FC28FAF38A4E@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="169421"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35418@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 29 10:10:50 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hL1N9-000ht0-ET for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Apr 2019 10:10:47 +0200 Original-Received: from localhost ([127.0.0.1]:53817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hL1N8-0006e6-9j for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Apr 2019 04:10:46 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hL1M2-0005TK-AG for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2019 04:09:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hL16x-0002hl-EQ for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2019 03:54:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53031) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hL16w-0002hI-MR for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2019 03:54:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hL16w-0000f8-Ec for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2019 03:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Apr 2019 07:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35418 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35418-submit@debbugs.gnu.org id=B35418.15565244312526 (code B ref 35418); Mon, 29 Apr 2019 07:54:02 +0000 Original-Received: (at 35418) by debbugs.gnu.org; 29 Apr 2019 07:53:51 +0000 Original-Received: from localhost ([127.0.0.1]:38342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hL16k-0000eg-L7 for submit@debbugs.gnu.org; Mon, 29 Apr 2019 03:53:50 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:57521) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hL16j-0000eR-88 for 35418@debbugs.gnu.org; Mon, 29 Apr 2019 03:53:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1556524418; bh=Iv3L6Ol4JBJcdISP53k/5vpjzW2g439OnreBbOxq3Ak=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=fmPT0kLv6PZWAivqg1rudkRv4Kqbk6dQYkaEO/pREJi21dqbMMdnyAUhFYwirg+7D 2B3uGdHt3pFYNq5doFdO8TjBdhfydVaceN/5Fa9xeVj/eQlVqckXzwTmlowq9itkSF h4Wn8UMPjMpIUSmo9D8xgxkfUvRActALwnDQvG4U= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from detlef.gmx.de ([213.220.159.69]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MxUnp-1gb2883isj-00xqCv; Mon, 29 Apr 2019 09:53:38 +0200 In-Reply-To: <86EFE367-90FF-4786-BC91-FC28FAF38A4E@acm.org> ("Mattias \=\?utf-8\?Q\?Engdeg\=C3\=A5rd\=22's\?\= message of "Sun, 28 Apr 2019 12:21:32 +0200") X-Provags-ID: V03:K1:cGkLV2GfIK/xAHOcyINTDMkQ7Lym/oHnEC93+Y0etguK0YMqftG Jkg9jhEB8d5hmxYI6Rvh0QKnBZqMmiNDXLeJ6pFT4uicOeQjnpfD0W3hafzxh0h34IqyQyb 9uZM63gxQSvjwvfyzPz1YFuYgEW6+uGhjOa2fSfLT4H4skR4IawPQ/f4zu+b2errw9/jQOk WovuH44owTVnHUi1VmCFg== X-UI-Out-Filterresults: notjunk:1;V03:K0:sqvf+tTSyVw=:Yt17bB0T8O1ZSNAoqC9686 B95AVx/4yhvqA5y6voCY+EztllXv7iUG4lYX0Os7QHT43D/rP9GLyN9oZ6JzMx0IgmRNRT7h6 opzyEjIcWb1FEbvLIgQeha0Gn+gHcy/tKjBg/pLl2pjO14M8QobGQTTcLj0BbcIle8I56Sr/m 32/Uhxj34WF9B+evZ3ucCz2LmS8FIQWCFKeGCpV2jtV316/n0iGr8cRmv51QuYOkQOwWUkiEi a+kZ4IIIRdhDfrLzuauqHWhD6z7BYdRuvyGIQPeuCNQwcTSQedPt0vM2GNbNXeHt6zHAeDuR+ 4RL5Olzz6FKl5q7WnPKvBWIACpPg2ssT1R4fvZ1z7tAAftaWLgfg6RpEJC4IG34+ZWqj611zi 1wDgUUMhEALxIl4v4iPkCmQ6HA6t8zLOrLsSe4BEDwyfyoZeqYia/MLGYsdmIH6+puMZ/4YDF 2NcierP61X3EAbDTAsDlRhM+9fpcxecccoUD7kkSsq3NhqdiMz5A5hc+0fCoRIoQ+aT6exFbo 5oB03qdAdLYeStFDU7F3AHvgR4rHN97u9f4qlJMthgRoK2JT1aA33FjisZue8r27Q8VXle+L3 EtSRjdmxu3mvhZg54D89/9RQ679+O66APQylGFGrR3KfBLNDL7/d7kdq8OerDrb29RXe+6fS+ eh4j9asUKH5icqDgLmaPJhglm8tBGF3UskDhZbXiH2pfgP+LP/B5SvTFqpP0y7RxOEDw8k6Bl MIfT0PQEbX5YK/VvZvSQL2GPUrKTObZI8LDuBJRI8VAsEJbAXqgycXI9ysO4Jjweu63CTUwl X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:158417 Archived-At: Mattias Engdeg=C3=A5rd writes: Hi Mattias, > Here is an updated patch. There is a new variable, > `auto-revert-always-poll', which is t by default. > There is also a note in etc/NEWS. Does it merit a mention in the manual a= s well? Yes, please. > +(defcustom auto-revert-always-poll t > + "Non-nil to poll files even if notification is available. > + > +Set this variable to nil to save power by avoiding polling when > +possible. Files on file-systems that do not support file > +notifications must match `auto-revert-notify-exclude-dir-regexp' > +for Auto-Revert to work properly in this case. This typically > +includes network file systems on Unix-like machines, for files > +that are modified from another computer. > + > +When non-nil, buffers in Auto-Revert Mode will always be polled > +for changes to their files on disk every `auto-revert-interval' > +seconds. > + > +In Global Auto-Revert Mode, polling is always done regardless of > +the value of this variable." I believe it shall be said, that this user option does not compete with `auto-revert-use-notify'. Rather, polling is used additionally to file notification. When `auto-revert-use-notify' is nil, the value of `auto-revert-always-poll' doesn't matter; there will always be polling. Saying this, the user option might need another name. What about `auto-revert-also-poll'? > +(defvar auto-revert--polled-buffers () > + "List of buffers in Auto-Revert Mode that must be polled. > +It contains the buffers in `auto-revert-buffer-list' whose > +`auto-revert-notify-watch-descriptor' is nil.") Is this variable needed? It is used only once in `auto-revert--need-polling', and it could be computed easily by (untested) (delq nil (mapcar (lambda (buf) (and (or auto-revert-always-poll (not auto-revert-notify-watch-descriptor)) buf)) auto-revert-buffer-list)) `auto-revert--need-polling' shall always return the buffer list, also for `global-auto-revert-mode'. Otherwise, the patch might work. Let's try it. Best regards, Michael.