From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#35418: [PATCH] Don't poll auto-revert files that use notification Date: Wed, 24 Apr 2019 20:14:46 +0200 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_57AAFA11-7B25-4780-B710-1F8E608189CB" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="151555"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Michael Albinus To: 35418@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 24 20:32:11 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 1hJMgk-000dFA-0B for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Apr 2019 20:32:10 +0200 Original-Received: from localhost ([127.0.0.1]:45524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJMgi-0004HA-W3 for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Apr 2019 14:32:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJMgV-0004Du-9l for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2019 14:31:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJMR8-00067O-Sz for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2019 14:16:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42932) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJMR8-00067G-Ow for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2019 14:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hJMR8-0002wn-IA for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2019 14:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Apr 2019 18:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35418 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.155612971411274 (code B ref -1); Wed, 24 Apr 2019 18:16:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Apr 2019 18:15:14 +0000 Original-Received: from localhost ([127.0.0.1]:56476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJMQM-0002vl-8t for submit@debbugs.gnu.org; Wed, 24 Apr 2019 14:15:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52117) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJMQI-0002vR-Sc for submit@debbugs.gnu.org; Wed, 24 Apr 2019 14:15:12 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:54519) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJMQD-0005GY-G3 for submit@debbugs.gnu.org; Wed, 24 Apr 2019 14:15:05 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJMQC-0000I8-8H for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2019 14:15:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJMQB-0005Ea-6E for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2019 14:15:04 -0400 Original-Received: from mail171c50.megamailservers.eu ([91.136.10.181]:43848 helo=mail92c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJMQA-00054H-MJ for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2019 14:15:03 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1556129688; bh=xSPxTb2h8gRW2JNuIR2Pe4XPhfOOzGScaT15CLECOn0=; h=From:Subject:Date:Cc:To:From; b=E2x8sWA+IjmnJD5GH96zhhUbvK7ymW5tFyXwPuo9LLm+KUw4YylAgncXzIEBNVoaV 5j60tulStgnGOTZfe2DgmQxDJfKaDFcR4efAw3WmJFKYRUZaFvPdZNSkQ/IHR9ziob oFoWQQXj3p2ykEK0+5bRwNkGXZ29WQ+7dNj/J+GA= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] ([188.150.171.71]) (authenticated bits=0) by mail92c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x3OIEkmE016500; Wed, 24 Apr 2019 18:14:48 +0000 X-Mailer: Apple Mail (2.3445.104.8) X-CTCH-RefID: str=0001.0A0B0214.5CC0A798.003B, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=RrHr0huK c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=ONdRDGFD3O1zXpl4lkEA:9 a=D4b1L8H20t0ULcQ0:21 a=PXXmaejFQU7uZUuD:21 a=CjuIK1q_8ugA:10 a=UwLn2DouPOKXMJmAEYkA:9 a=B2y7HmGcmWMA:10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:158195 Archived-At: --Apple-Mail=_57AAFA11-7B25-4780-B710-1F8E608189CB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii It is a waste of power, on battery-powered devices in particular, to = poll files in auto-revert mode periodically when change notification is = used. The change is straightforward (attached patch); the main concern = is whether the notification system is reliable enough. In general, it probably is. There is a comment in w32notify.c about = SMB-mounted file systems from Samba servers; while Samba does support = notification nowadays, there are probably older systems still be = deficient in that regard. However, isn't this what = `auto-revert-notify-exclude-dir-regexp' is for? I'm not familiar with = the way Emacs is used on Windows, but would adding something like (rx bos (or "\\\\" "//") (one-or-more (not (any "/:\\"))) (any "/\\")) to `auto-revert-notify-exclude-dir-regexp' be a good start? Another note about what this patch does not do: global-auto-revert-mode = will still use polling. This could be added later on, if there is a good = place to hook into for buffer creation. --Apple-Mail=_57AAFA11-7B25-4780-B710-1F8E608189CB Content-Disposition: attachment; filename=0001-Don-t-poll-auto-revert-files-that-use-notification.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Don-t-poll-auto-revert-files-that-use-notification.patch" Content-Transfer-Encoding: quoted-printable =46rom=205074c65347736a716f335842206a1e2a2ad36a87=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Wed,=2024=20Apr=202019=2018:39:05=20+0200=0A= Subject:=20[PATCH]=20Don't=20poll=20auto-revert=20files=20that=20use=20= notification=0A=0AIt=20is=20a=20waste=20to=20periodically=20poll=20files=20= that=20use=20change=20notification=0Ain=20auto-revert=20mode;=20stop=20= doing=20that.=20=20If=20no=20files=20need=20polling,=0Aturn=20off=20the=20= periodic=20execution=20entirely=20to=20further=20avoid=20wasting=20= power.=0AUse=20a=20timer=20to=20inhibit=20immediate=20reversion=20for=20= some=20time=20after=20a=0Anotification.=0A=0AThis=20change=20does=20not=20= apply=20to=20files=20in=20global-auto-revert-mode,=20where=0Apolling=20= is=20still=20necessary.=0A=0A*=20lisp/autorevert.el=20= (auto-revert--polled-buffers):=20New.=0A= (auto-revert-remove-current-buffer,=20auto-revert-mode)=0A= (global-auto-revert-mode,=20auto-revert-set-timer)=0A= (auto-revert-notify-add-watch,=20auto-revert-buffers):=0AMaintain=20and=20= use=20auto-revert--polled-buffers.=0A(auto-revert-buffers-counter):=20= Remove.=0A(auto-revert-buffers-counter-lockedout):=20Remove.=0A= (auto-revert--lockout-interval):=20New.=0A(auto-revert--lockout-timer):=20= New.=0A(auto-revert-notify-handler):=20Maintain=20and=20use=20= auto-revert--polled-buffers.=0AHonour=20new=20lockout=20timer.=20=20= Start=20lockout=20timer=20if=20necessary.=0A(auto-revert--end-lockout):=20= New.=0A---=0A=20lisp/autorevert.el=20|=2084=20= +++++++++++++++++++++++++++++-----------------=0A=201=20file=20changed,=20= 53=20insertions(+),=2031=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/autorevert.el=20b/lisp/autorevert.el=0Aindex=20= 1d20896c83..f7b33360ef=20100644=0A---=20a/lisp/autorevert.el=0A+++=20= b/lisp/autorevert.el=0A@@=20-319,6=20+319,11=20@@=20the=20list=20of=20= old=20buffers.")=0A=20(defvar=20auto-revert-tail-pos=200=0A=20=20=20= "Position=20of=20last=20known=20end=20of=20file.")=0A=20=0A+(defvar=20= auto-revert--polled-buffers=20()=0A+=20=20"List=20of=20buffers=20in=20= Auto-Revert=20Mode=20that=20must=20be=20polled.=0A+It=20contains=20the=20= buffers=20in=20`auto-revert-buffer-list'=20whose=0A= +`auto-revert-notify-watch-descriptor'=20is=20nil.")=0A+=0A=20(defun=20= auto-revert-find-file-function=20()=0A=20=20=20(setq-local=20= auto-revert-tail-pos=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (file-attribute-size=20(file-attributes=20buffer-file-name))))=0A@@=20= -346,8=20+351,12=20@@=20This=20has=20been=20reported=20by=20a=20file=20= notification=20event.")=0A=20(defun=20auto-revert-remove-current-buffer=20= (&optional=20buffer)=0A=20=20=20"Remove=20BUFFER=20from=20= `auto-revert-buffer-list'.=0A=20BUFFER=20defaults=20to=20= `current-buffer'."=0A+=20=20(unless=20buffer=0A+=20=20=20=20(setq=20= buffer=20(current-buffer)))=0A=20=20=20(setq=20auto-revert-buffer-list=0A= -=20=20=20=20=20=20=20=20(delq=20(or=20buffer=20(current-buffer))=20= auto-revert-buffer-list)))=0A+=20=20=20=20=20=20=20=20(delq=20buffer=20= auto-revert-buffer-list))=0A+=20=20(setq=20auto-revert--polled-buffers=0A= +=20=20=20=20=20=20=20=20(delq=20buffer=20auto-revert--polled-buffers)))=0A= =20=0A=20;;;###autoload=0A=20(define-minor-mode=20auto-revert-mode=0A@@=20= -367,6=20+376,7=20@@=20without=20being=20changed=20in=20the=20part=20= that=20is=20already=20in=20the=20buffer."=0A=20=20=20(if=20= auto-revert-mode=0A=20=20=20=20=20=20=20(when=20(not=20(memq=20= (current-buffer)=20auto-revert-buffer-list))=0A=20=20=20=20=20=20=20=20=20= (push=20(current-buffer)=20auto-revert-buffer-list)=0A+=20=20=20=20=20=20= =20=20(push=20(current-buffer)=20auto-revert--polled-buffers)=0A=20=20=20= =20=20=20=20=20=20(add-hook=0A=20=20=20=20=20=20=20=20=20=20= 'kill-buffer-hook=0A=20=20=20=20=20=20=20=20=20=20= #'auto-revert-remove-current-buffer=0A@@=20-479,7=20+489,8=20@@=20= specifies=20in=20the=20mode=20line."=0A=20=20=20=20=20=20=20= (auto-revert-buffers)=0A=20=20=20=20=20(dolist=20(buf=20(buffer-list))=0A= =20=20=20=20=20=20=20(with-current-buffer=20buf=0A-=09(when=20= auto-revert-notify-watch-descriptor=0A+=20=20=20=20=20=20=20=20(when=20= (and=20auto-revert-notify-watch-descriptor=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(not=20(memq=20buf=20= auto-revert-buffer-list)))=0A=20=09=20=20= (auto-revert-notify-rm-watch))))))=0A=20=0A=20(defun=20= auto-revert-set-timer=20()=0A@@=20-492,7=20+503,7=20@@=20will=20use=20an=20= up-to-date=20value=20of=20`auto-revert-interval'"=0A=20=20=20(if=20= (timerp=20auto-revert-timer)=0A=20=20=20=20=20=20=20(cancel-timer=20= auto-revert-timer))=0A=20=20=20(setq=20auto-revert-timer=0A-=09(if=20(or=20= global-auto-revert-mode=20auto-revert-buffer-list)=0A+=09(if=20(or=20= global-auto-revert-mode=20auto-revert--polled-buffers)=0A=20=09=20=20=20=20= (run-with-timer=20auto-revert-interval=0A=20=09=09=09=20=20=20=20= auto-revert-interval=0A=20=09=09=09=20=20=20=20'auto-revert-buffers))))=0A= @@=20-551,6=20+562,8=20@@=20will=20use=20an=20up-to-date=20value=20of=20= `auto-revert-interval'"=0A=20=09=20=20=20=20=20=20=20(gethash=20= auto-revert-notify-watch-descriptor=0A=20=09=09=20=20=20=20=20=20=20=20= auto-revert--buffers-by-watch-descriptor))=0A=20=20=20=20=20=20=20=20=20=20= auto-revert--buffers-by-watch-descriptor)=0A+=20=20=20=20=20=20=20=20= (setq=20auto-revert--polled-buffers=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(delq=20(current-buffer)=20auto-revert--polled-buffers))=0A=20=20=20= =20=20=20=20=20=20(add-hook=20'kill-buffer-hook=20= #'auto-revert-notify-rm-watch=20nil=20t)))))=0A=20=0A=20;;=20If=20we=20= have=20file=20notifications,=20we=20want=20to=20update=20the=20= auto-revert=20buffers=0A@@=20-558,24=20+571,20=20@@=20will=20use=20an=20= up-to-date=20value=20of=20`auto-revert-interval'"=0A=20;;=20often,=20we=20= want=20to=20skip=20some=20revert=20operations=20so=20that=20we=20don't=20= spend=20all=20our=0A=20;;=20time=20reverting=20the=20buffer.=0A=20;;=0A= -;;=20We=20do=20this=20by=20reverting=20immediately=20in=20response=20to=20= the=20first=20in=20a=20flurry=20of=0A-;;=20notifications.=20We=20= suppress=20subsequent=20notifications=20until=20the=20next=20time=0A-;;=20= `auto-revert-buffers'=20is=20called=20(this=20happens=20on=20a=20timer=20= with=20a=20period=20set=20by=0A-;;=20`auto-revert-interval').=0A-(defvar=20= auto-revert-buffers-counter=201=0A-=20=20"Incremented=20each=20time=20= `auto-revert-buffers'=20is=20called")=0A-(defvar-local=20= auto-revert-buffers-counter-lockedout=200=0A-=20=20"Buffer-local=20value=20= to=20indicate=20whether=20we=20should=20immediately=0A-update=20the=20= buffer=20on=20a=20notification=20event=20or=20not.=20If=0A-=0A-=20=20(=3D=20= auto-revert-buffers-counter-lockedout=0A-=20=20=20=20=20= auto-revert-buffers-counter)=0A-=0A-then=20the=20updates=20are=20locked=20= out,=20and=20we=20wait=20until=20the=20next=20call=0A-of=20= `auto-revert-buffers'=20to=20revert=20the=20buffer.=20If=20no=20lockout=20= is=0A-present,=20then=20we=20revert=20immediately=20and=20set=20the=20= lockout,=20so=20that=0A-no=20more=20reverts=20are=20possible=20until=20= the=20next=20call=20of=0A-`auto-revert-buffers'")=0A+;;=20We=20do=20this=20= by=20reverting=20immediately=20in=20response=20to=20the=20first=20in=20a=0A= +;;=20flurry=20of=20notifications.=20Any=20notifications=20during=20the=20= following=0A+;;=20`auto-revert-lockout-interval'=20seconds=20are=20noted=20= but=20not=20acted=20upon=0A+;;=20until=20the=20end=20of=20that=20= interval.=0A+=0A+(defconst=20auto-revert--lockout-interval=202.5=0A+=20=20= "Duration,=20in=20seconds,=20of=20the=20Auto-Revert=20Mode=20= notification=20lockout.=0A+This=20is=20the=20quiescence=20after=20each=20= notification=20of=20a=20file=20being=0A+changed=20during=20which=20no=20= automatic=20reverting=20takes=20place,=20to=0A+prevent=20many=20updates=20= in=20rapid=20succession=20from=20overwhelming=20the=0A+system.")=0A+=0A= +(defvar-local=20auto-revert--lockout-timer=20nil=0A+=20=20"Timer=20= awaiting=20the=20end=20of=20the=20notification=20lockout=20interval,=20= or=20nil.")=0A=20=0A=20(defun=20auto-revert-notify-handler=20(event)=0A=20= =20=20"Handle=20an=20EVENT=20returned=20from=20file=20notification."=0A= @@=20-604,7=20+613,13=20@@=20no=20more=20reverts=20are=20possible=20= until=20the=20next=20call=20of=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(file-name-nondirectory=20= buffer-file-name)))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20A=20buffer=20w/o=20a=20file,=20like=20dired.=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(null=20= buffer-file-name))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (auto-revert-notify-rm-watch))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(auto-revert-notify-rm-watch)=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(when=20(memq=20buffer=20auto-revert-buffer-list)=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(unless=20(memq=20buffer=20= auto-revert--polled-buffers)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(push=20buffer=20auto-revert--polled-buffers))=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Restart=20the=20= timer=20if=20it=20wasn't=20running.=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(unless=20auto-revert-timer=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(auto-revert-set-timer))))))=0A=20=0A= =20=20=20=20=20=20=20=20=20;;=20Loop=20over=20all=20buffers,=20in=20= order=20to=20find=20the=20intended=20one.=0A=20=20=20=20=20=20=20=20=20= (cl-dolist=20(buffer=20buffers)=0A@@=20-630,11=20+645,21=20@@=20no=20= more=20reverts=20are=20possible=20until=20the=20next=20call=20of=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20= auto-revert-notify-modified-p=20t)=0A=20=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20;;=20Revert=20the=20buffer=20now=20if=20we're=20not=20= locked=20out.=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(when=20= (/=3D=20auto-revert-buffers-counter-lockedout=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= auto-revert-buffers-counter)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(unless=20auto-revert--lockout-timer=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(auto-revert-handler)=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(setq=20= auto-revert-buffers-counter-lockedout=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20= auto-revert-buffers-counter))))))))))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(setq=20auto-revert--lockout-timer=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(run-with-timer=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20auto-revert--lockout-interval=20nil=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20#'auto-revert--end-lockout=20= buffer)))))))))))=0A+=0A+(defun=20auto-revert--end-lockout=20(buffer)=0A= +=20=20"End=20the=20lockout=20period=20after=20a=20notification.=0A+If=20= the=20buffer=20needs=20to=20be=20reverted,=20do=20it=20now."=0A+=20=20= (when=20(buffer-live-p=20buffer)=0A+=20=20=20=20(with-current-buffer=20= buffer=0A+=20=20=20=20=20=20(setq=20auto-revert--lockout-timer=20nil)=0A= +=20=20=20=20=20=20(when=20auto-revert-notify-modified-p=0A+=20=20=20=20=20= =20=20=20(auto-revert-handler)))))=0A=20=0A=20(defun=20= auto-revert-active-p=20()=0A=20=20=20"Check=20if=20auto-revert=20is=20= active=20(in=20current=20buffer=20or=20globally)."=0A@@=20-755,13=20= +780,10=20@@=20This=20function=20is=20also=20responsible=20for=20= removing=20buffers=20no=20longer=20in=0A=20Auto-Revert=20Mode=20from=20= `auto-revert-buffer-list',=20and=20for=20canceling=0A=20the=20timer=20= when=20no=20buffers=20need=20to=20be=20checked."=0A=20=0A-=20=20(setq=20= auto-revert-buffers-counter=0A-=20=20=20=20=20=20=20=20(1+=20= auto-revert-buffers-counter))=0A-=0A=20=20=20(save-match-data=0A=20=20=20= =20=20(let=20((bufs=20(if=20global-auto-revert-mode=0A=20=09=09=20=20=20=20= (buffer-list)=0A-=09=09=20=20auto-revert-buffer-list))=0A+=09=09=20=20= auto-revert--polled-buffers))=0A=20=09=20=20remaining=20new)=0A=20=20=20=20= =20=20=20;;=20Buffers=20with=20remote=20contents=20shall=20be=20reverted=20= only=20if=20the=0A=20=20=20=20=20=20=20;;=20connection=20is=20= established=20already.=0A@@=20-811,7=20+833,7=20@@=20the=20timer=20when=20= no=20buffers=20need=20to=20be=20checked."=0A=20=20=20=20=20=20=20(setq=20= auto-revert-remaining-buffers=20bufs)=0A=20=20=20=20=20=20=20;;=20Check=20= if=20we=20should=20cancel=20the=20timer.=0A=20=20=20=20=20=20=20(when=20= (and=20(not=20global-auto-revert-mode)=0A-=09=09=20(null=20= auto-revert-buffer-list))=0A+=09=09=20(null=20= auto-revert--polled-buffers))=0A=20=20=20=20=20=20=20=20=20(if=20(timerp=20= auto-revert-timer)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= (cancel-timer=20auto-revert-timer))=0A=20=09(setq=20auto-revert-timer=20= nil)))))=0A--=20=0A2.20.1=20(Apple=20Git-117)=0A=0A= --Apple-Mail=_57AAFA11-7B25-4780-B710-1F8E608189CB--