Subject: Re: bug#29846: scroll and fontify takes longer time for file in slow network

From: Eli Zaretskii <[email-masked]>
Date: Mon, 25 Dec 2017 18:48:18 +0200

> From: Shuguang Sun <[email-masked]>
> Date: Mon, 25 Dec 2017 17:47:52 +0800
> 
> Backup, auto-save, and lockfiles has been disabled in .dir-locals
> 
> ((nil
>   (make-backup-files . nil)
>   (create-lockfiles  . nil)
>   (auto-save-default . nil)
>   (auto-save-timeout . 10000)
>   ))

You've disabled file locking, but Emacs still checks whether some
other Emacs session locked the file.  It does that as part of
restore-buffer-modified-p, which is called by JIT font-lock (because
fontification makes the buffer modified and JIT font-lock needs to
undo that after it fontifies a chunk of buffer).  Checking whether a
file is locked entails calling unlock_file, which in turn calls
read_lock_data, which tries to open the lock file.  I'm guessing that
this is slow on that remote volume of yours.

Maybe we should support a special value of create-lockfiles which
would mean don't create lockfiles and don't test fro lockfiles created
by other Emacs sessions.