From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vincent Lefevre Newsgroups: gmane.emacs.bugs Subject: bug#18141: 24.4.50; saving .gz file breaks file coding Date: Wed, 6 Aug 2014 21:08:25 +0200 Message-ID: <20140806190825.GL4813@xvii.vinc17.org> References: <9pzjfrwvsl.fsf@fencepost.gnu.org> <83iom5ptwv.fsf@gnu.org> <20140806164316.GK4813@xvii.vinc17.org> <831tstplqs.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1407352164 18330 80.91.229.3 (6 Aug 2014 19:09:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Aug 2014 19:09:24 +0000 (UTC) Cc: 18141@debbugs.gnu.org, yamaoka@jpl.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 06 21:09:17 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XF6aK-0000Sf-LG for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 21:09:16 +0200 Original-Received: from localhost ([::1]:40610 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF6aK-00051f-61 for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 15:09:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF6aC-00050e-9m for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 15:09:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF6a6-0004DW-UT for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 15:09:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF6a6-0004DS-Qx for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 15:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XF6a5-0000jt-Tr for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 15:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Aug 2014 19:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18141 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18141-submit@debbugs.gnu.org id=B18141.14073521162804 (code B ref 18141); Wed, 06 Aug 2014 19:09:01 +0000 Original-Received: (at 18141) by debbugs.gnu.org; 6 Aug 2014 19:08:36 +0000 Original-Received: from localhost ([127.0.0.1]:60750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF6Ze-0000j9-W3 for submit@debbugs.gnu.org; Wed, 06 Aug 2014 15:08:35 -0400 Original-Received: from ioooi.vinc17.net ([92.243.22.117]:54089) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF6ZX-0000io-Dd for 18141@debbugs.gnu.org; Wed, 06 Aug 2014 15:08:33 -0400 Original-Received: from smtp-xvii.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by ioooi.vinc17.net (Postfix) with ESMTPSA id 1C865319; Wed, 6 Aug 2014 21:08:26 +0200 (CEST) Original-Received: by xvii.vinc17.org (Postfix, from userid 1000) id D5EA421A07C; Wed, 6 Aug 2014 21:08:25 +0200 (CEST) Content-Disposition: inline In-Reply-To: <831tstplqs.fsf@gnu.org> X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.23-6361-vl-r59709 (2014-07-25) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:92218 Archived-At: 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 - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)