From: Eli Zaretskii <eliz@gnu.org>
To: emacs-devel@gnu.org
Subject: Locking/unlocking file inside with-silent-modifications
Date: Wed, 27 Dec 2017 18:27:24 +0200 [thread overview]
Message-ID: <83lghogmqb.fsf@gnu.org> (raw)
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.
Comments?
next reply other threads:[~2017-12-27 16:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-27 16:27 Eli Zaretskii [this message]
2017-12-28 17:26 ` Locking/unlocking file inside with-silent-modifications Eli Zaretskii
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83lghogmqb.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).