Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Eli Zaretskii writes: > >>> Cc: 61326@debbugs.gnu.org >>> Date: Tue, 7 Feb 2023 09:31:11 +0800 >>> From: Ruijie Yu via "Bug reports for GNU Emacs, >>> the Swiss army knife of text editors" >>> >>> Maybe, at least in the meantime, we change it such that all write operations >>> for zip create files in temp, and move to / overwrite the original file when >>> done? Although I don’t have a full understanding on how that would be done and >>> whether there are problems along with it. >> >> How about submitting a patch to do that, but only when the original >> file doesn't have an extension? > > Will do. Will report back in 2-3 days unless someone else gets to it > first. > > Best, > > > RY Here is a preliminary patch that contains some "REVIEW" comments where I need inputs. I have tested with the following recipe and things seem to work correctly: $ touch 1 2 && zip z 1 2 && mv z.zip z $ ls -l .... 1 .... 2 .... z $ src/emacs -Q RET ; open file "1" from within "z" archive s C-x C-s ; insert "s" and save file "1" C-x C-c ; exit $ ls -l # notice that no "z.zip" exists, and "z" is correctly updated .... 1 .... 2 .... z Patch based on 907fd1f7ff402f9d226ebb3b891ea5b54fac1d1c which is ~3 days old. I will amend the commit (and rebase if necessary) according to ML reviews and further progress.