From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Locking/unlocking file inside with-silent-modifications Date: Thu, 28 Dec 2017 19:26:00 +0200 Message-ID: <831sjehihj.fsf@gnu.org> References: <83lghogmqb.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1514481945 16011 195.159.176.226 (28 Dec 2017 17:25:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 28 Dec 2017 17:25:45 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 28 18:25:41 2017 Return-path: Envelope-to: ged-emacs-devel@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 1eUbw2-0003Xj-8S for ged-emacs-devel@m.gmane.org; Thu, 28 Dec 2017 18:25:38 +0100 Original-Received: from localhost ([::1]:59158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUbxz-0001nw-FU for ged-emacs-devel@m.gmane.org; Thu, 28 Dec 2017 12:27:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUbwE-0000QM-99 for emacs-devel@gnu.org; Thu, 28 Dec 2017 12:25:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eUbw9-0000Vk-6C for emacs-devel@gnu.org; Thu, 28 Dec 2017 12:25:50 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUbw9-0000VM-0y for emacs-devel@gnu.org; Thu, 28 Dec 2017 12:25:45 -0500 Original-Received: from [176.228.60.248] (port=2016 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eUbw8-0006S7-Av for emacs-devel@gnu.org; Thu, 28 Dec 2017 12:25:44 -0500 In-reply-to: <83lghogmqb.fsf@gnu.org> (message from Eli Zaretskii on Wed, 27 Dec 2017 18:27:24 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221443 Archived-At: > Date: Wed, 27 Dec 2017 18:27:24 +0200 > From: Eli Zaretskii > > This is a spin-off from bug#29846, where a user complained about very > slow scrolling due to JIT font-lock, when the buffer visits a file > that resides on a very slow networked volume. > > The reason for that is that JIT font-lock repeatedly calls > with-silent-modifications, which calls restore-buffer-modified-p, > which calls unlock_file. It does that even if the user disabled > file-locking (presumably because some other Emacs session could > have locked the file). > > After thinking about this, I concluded that it makes little sense to > lock and unlock files in the body run by with-silent-modifications. > After all, with-silent-modifications is meant to pretend that no > modifications happened in the first place, so why would we want to > lock and unlock the buffer's file while performing modifications that > "never happened"? Am I missing something? > > There is a way, albeit an undocumented one, of disabling lock/unlock > inside restore-buffer-modified-p. So if we agree that it's TRT, the > change to implement that is easy. For the record: the followup is in bug#29846, and the change that will fix this issue will be shortly pushed to the emacs-26 branch.