all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: Locking/unlocking file inside with-silent-modifications
Date: Thu, 28 Dec 2017 19:26:00 +0200	[thread overview]
Message-ID: <831sjehihj.fsf@gnu.org> (raw)
In-Reply-To: <83lghogmqb.fsf@gnu.org> (message from Eli Zaretskii on Wed, 27 Dec 2017 18:27:24 +0200)

> Date: Wed, 27 Dec 2017 18:27:24 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> 
> 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.



      reply	other threads:[~2017-12-28 17:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-27 16:27 Locking/unlocking file inside with-silent-modifications Eli Zaretskii
2017-12-28 17:26 ` Eli Zaretskii [this message]

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=831sjehihj.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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.