GNU bug report logs - #44303
28.0.50; json-pretty-print-buffer creates spurious lock file

Previous Next

Package: emacs;

Reported by: Simen Heggestøyl <simenheg <at> runbox.com>

Date: Thu, 29 Oct 2020 10:01:02 UTC

Severity: normal

Found in version 28.0.50

Done: Simen Heggestøyl <simenheg <at> runbox.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 44303 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: simenheg <at> runbox.com, 44303 <at> debbugs.gnu.org
Subject: Re: bug#44303: 28.0.50;
 json-pretty-print-buffer creates spurious lock file
Date: Fri, 30 Oct 2020 15:34:51 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Fri, 30 Oct 2020 14:28:59 +0100
> Cc: 44303 <at> 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.




This bug report was last modified 4 years and 189 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.