GNU bug report logs -
#18141
24.4.50; saving .gz file breaks file coding
Previous Next
Reported by: Katsumi Yamaoka <yamaoka <at> jpl.org>
Date: Tue, 29 Jul 2014 07:01:02 UTC
Severity: important
Found in version 24.4.50
Fixed in version 24.3.93
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 2014-08-06 20:32:27 +0300, Eli Zaretskii wrote:
> > (Emacs seems to be confused on files that have several encodings,
> > such as mailboxes)
>
> It does? I didn't see that since Emacs 23.1 at the least.
Things may have been fixed. I don't remember exactly. There's also
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13505 that was fixed
not so long ago.
> > and I sometimes hit Ctrl-C in the terminal (from which Emacs was
> > started) to discard any change.
>
> Then don't do that, if it hurts.
Ctrl-C is standard to interrupt a foreground process. If the process
can't handle that, it should trap SIGINT. Ditto for SIGQUIT. But
processes must handle SIGHUP and SIGTERM gracefully, ditto for various
errors, like an X server crash.
> C-g or M-~ or C-/ in Emacs will discard changes (in different
> scenarios) without any adverse effects, as will killing the buffer
> that visits the modified file. Why brutally abort Emacs by a signal,
> when Emacs gives you better ways to do that?
I haven't see any better way. My goal is to quit Emacs, discarding any
change. Ctrl-C in the terminal is the fastest way to do that.
> > And that's not OK to only leave the backup file,
> > since it can be removed or overwritten pretty quickly, before
> > I notice that the original file is gone.
>
> Removed or overwritten by whom or what?
By me. I sometimes get rid of all the backup files because I don't need
them, since the original file should have been kept. A backup file is
overwritten if I edit a file of the same name in another directory, and
again, this is normally not a problem.
> > But why isn't the backup done just before the file is actually
> > written?
>
> It _is_ done "just before", see basic-save-buffer-2.
No, not without r111638: the backup is done before the user is asked
to the provide an encoding, thus not just before the file is written.
--
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
This bug report was last modified 10 years and 344 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.