all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Shuguang Sun <shuguang@gmail.com>
Cc: 29846@debbugs.gnu.org
Subject: bug#29846: scroll and fontify takes longer time for file in slow network
Date: Wed, 27 Dec 2017 15:49:56 -0500	[thread overview]
Message-ID: <jwv373vgatf.fsf-monnier+bug#29846@gnu.org> (raw)
In-Reply-To: <CACspjXdWGoGQUK2OXPC16ZEO2_TGvzMYmt6sszR2auJXupUK0A@mail.gmail.com> (Shuguang Sun's message of "Mon, 25 Dec 2017 14:03:43 +0800")

> 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 <monnier@iro.umontreal.ca>
  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





  parent reply	other threads:[~2017-12-27 20:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-25  6:03 bug#29846: scroll and fontify takes longer time for file in slow network Shuguang Sun
2017-12-25  9:47 ` Shuguang Sun
2017-12-25 12:28   ` Eli Zaretskii
2017-12-25 14:41     ` Shuguang Sun
2017-12-25 16:48   ` Eli Zaretskii
2017-12-26  1:04     ` Shuguang Sun
2017-12-27 20:49 ` Stefan Monnier [this message]
2017-12-28 16:21   ` Eli Zaretskii
2017-12-28 19:03     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='jwv373vgatf.fsf-monnier+bug#29846@gnu.org' \
    --to=monnier@iro.umontreal.ca \
    --cc=29846@debbugs.gnu.org \
    --cc=shuguang@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.