From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18141: 24.4.50; saving .gz file breaks file coding Date: Wed, 06 Aug 2014 21:10:39 +0300 Message-ID: <83tx5po5eo.fsf@gnu.org> References: <9pzjfrwvsl.fsf@fencepost.gnu.org> <83iom5ptwv.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1407348685 7103 80.91.229.3 (6 Aug 2014 18:11:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Aug 2014 18:11:25 +0000 (UTC) Cc: 18141@debbugs.gnu.org, vincent@vinc17.net, yamaoka@jpl.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 06 20:11: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 1XF5gC-0000xz-Gm for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 20:11:16 +0200 Original-Received: from localhost ([::1]:40398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF5gC-0006wQ-3K for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 14:11:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF5g4-0006w8-K0 for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 14:11:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF5fy-0002Pg-Hc for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 14:11:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF5fy-0002Pc-Ef for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 14:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XF5fx-0007cM-P5 for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 14:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Aug 2014 18:11: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.140734863629252 (code B ref 18141); Wed, 06 Aug 2014 18:11:01 +0000 Original-Received: (at 18141) by debbugs.gnu.org; 6 Aug 2014 18:10:36 +0000 Original-Received: from localhost ([127.0.0.1]:60697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF5fX-0007bj-FA for submit@debbugs.gnu.org; Wed, 06 Aug 2014 14:10:36 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:40020) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XF5fU-0007bR-Vo for 18141@debbugs.gnu.org; Wed, 06 Aug 2014 14:10:34 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0N9W00J00CUFP800@mtaout28.012.net.il> for 18141@debbugs.gnu.org; Wed, 06 Aug 2014 21:09:57 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9W00CMND4LSM70@mtaout28.012.net.il>; Wed, 06 Aug 2014 21:09:57 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il 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:92214 Archived-At: > From: Stefan Monnier > Cc: Glenn Morris , 18141@debbugs.gnu.org, Vincent Lefevre , yamaoka@jpl.org > Date: Wed, 06 Aug 2014 13:48:27 -0400 > > > - (let ((coding-system-for-write writecoding) > > - (coding-system-require-warning nil)) > > + (let ((coding-system-for-write > > + (if filename-is-magic coding-system-for-write writecoding)) > > + (coding-system-require-warning > > + (if filename-is-magic coding-system-require-warning))) > > (write-region nil nil > > buffer-file-name nil t buffer-file-truename) > > (setq success t)) > > I can vaguely guess why that avoids the problem The problem is the binding of coding-system-for-write based on incorrect interpretation of buffer-file-name. Why that causes the bug was explained in the text you elided. The code avoids the binding, and thus fixes its adverse effects. > but I'm having a hard time seeing why the above is "right". Do you see why the binding is "wrong"? > IOW it seems like an ugly workaround which may itself come with > unintended consequences. I agree that reverting the original change, which introduced this binding, is a better solution. Again, the text you elided said precisely that. I wonder why you didn't comment on that at all. As for unintended consequences, I don't see how can any come out of that, since this just restores the code that was working for years. Of course, if you have a better suggestion that would be safe enough for the release branch, I'm all ears.