all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Kenichi Handa <handa@m17n.org>
Cc: 4533@debbugs.gnu.org
Subject: bug#4533: 23.1: reverting fails to update line ending mode line
Date: Sat, 13 Nov 2010 17:27:18 -0500	[thread overview]
Message-ID: <87mxpcc115.fsf@stupidchicken.com> (raw)
In-Reply-To: <1afaf6160909221901p527cca80jcbf81e589cde629d@mail.gmail.com>

> - 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






  parent reply	other threads:[~2010-11-13 22:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-23  2:01 bug#4533: 23.1: reverting fails to update line ending mode line Benjamin Peterson
2009-10-03  0:16 ` Glenn Morris
2009-11-05  4:17 ` Kenichi Handa
2010-11-13 22:27 ` Chong Yidong [this message]
2010-11-14  9:51   ` Eli Zaretskii
2010-11-14 17:32     ` Chong Yidong
2010-11-14 20:23       ` Dani Moncayo
2010-11-14 20:46         ` Eli Zaretskii
2010-11-14 20:55           ` Dani Moncayo
2010-11-14 21:47             ` Dani Moncayo
2010-11-15 16:51   ` Stefan Monnier
2010-11-15 17:27     ` Chong Yidong
2013-02-10  3:09       ` Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxpcc115.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=4533@debbugs.gnu.org \
    --cc=handa@m17n.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.