From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#29846: scroll and fontify takes longer time for file in slow network Date: Wed, 27 Dec 2017 15:49:56 -0500 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1514407709 25619 195.159.176.226 (27 Dec 2017 20:48:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 27 Dec 2017 20:48:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 29846@debbugs.gnu.org To: Shuguang Sun Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 27 21:48:25 2017 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 1eUIca-0005dw-E9 for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Dec 2017 21:48:16 +0100 Original-Received: from localhost ([::1]:47358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUIeV-0002UA-V9 for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Dec 2017 15:50:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUIeM-0002Tc-T8 for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2017 15:50:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eUIeI-0001uF-Pk for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2017 15:50:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45531) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eUIeI-0001tU-KE for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2017 15:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eUIeI-0001VC-7Q for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2017 15:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Dec 2017 20:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29846 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29846-submit@debbugs.gnu.org id=B29846.15144078005763 (code B ref 29846); Wed, 27 Dec 2017 20:50:02 +0000 Original-Received: (at 29846) by debbugs.gnu.org; 27 Dec 2017 20:50:00 +0000 Original-Received: from localhost ([127.0.0.1]:54212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eUIeG-0001Us-0Y for submit@debbugs.gnu.org; Wed, 27 Dec 2017 15:50:00 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:48610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eUIeE-0001Uk-7U for 29846@debbugs.gnu.org; Wed, 27 Dec 2017 15:49:59 -0500 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id vBRKnuQ7002351; Wed, 27 Dec 2017 15:49:57 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 6880866326; Wed, 27 Dec 2017 15:49:56 -0500 (EST) In-Reply-To: (Shuguang Sun's message of "Mon, 25 Dec 2017 14:03:43 +0800") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6188=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6188> : inlines <6289> : streams <1774348> : uri <2558438> 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:141546 Archived-At: > I have remote drive (//server/path) mapped to my windows system (samba?). > The network is slow, and it takes some time to open the file. However, > after I have the file opened and scroll down, it takes a long time to > scroll to the next screen. It gets worse if the jit-lock-debug-mode is on. > After that if I try to scroll back to those has been fontified, it get > fluent as expected. I believe this bug was introduced by yours truly in commit 6bc76cee212aab0a2c02f8c28213fc842cc7880f: Author: Stefan Monnier Date: Tue Apr 8 21:48:07 2014 -0400 * src/insdel.c (prepare_to_modify_buffer_1): Cancel lock-file checks and region handling (and don't call signal_before_change) if inhibit_modification_hooks is set. (signal_before_change): Don't check inhibit_modification_hooks any more. * lisp/subr.el (with-silent-modifications): Don't bind deactivate-mark, buffer-file-name, and buffer-file-truename any more. And I think the patch below hence belongs in emacs-26. Any objection? Stefan diff --git a/src/buffer.c b/src/buffer.c index 75cb470af8..f518e72f9e 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1346,7 +1346,6 @@ It is not ensured that mode lines will be updated to show the modified state of the current buffer. Use with care. */) (Lisp_Object flag) { - Lisp_Object fn; /* If buffer becoming modified, lock the file. If buffer becoming unmodified, unlock the file. */ @@ -1355,15 +1354,18 @@ state of the current buffer. Use with care. */) ? current_buffer->base_buffer : current_buffer; - fn = BVAR (b, file_truename); - /* Test buffer-file-name so that binding it to nil is effective. */ - if (!NILP (fn) && ! NILP (BVAR (b, filename))) + if (!inhibit_modification_hooks) { - bool already = SAVE_MODIFF < MODIFF; - if (!already && !NILP (flag)) - lock_file (fn); - else if (already && NILP (flag)) - unlock_file (fn); + Lisp_Object fn = BVAR (b, file_truename); + /* Test buffer-file-name so that binding it to nil is effective. */ + if (!NILP (fn) && ! NILP (BVAR (b, filename))) + { + bool already = SAVE_MODIFF < MODIFF; + if (!already && !NILP (flag)) + lock_file (fn); + else if (already && NILP (flag)) + unlock_file (fn); + } } /* Here we have a problem. SAVE_MODIFF is used here to encode