From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#4533: 23.1: reverting fails to update line ending mode line Date: Sat, 13 Nov 2010 17:27:18 -0500 Message-ID: <87mxpcc115.fsf@stupidchicken.com> References: <1afaf6160909221901p527cca80jcbf81e589cde629d@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1289688271 18237 80.91.229.12 (13 Nov 2010 22:44:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 13 Nov 2010 22:44:31 +0000 (UTC) Cc: 4533@debbugs.gnu.org To: Kenichi Handa Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 13 23:44:26 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 1PHOpa-0001Pw-Og for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Nov 2010 23:44:26 +0100 Original-Received: from localhost ([127.0.0.1]:52849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHOpV-0002cm-HJ for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Nov 2010 17:44:17 -0500 Original-Received: from [140.186.70.92] (port=58337 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHOpM-0002Yq-EZ for bug-gnu-emacs@gnu.org; Sat, 13 Nov 2010 17:44:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PHOpI-0005KL-Et for bug-gnu-emacs@gnu.org; Sat, 13 Nov 2010 17:44:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PHOpI-0005KH-CG for bug-gnu-emacs@gnu.org; Sat, 13 Nov 2010 17:44:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PHOUw-0006Mx-8K; Sat, 13 Nov 2010 17:23:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <1afaf6160909221901p527cca80jcbf81e589cde629d@mail.gmail.com> Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Nov 2010 22:23:02 +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.128968695324474 (code B ref 4533); Sat, 13 Nov 2010 22:23:02 +0000 Original-Received: (at 4533) by debbugs.gnu.org; 13 Nov 2010 22:22:33 +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 1PHOUT-0006Mh-Fd for submit@debbugs.gnu.org; Sat, 13 Nov 2010 17:22:33 -0500 Original-Received: from pantheon-po16.its.yale.edu ([130.132.50.72]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PHOUR-0006Mc-3y for 4533@debbugs.gnu.org; Sat, 13 Nov 2010 17:22:31 -0500 Original-Received: from furball (c-71-192-165-84.hsd1.ct.comcast.net [71.192.165.84]) (authenticated bits=0) by pantheon-po16.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id oADMRM2r032453 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 13 Nov 2010 17:27:23 -0500 Original-Received: by furball (Postfix, from userid 1000) id 485B4160750; Sat, 13 Nov 2010 17:27:18 -0500 (EST) X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 13 Nov 2010 17:23:02 -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:41589 Archived-At: > - 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. 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? *** lisp/files.el 2010-11-11 22:19:01 +0000 --- lisp/files.el 2010-11-13 22:22:01 +0000 *************** *** 4906,4916 **** (let ((coding-system-for-read ;; Auto-saved file should be read by Emacs' ;; internal coding. ! (if auto-save-p 'auto-save-coding ! (or coding-system-for-read ! (and ! buffer-file-coding-system-explicit ! (car buffer-file-coding-system-explicit)))))) (if (and (not enable-multibyte-characters) coding-system-for-read (not (memq (coding-system-base --- 4906,4914 ---- (let ((coding-system-for-read ;; Auto-saved file should be read by Emacs' ;; internal coding. ! (if auto-save-p ! 'auto-save-coding ! coding-system-for-read))) (if (and (not enable-multibyte-characters) coding-system-for-read (not (memq (coding-system-base