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#4533: 23.1: reverting fails to update line ending mode line Date: Sun, 14 Nov 2010 04:51:13 -0500 Message-ID: References: <1afaf6160909221901p527cca80jcbf81e589cde629d@mail.gmail.com> <87mxpcc115.fsf@stupidchicken.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1289729663 9606 80.91.229.12 (14 Nov 2010 10:14:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 14 Nov 2010 10:14:23 +0000 (UTC) Cc: 4533@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 14 11:14:19 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PHZbH-0008LM-0L for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Nov 2010 11:14:19 +0100 Original-Received: from localhost ([127.0.0.1]:33300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHZbG-0002GH-0o for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Nov 2010 05:14:18 -0500 Original-Received: from [140.186.70.92] (port=40615 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHZb9-0002Aw-Iy for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2010 05:14:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PHZb1-0005H8-UC for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2010 05:14:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PHZb1-0005H4-Sl for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2010 05:14:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PHZAr-0003Ay-Mw; Sun, 14 Nov 2010 04:47:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Nov 2010 09:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 4533 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 4533-submit@debbugs.gnu.org id=B4533.128972798512199 (code B ref 4533); Sun, 14 Nov 2010 09:47:01 +0000 Original-Received: (at 4533) by debbugs.gnu.org; 14 Nov 2010 09:46:25 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PHZAG-0003Ai-Ke for submit@debbugs.gnu.org; Sun, 14 Nov 2010 04:46:24 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PHZAE-0003Ad-22 for 4533@debbugs.gnu.org; Sun, 14 Nov 2010 04:46:22 -0500 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1PHZEv-0005Tf-LV; Sun, 14 Nov 2010 04:51:13 -0500 In-reply-to: <87mxpcc115.fsf@stupidchicken.com> (message from Chong Yidong on Sat, 13 Nov 2010 17:27:18 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 14 Nov 2010 04:47:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:41611 Archived-At: > From: Chong Yidong > Date: Sat, 13 Nov 2010 17:27:18 -0500 > Cc: 4533@debbugs.gnu.org > > > - Start emacs -Q . > > - C-x C-f ~/foo.txt, creating a new file. > > - Enter text: > > Line 1 > > Line 2 > > > > - C-x C-s. > > - dos2unix ~/foo.txt > > - M-x revert-buffer > > - C-x k RET > > - C-x C-f ~/foo.txt > > Mode line shows --(Unix)--- > > The problem is that `C-x C-s' sets buffer-file-coding-system-explicit. > This causes revert-buffer to set coding-system-for-read to that value > (which is now incorrect) when inserting the file contents. This is why > the revert goes correctly if you omit the `C-x C-s' step. Why is this a real problem? I can handle this situation with C-x RET c undecided RET M-x revert-buffer RET (Perhaps "C-x RET r" should be fixed to do the same, when given `undecided' as the encoding.) > I think the use of buffer-file-coding-system-explicit in revert-buffer > is bogus, and should be removed---see below. What do you think? I'm not sure it's bogus. Why do you think so? Perhaps Handa-san remembers why this variable was introduced in the first place. I'm sure it was to solve some real-life problems.