[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-trunk-diffs] Changes to emacs/src/sysdep.c

From: Richard Stallman
Subject: Re: [Emacs-trunk-diffs] Changes to emacs/src/sysdep.c
Date: Mon, 29 Nov 2004 01:11:32 -0500

    Hmm... what happens if you hit C-g while writing a file?

Before your change, nothing, I believe.  That code was not
interruptible with quit.  It would write all the data, and the quit
would occur afterward.  Emacs might get confused as a result of
quitting inside the middle of the Lisp code to save the buffer, but
at least the file contents would not be truncated

    How does Emacs prevent truncation in the normal code?

I am not sure which code "the normal code" refers to,
but the way this code was written before, there was no QUIT check
during the actual writing of the data into the file.
So QUIT could never cause truncation.

    Being able to interrupt a write if it's blocking for a long time (like
    write to an NFS server that's down).

That is indeed desirable, so I think we have a problem of choosing
between two kinds of lossage.  I wish I could remember more clearly
what sort of problems could occur if quitting could truncate a file.

Maybe we could get the best of both worlds if we set it up so that
quit can occur inside emacs_write only if it has been sitting there
for 30 seconds or more since the last data it succeeded in writing.
That way, users could quit in the case of the dead NFS server,
but in all ordinary cases the quit would still be delayed until
after Fwrite_file has finished.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]