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


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Simen Heggestøyl <simenheg <at> runbox.com>
Cc: 44303 <at> debbugs.gnu.org
Subject: bug#44303: 28.0.50; json-pretty-print-buffer creates spurious lock file
Date: Fri, 30 Oct 2020 14:28:59 +0100
Simen Heggestøyl <simenheg <at> runbox.com> writes:

> Given a file named 'test.json' with the following content: {}
>
>>From 'emacs -Q', visit the file and call 'json-pretty-print-buffer'.
>
> 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 is that even needed here?  Don't the later
Finsert_buffer_substring/del_range_both functions do the necessary
bookkeeping?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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.