From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: simenheg@runbox.com, 44303@debbugs.gnu.org
Subject: bug#44303: 28.0.50; json-pretty-print-buffer creates spurious lock file
Date: Fri, 30 Oct 2020 15:34:51 +0200 [thread overview]
Message-ID: <83r1pfalc4.fsf@gnu.org> (raw)
In-Reply-To: <87o8kjhmg4.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 30 Oct 2020 14:28:59 +0100)
> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Fri, 30 Oct 2020 14:28:59 +0100
> Cc: 44303@debbugs.gnu.org
>
> > The buffer stays unchanged as expected since the pretty printed content
> > is identical to the original. The buffer is not marked as modified (also
> > expected), but a spurious lock file '.#test.json' has been created.
>
> Yup. It's this code in Freplace_buffer_contents:
>
> if (!inhibit_modification_hooks)
> {
> prepare_to_modify_buffer (BEGV, ZV, NULL);
> specbind (Qinhibit_modification_hooks, Qt);
> modification_hooks_inhibited = true;
> }
>
> prepare_to_modify_buffer creates the backup file.
But we then have this:
if (modification_hooks_inhibited)
{
signal_after_change (BEGV, size_a, ZV - BEGV);
update_compositions (BEGV, ZV, CHECK_INSIDE);
}
Does this not work, or fail to unlock the file?
> But is that even needed here? Don't the later
> Finsert_buffer_substring/del_range_both functions do the necessary
> bookkeeping?
We disable that by binding inhibit_modification_hooks, and we do that
for speed, see the comment before that code.
next prev parent reply other threads:[~2020-10-30 13:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-29 9:59 bug#44303: 28.0.50; json-pretty-print-buffer creates spurious lock file Simen Heggestøyl
2020-10-30 13:28 ` Lars Ingebrigtsen
2020-10-30 13:31 ` Lars Ingebrigtsen
2020-10-30 13:34 ` Eli Zaretskii [this message]
2020-11-01 12:06 ` Lars Ingebrigtsen
2020-11-07 10:32 ` Eli Zaretskii
2020-11-09 8:24 ` Simen Heggestøyl
2020-11-09 15:58 ` Eli Zaretskii
2020-11-09 16:36 ` Simen Heggestøyl
2020-11-14 13:25 ` Eli Zaretskii
2020-11-09 14:03 ` Lars Ingebrigtsen
2020-11-09 16:08 ` 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=83r1pfalc4.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=44303@debbugs.gnu.org \
--cc=larsi@gnus.org \
--cc=simenheg@runbox.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 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).