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: Thu, 9 May 2019 12:00:17 +0200 Message-ID: <93015872-0F5F-4E27-97BB-94BA0EE72653@acm.org> References: <83d0l7v193.fsf@gnu.org> <86EFE367-90FF-4786-BC91-FC28FAF38A4E@acm.org> <877ebdqmbj.fsf@gmx.de> <834l6gu6ee.fsf@gnu.org> <834l6eqdam.fsf@gnu.org> <8bbbdc62bee1dc16b6fd684e7da5ffac43f1e232.camel@acm.org> <87woj9nj77.fsf@gmx.de> <83r29fmz3f.fsf@gnu.org> <6b722334f6eaddcbbf3def636b5181c9439a172c.camel@acm.org> <831s1emvz7.fsf@gnu.org> <26e8159ac86da37d9cf555f6cb3f2dcb63ac0a67.camel@acm.org> <87y33mgo0c.fsf@gmx.de> <05128E42-E970-4C41-9DF9-E9E0BC1C9E4A@acm.org> <87tveagg4f.fsf@gmx.de> <87pnoygdx6.fsf@gmx.de> <8FEB518A-F5AA-488B-BDC5-7947FFE51394@acm.org> <87lfzlgvka.fsf@gmx.de> <3D200C55-AD11-4214-9C50-C2183F6598CC@acm.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_C8D1A0E2-CA8E-4BC2-B65B-DF4746B6C787" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="105385"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 35418@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 09 12:01:55 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 1hOfsA-000RCM-82 for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 May 2019 12:01:55 +0200 Original-Received: from localhost ([127.0.0.1]:51688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOfs9-0007e8-5n for geb-bug-gnu-emacs@m.gmane.org; Thu, 09 May 2019 06:01:53 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOfrL-0006v0-LZ for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 06:01:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOfrK-00057i-Dh for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 06:01:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49343) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOfrK-00057Z-8q for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 06:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hOfrK-0003fq-2w for bug-gnu-emacs@gnu.org; Thu, 09 May 2019 06:01: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: Thu, 09 May 2019 10:01: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.155739602514066 (code B ref 35418); Thu, 09 May 2019 10:01:02 +0000 Original-Received: (at 35418) by debbugs.gnu.org; 9 May 2019 10:00:25 +0000 Original-Received: from localhost ([127.0.0.1]:34652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOfqj-0003en-1W for submit@debbugs.gnu.org; Thu, 09 May 2019 06:00:25 -0400 Original-Received: from mail78c50.megamailservers.eu ([91.136.10.88]:41298 helo=mail70c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOfqg-0003ec-C1 for 35418@debbugs.gnu.org; Thu, 09 May 2019 06:00:23 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1557396019; bh=rv1bweUjhm8fsHP+eIsaiN5N/4bXEVBtSlD3DNmET98=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=iw2RPChUry1QHog7iREDqB+qT8oYiPfdlx/qXNPeO000jH6VpeYOt0KVaf1e+z07Z TKE7OyGN0tZi02SB09DRAkNFjxSwrgftzAgMbRQGfL02nqB+ub6ZeKqUU5OuExe4qd s9rRBq7KEP8BLOiFdgaZvMLSsLtfQt2eDLRDEcdk= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.1.64] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail70c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x49A0Hox004118; Thu, 9 May 2019 10:00:18 +0000 In-Reply-To: <3D200C55-AD11-4214-9C50-C2183F6598CC@acm.org> X-Mailer: Apple Mail (2.3445.104.8) X-CTCH-RefID: str=0001.0A0B020E.5CD3FA33.0084, 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=epTxMLhX c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=N54-gffFAAAA:8 a=XTr9_afi4EgPRjP0SjAA:9 a=QEXdDO2ut3YA:10 a=a8Dl6OEfzWyGJgKP8dQA:9 a=B2y7HmGcmWMA:10 a=6l0D2HzqY3Epnrm8mE3f:22 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:158972 Archived-At: --Apple-Mail=_C8D1A0E2-CA8E-4BC2-B65B-DF4746B6C787 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 5 maj 2019 kl. 11.58 skrev Mattias Engdeg=C3=A5rd : >=20 > What remains is avoiding polling in global-auto-revert-mode. I'll send = a patch soon. Here is that patch. I understand that some people are queasy about using advice in code like = this, and am open to suggestions about alternatives. What the code needs is a reasonable (not necessarily bullet-proof) way = to detect new file buffers and changes to buffer-file-name of those = buffers. Monitoring `find-file-noselect' and `set-visited-file-name' = turned out to be good enough. For the former, it might be possible to get away with = `after-change-major-mode-hook' instead (already used for non-file = buffers). --Apple-Mail=_C8D1A0E2-CA8E-4BC2-B65B-DF4746B6C787 Content-Disposition: attachment; filename=0001-Avoid-polling-in-global-auto-revert-mode.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Avoid-polling-in-global-auto-revert-mode.patch" Content-Transfer-Encoding: quoted-printable =46rom=2034302c20db88917a9a5bea90a70d315b44f1647d=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Thu,=209=20May=202019=2009:40:46=20+0200=0A= Subject:=20[PATCH]=20Avoid=20polling=20in=20global-auto-revert-mode=0A=0A= Make=20`auto-revert-avoid-polling'=20have=20effect=20in=20= global-auto-revert-mode.=0ABuffers=20actually=20handled=20by=20that=20= mode=20are=20marked=20with=20a=20non-nil=20value=0Aof=20= `global-auto-revert--tracked-buffer'.=20=20When=20= global-auto-revert-mode=0Ais=20entered,=20eligible=20buffers=20are=20= marked=20in=20that=20way,=20and=20hooks=20are=20set=0Aup=20to=20mark=20= new=20buffers=20and=20take=20care=20of=20buffers=20whose=20file=20names=0A= change.=20=20This=20way=20the=20existing=20poll-avoidance=20logic=20can=20= be=20used,=20since=0Athe=20entire=20set=20of=20buffers=20in=20= auto-revert=20is=20known.=0A(Bug#35418).=0A=0A*=20lisp/autorevert.el=20= (auto-revert-avoid-polling):=20Amend=20doc=20string.=0A= (global-auto-revert--tracked-buffer):=20New=20buffer-local=20variable.=0A= (global-auto-revert-mode):=20Mark=20existing=20buffers=20and=20set=20up=20= hooks=20when=0Amode=20is=20entered;=20do=20the=20opposite=20when=20= exited.=0A(auto-revert--global-add-buffer)=0A= (auto-revert--find-file-noselect-advice)=0A= (auto-revert--set-visited-file-name-advice)=0A= (auto-revert--after-change-major-mode):=20New=20functions.=0A= (auto-revert--polled-buffers,=20auto-revert--need-polling-p)=0A= (auto-revert-notify-handler)=0A(auto-revert-active-p):=20Modify=20logic=20= to=20cover=20global-auto-revert-mode.=0A*=20etc/NEWS=20(Changes=20in=20= Specialized=20Modes=20and=20Packages):=20Update=20entry.=0A---=0A=20= etc/NEWS=20=20=20=20=20=20=20=20=20=20=20|=20=20=203=20+-=0A=20= lisp/autorevert.el=20|=20133=20= ++++++++++++++++++++++++++++++++++++---------=0A=202=20files=20changed,=20= 108=20insertions(+),=2028=20deletions(-)=0A=0Adiff=20--git=20a/etc/NEWS=20= b/etc/NEWS=0Aindex=209e3559d27e..56c7163f7f=20100644=0A---=20a/etc/NEWS=0A= +++=20b/etc/NEWS=0A@@=20-1396,8=20+1396,7=20@@=20When=20set=20to=20a=20= non-nil=20value,=20buffers=20in=20Auto-Revert=20mode=20are=20no=20longer=0A= =20polled=20for=20changes=20periodically.=20=20This=20reduces=20the=20= power=20consumption=0A=20of=20an=20idle=20Emacs,=20but=20may=20fail=20on=20= some=20network=20file=20systems;=20set=0A=20= 'auto-revert-notify-exclude-dir-regexp'=20to=20match=20files=20where=0A= -notification=20is=20not=20supported.=20=20The=20new=20variable=20= currently=20has=20no=0A-effect=20in=20'global-auto-revert-mode'.=20=20= The=20default=20value=20is=20nil.=0A+notification=20is=20not=20= supported.=20=20The=20default=20value=20is=20nil.=0A=20=0A=20=0C=0A=20*=20= New=20Modes=20and=20Packages=20in=20Emacs=2027.1=0Adiff=20--git=20= a/lisp/autorevert.el=20b/lisp/autorevert.el=0Aindex=20= fbaffbf0d6..402301c448=20100644=0A---=20a/lisp/autorevert.el=0A+++=20= b/lisp/autorevert.el=0A@@=20-312,10=20+312,7=20@@=20when=20those=20files=20= are=20modified=20from=20another=20computer.=0A=20=0A=20When=20nil,=20= buffers=20in=20Auto-Revert=20Mode=20will=20always=20be=20polled=20for=0A=20= changes=20to=20their=20files=20on=20disk=20every=20= `auto-revert-interval'=0A-seconds,=20in=20addition=20to=20using=20= notification=20for=20those=20files.=0A-=0A-In=20Global=20Auto-Revert=20= Mode,=20polling=20is=20always=20done=20regardless=20of=0A-the=20value=20= of=20this=20variable."=0A+seconds,=20in=20addition=20to=20using=20= notification=20for=20those=20files."=0A=20=20=20:group=20'auto-revert=0A=20= =20=20:type=20'boolean=0A=20=20=20:set=20(lambda=20(variable=20value)=0A= @@=20-335,6=20+332,9=20@@=20buffers=20to=20this=20list.=0A=20The=20timer=20= function=20`auto-revert-buffers'=20is=20responsible=20for=20purging=0A=20= the=20list=20of=20old=20buffers.")=0A=20=0A+(defvar-local=20= global-auto-revert--tracked-buffer=20nil=0A+=20=20"Non-nil=20if=20buffer=20= is=20handled=20by=20Global=20Auto-Revert=20mode.")=0A+=0A=20(defvar=20= auto-revert-remaining-buffers=20()=0A=20=20=20"Buffers=20not=20checked=20= when=20user=20input=20stopped=20execution.")=0A=20=0A@@=20-501,34=20= +501,118=20@@=20specifies=20in=20the=20mode=20line."=0A=20=20=20:global=20= t=20:group=20'auto-revert=20:lighter=20global-auto-revert-mode-text=0A=20= =20=20(auto-revert-set-timer)=0A=20=20=20(if=20global-auto-revert-mode=0A= -=20=20=20=20=20=20(auto-revert-buffers)=0A+=20=20=20=20=20=20;;=20Turn=20= global-auto-revert-mode=20ON.=0A+=20=20=20=20=20=20(progn=0A+=20=20=20=20= =20=20=20=20(mapc=20#'auto-revert--global-add-buffer=20(buffer-list))=0A= +=20=20=20=20=20=20=20=20;;=20Make=20sure=20future=20buffers=20are=20= added=20as=20well.=0A+=20=20=20=20=20=20=20=20(advice-add=20= 'find-file-noselect=20:filter-return=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20#'auto-revert--find-file-noselect-advice)=0A+=20= =20=20=20=20=20=20=20(advice-add=20'set-visited-file-name=20:after=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= #'auto-revert--set-visited-file-name-advice)=0A+=20=20=20=20=20=20=20=20= ;;=20To=20track=20non-file=20buffers,=20we=20need=20to=20listen=20in=20= to=20buffer=0A+=20=20=20=20=20=20=20=20;;=20creation=20in=20general.=20=20= Listening=20to=20major-mode=20changes=20is=0A+=20=20=20=20=20=20=20=20;;=20= suitable,=20since=20we=20then=20know=20whether=20it's=20a=20mode=20that=20= is=20tracked.=0A+=20=20=20=20=20=20=20=20(when=20= global-auto-revert-non-file-buffers=0A+=20=20=20=20=20=20=20=20=20=20= (add-hook=20'after-change-major-mode-hook=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20#'auto-revert--after-change-major-mode))=0A= +=20=20=20=20=20=20=20=20(auto-revert-buffers))=0A+=20=20=20=20;;=20Turn=20= global-auto-revert-mode=20OFF.=0A+=20=20=20=20(remove-hook=20= 'after-change-major-mode-hook=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20#'auto-revert--after-change-major-mode)=0A+=20=20=20=20= (advice-remove=20'set-visited-file-name=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20#'auto-revert--set-visited-file-name-advice)=0A= +=20=20=20=20(advice-remove=20'find-file-noselect=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20= #'auto-revert--find-file-noselect-advice)=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= -=20=20=20=20=20=20=20=20(when=20(and=20= auto-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=20auto-revert-buffer-list)))=0A-=09= =20=20(auto-revert-notify-rm-watch))))))=0A+=20=20=20=20=20=20=20=20= (when=20global-auto-revert--tracked-buffer=0A+=20=20=20=20=20=20=20=20=20= =20(setq=20global-auto-revert--tracked-buffer=20nil)=0A+=20=20=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=20=20(not=20(or=20= auto-revert-mode=20auto-revert-tail-mode)))=0A+=09=20=20=20=20= (auto-revert-notify-rm-watch)))))))=0A+=0A+(defun=20= auto-revert--global-add-buffer=20(buffer)=0A+=20=20"Set=20BUFFER=20to=20= be=20tracked=20by=20Global=20Auto-Revert=20if=20appropriate."=0A+=20=20= (with-current-buffer=20buffer=0A+=20=20=20=20(when=20(and=20(not=20= global-auto-revert--tracked-buffer)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(or=20buffer-file-name=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20;;=20Any=20non-file=20buffer=20must=20have=20a=20= custom=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= `buffer-stale-function'=20to=20be=20tracked,=20since=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20;;=20we=20wouldn't=20know=20when=20= to=20revert=20it=20otherwise.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(and=20global-auto-revert-non-file-buffers=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(not=20(eq=20= buffer-stale-function=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=20=20=20=20=20= #'buffer-stale--default-function))))=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(not=20(memq=20'major-mode=20= global-auto-revert-ignore-modes))=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(not=20global-auto-revert-ignore-buffer))=0A+=20=20=20=20=20=20= (setq=20global-auto-revert--tracked-buffer=20t))))=0A+=0A+(defun=20= auto-revert--find-file-noselect-advice=20(buffer)=0A+=20=20"Adopt=20= BUFFER=20for=20Global=20Auto-Revert=20if=20appropriate.=0A+Called=20with=20= the=20return=20value=20of=20`find-file-noselect'."=0A+=20=20= (auto-revert--global-add-buffer=20buffer)=0A+=20=20= (auto-revert-set-timer)=0A+=20=20buffer)=0A+=0A+(defun=20= auto-revert--set-visited-file-name-advice=20(&rest=20_)=0A+=20=20"Adopt=20= the=20current=20buffer=20for=20Global=20Auto-Revert=20if=20appropriate.=0A= +Called=20after=20`set-visited-file-name'."=0A+=20=20;;=20In=20case=20= the=20file=20name=20was=20changed,=20remove=20any=20existing=20notifier=0A= +=20=20;;=20first=20so=20that=20we=20don't=20track=20the=20wrong=20file.=0A= +=20=20(when=20auto-revert-notify-watch-descriptor=0A+=20=20=20=20= (auto-revert-notify-rm-watch))=0A+=20=20(auto-revert--global-add-buffer=20= (current-buffer))=0A+=20=20(auto-revert-set-timer))=0A+=0A+(defun=20= auto-revert--after-change-major-mode=20()=0A+=20=20"Adopt=20the=20= current=20buffer=20for=20Global=20Auto-Revert=20if=20appropriate.=0A= +Called=20after=20the=20current=20buffer=20got=20a=20new=20major=20= mode."=0A+=20=20(auto-revert--global-add-buffer=20(current-buffer))=0A+=20= =20(auto-revert-set-timer))=0A=20=0A=20(defun=20= auto-revert--polled-buffers=20()=0A=20=20=20"List=20of=20buffers=20that=20= need=20to=20be=20polled."=0A-=20=20(cond=20(global-auto-revert-mode=20= (buffer-list))=0A+=20=20(cond=20(global-auto-revert-mode=0A+=20=20=20=20=20= =20=20=20=20(mapcan=20(lambda=20(buffer)=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(and=20(not=20(and=20= auto-revert-avoid-polling=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=20=20=20=20=20=20= (buffer-local-value=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=20=20=20=20=20=20=20= 'auto-revert-notify-watch-descriptor=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=20=20=20=20=20=20=20= buffer)))=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(or=20(buffer-local-value=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=20= 'global-auto-revert--tracked-buffer=20buffer)=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= (buffer-local-value=20'auto-revert-mode=20buffer)=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= (buffer-local-value=20'auto-revert-tail-mode=20buffer))=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(list=20= buffer)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (buffer-list)))=0A=20=20=20=20=20=20=20=20=20(auto-revert-avoid-polling=0A= =20=20=20=20=20=20=20=20=20=20(mapcan=20(lambda=20(buffer)=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(and=20(not=20= (buffer-local-value=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=20=20=20=20= 'auto-revert-notify-watch-descriptor=20buffer))=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(list=20buffer)))=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= auto-revert-buffer-list))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(and=20(not=20(buffer-local-value=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=20=20= 'auto-revert-notify-watch-descriptor=20buffer))=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(list=20buffer)))=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20auto-revert-buffer-list))=0A= =20=20=20=20=20=20=20=20=20(t=20auto-revert-buffer-list)))=0A=20=0A=20;;=20= Same=20as=20above=20in=20a=20boolean=20context,=20but=20cheaper.=0A=20= (defun=20auto-revert--need-polling-p=20()=0A=20=20=20"Whether=20periodic=20= polling=20is=20required."=0A-=20=20(or=20global-auto-revert-mode=0A-=20=20= =20=20=20=20(if=20auto-revert-avoid-polling=0A-=20=20=20=20=20=20=20=20=20= =20(not=20(cl-every=20(lambda=20(buffer)=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(buffer-local-value=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'auto-revert-notify-watch-descriptor=20buffer))=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-buffer-list))=0A-=20=20=20=20=20=20=20=20= auto-revert-buffer-list)))=0A+=20=20(cond=20(global-auto-revert-mode=0A+=20= =20=20=20=20=20=20=20=20(or=20(not=20auto-revert-avoid-polling)=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20(cl-some=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(lambda=20(buffer)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(and=20(not=20(buffer-local-value=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= 'auto-revert-notify-watch-descriptor=20buffer))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(or=20(buffer-local-value=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= 'global-auto-revert--tracked-buffer=20buffer)=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(buffer-local-value=20= 'auto-revert-mode=20buffer)=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(buffer-local-value=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-tail-mode=20buffer))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(buffer-list))))=0A+=20=20=20=20=20=20=20=20= (auto-revert-avoid-polling=0A+=20=20=20=20=20=20=20=20=20(not=20= (cl-every=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(lambda=20= (buffer)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (buffer-local-value=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20'auto-revert-notify-watch-descriptor=20buffer))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20auto-revert-buffer-list)))=0A+=20=20=20=20=20=20=20= =20(t=20auto-revert-buffer-list)))=0A=20=0A=20(defun=20= auto-revert-set-timer=20()=0A=20=20=20"Restart=20or=20cancel=20the=20= timer=20used=20by=20Auto-Revert=20Mode.=0A@@=20-652,9=20+736,8=20@@=20= system.")=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(null=20buffer-file-name))=0A=20=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=20;;=20Restart=20the=20timer=20if=20it=20wasn't=20= running.=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(when=20(and=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=20=20=20=20=20=20=20=20=20(not=20= auto-revert-timer))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(auto-revert-set-timer)))))=0A+=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(auto-revert-set-timer))))=0A=20=0A=20=20=20=20=20=20= =20=20=20;;=20Loop=20over=20all=20buffers,=20in=20order=20to=20find=20= the=20intended=20one.=0A=20=20=20=20=20=20=20=20=20(cl-dolist=20(buffer=20= buffers)=0A@@=20-700,9=20+783,7=20@@=20If=20the=20buffer=20needs=20to=20= be=20reverted,=20do=20it=20now."=0A=20=20=20"Check=20if=20auto-revert=20= is=20active=20(in=20current=20buffer=20or=20globally)."=0A=20=20=20(or=20= auto-revert-mode=0A=20=20=20=20=20=20=20auto-revert-tail-mode=0A-=20=20=20= =20=20=20(and=20global-auto-revert-mode=0A-=20=20=20=20=20=20=20=20=20=20= =20(not=20global-auto-revert-ignore-buffer)=0A-=20=20=20=20=20=20=20=20=20= =20=20(not=20(memq=20major-mode=20global-auto-revert-ignore-modes)))))=0A= +=20=20=20=20=20=20global-auto-revert--tracked-buffer))=0A=20=0A=20= (defun=20auto-revert-handler=20()=0A=20=20=20"Revert=20current=20buffer,=20= if=20appropriate.=0A--=20=0A2.20.1=20(Apple=20Git-117)=0A=0A= --Apple-Mail=_C8D1A0E2-CA8E-4BC2-B65B-DF4746B6C787--