GNU bug report logs -
#44303
28.0.50; json-pretty-print-buffer creates spurious lock file
Previous Next
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 #8 received at 44303 <at> debbugs.gnu.org (full text, mbox):
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 188 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.