From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#25277: 24.5; Allow predicate, not just Boolean value, for `global-auto-revert-ignore-buffer' Date: Mon, 26 Dec 2016 10:32:17 -0800 (PST) Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1482777204 21484 195.159.176.226 (26 Dec 2016 18:33:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Dec 2016 18:33:24 +0000 (UTC) To: 25277@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 26 19:33:19 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLa56-0003ge-UL for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Dec 2016 19:33:09 +0100 Original-Received: from localhost ([::1]:51333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLa5B-0001bD-IN for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Dec 2016 13:33:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLa55-0001b7-M4 for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 13:33:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLa50-0000Az-OQ for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 13:33:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40533) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cLa50-0000Au-KM for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 13:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cLa50-0004Te-Dn for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 13:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Dec 2016 18:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25277 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.148277716017179 (code B ref -1); Mon, 26 Dec 2016 18:33:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Dec 2016 18:32:40 +0000 Original-Received: from localhost ([127.0.0.1]:55932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLa4e-0004T0-Ir for submit@debbugs.gnu.org; Mon, 26 Dec 2016 13:32:40 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36419) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLa4c-0004Sm-44 for submit@debbugs.gnu.org; Mon, 26 Dec 2016 13:32:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLa4V-0008Vk-Jk for submit@debbugs.gnu.org; Mon, 26 Dec 2016 13:32:32 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:46025) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cLa4V-0008Ve-Gn for submit@debbugs.gnu.org; Mon, 26 Dec 2016 13:32:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLa4U-0001Zk-0g for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 13:32:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLa4P-0008UJ-2n for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 13:32:30 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:43605) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cLa4O-0008TV-P9 for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 13:32:24 -0500 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uBQIWK4h017969 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 26 Dec 2016 18:32:20 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id uBQIWKq7005766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 26 Dec 2016 18:32:20 GMT Original-Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uBQIWJ36001389 for ; Mon, 26 Dec 2016 18:32:20 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] 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: 208.118.235.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:127457 Archived-At: Enhancement request. Provide an easy way to specify a predicate that inhibits (or activates) auto-revert for a given buffer. See this question, for example: http://emacs.stackexchange.com/q/29591/105 I provided this answer, but it might be helpful if Emacs provided a variable whose value is a predicate that determines whether the current buffer can be auto-reverted. Emacs provides a variable, `global-auto-revert-ignore-buffer', to test for auto-reversion. In addition or instead, it could provide a predicate-valued variable. Simpler, perhaps, is to let the value of `global-auto-revert-ignore-buffer' be, alternatively, a predicate, which is called when the buffer is set up (e.g. `after-file-hook', for a file buffer). The return value would be handled just like the current value of `global-auto-revert-ignore-buffer' is handled now. --- (defvar my-max-auto-revert-size 1000000000 "Do not auto-revert file buffers larger than this.") (add-hook 'find-file-hook (lambda () (when (> (buffer-size) my-max-auto-revert-size) (setq global-auto-revert-ignore-buffer t)))) (global-auto-revert-mode 1) In GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/c/usr --host=3Di686-pc-mingw32'