tags 18336 + patch quit Eli Zaretskii writes: >> >> I'm not sure. Why exactly are we calling lock_file from write_region? > > Because write-region can be called from an unmodified buffer, I > suppose, and from a buffer whose buffer-file-name is not the same as > the file being written to. So maybe we could just check those conditions? Here's a patch, tentatively suggested for master.