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: Fri, 10 May 2019 14:27:14 +0200 Message-ID: <25E4EBE0-0E65-45B7-B56F-9C67A2862DFA@acm.org> References: <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> <93015872-0F5F-4E27-97BB-94BA0EE72653@acm.org> <87muju1vx1.fsf@gmx.de> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="77894"; 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 Fri May 10 14:28:13 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 1hP4dJ-000K7a-EL for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 May 2019 14:28:13 +0200 Original-Received: from localhost ([127.0.0.1]:42587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP4dI-0002Yg-C2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 May 2019 08:28:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP4d9-0002Ww-CC for bug-gnu-emacs@gnu.org; Fri, 10 May 2019 08:28:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hP4d8-0007tM-C3 for bug-gnu-emacs@gnu.org; Fri, 10 May 2019 08:28:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52083) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hP4d8-0007t2-9C for bug-gnu-emacs@gnu.org; Fri, 10 May 2019 08:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hP4d8-0006eY-0L for bug-gnu-emacs@gnu.org; Fri, 10 May 2019 08:28: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: Fri, 10 May 2019 12:28:01 +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.155749124225529 (code B ref 35418); Fri, 10 May 2019 12:28:01 +0000 Original-Received: (at 35418) by debbugs.gnu.org; 10 May 2019 12:27:22 +0000 Original-Received: from localhost ([127.0.0.1]:37393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hP4cT-0006dh-N7 for submit@debbugs.gnu.org; Fri, 10 May 2019 08:27:21 -0400 Original-Received: from mail223c50.megamailservers.eu ([91.136.10.233]:33910 helo=mail33c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hP4cQ-0006dX-QS for 35418@debbugs.gnu.org; Fri, 10 May 2019 08:27:20 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1557491236; bh=aJF+0ozd4HTSsWOW7EcpwmNhbE6xtWkGj8bdqceCOek=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=dnCLrU6CF1CagX2/cynrL/7fSgA04hQtmPLdJ0+Tds67rjzPT8oSrN3t//4eDwCZP 5wtu+n7IBcgQK3FAQxo6Ph29lq2Kk8+FGToPnS1z0a9m5RDbzRdAenOXHM5u5+aySu gxXBxqfh9tL5ja1LD9ZSks6udkpV/Vnc1/4Klrjk= 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 mail33c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x4ACRE2Y019508; Fri, 10 May 2019 12:27:16 +0000 In-Reply-To: <87muju1vx1.fsf@gmx.de> X-Mailer: Apple Mail (2.3445.104.8) X-CTCH-RefID: str=0001.0A0B0203.5CD56E24.0034, 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=JcySU3CV c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=jIGDxYg4-gf8K34JcEMA:9 a=CjuIK1q_8ugA:10 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:159037 Archived-At: 10 maj 2019 kl. 11.49 skrev Michael Albinus : > There is `find-file-hook'. If we need to hook into > `set-visited-file-name', we shall create a new hook > `after-set-visited-file-name', and run it there. Thank you, it looks like `find-file-hook' will do. It's = `set-visited-file-name' that lacks a hook. We could add one, = `after-visited-file-name-change-hook' say, and run it at the end of that = function. It would come in handy for fixing the write-file bug, too. That would suffice for this particular need, but we may contemplate some = variations for general utility, such as passing the old value of = buffer-file-name to the hook. It also wouldn't catch direct = modifications of buffer-file-name, but that mostly happens in special = buffers that we don't want to autorevert anyway (?). Perhaps we should exclude all buffers whose name start with a space from = any kind of auto-revert, just in case. >> +(defvar-local global-auto-revert--tracked-buffer nil >> + "Non-nil if buffer is handled by Global Auto-Revert mode.") >> + >=20 > Somehow, I'm not so comfortable with that name. Could we take > `auto-revert-global-mode'? It is similar to `auto-revert-mode' and > `auto-revert-tail-mode', with the disadvantage that there does not = exist > such a mode. Agreed, and I never liked that variable name much myself. What about = `auto-revert--global-mode'? (More names in autorevert.el should have = double dashes, but I suppose it was written before that convention came = along.) > Alternatively, we could create a local variable = `global-autorevert-mode' > in buffers which are tracked, and check always for that local value > where it matters. Possibly, but that sounds slightly more error-prone. >> +(defun auto-revert--find-file-noselect-advice (buffer) [..] >> +(defun auto-revert--after-change-major-mode () >=20 > These are almost identical. Make argument buffer optional, and it is > just one function. Good point, but the advice functions will probably be replaced anyway = per your request; let's see what it looks like when that is done.