--- Begin Message ---
Subject: |
23.1: reverting fails to update line ending mode line |
Date: |
Tue, 22 Sep 2009 21:01:31 -0500 |
I had a buffer with a mode line like this:
- U:(DOS)
I ran dos2unix on the file, and did M-x revert-buffer.
The DOS stayed in the mode line until I killed the buffer and
revisited the buffer.
In GNU Emacs 23.1.1 (x86_64-pc-linux-gnu)
of 2009-09-07 on benjamin
Windowing system distributor `The X.Org Foundation', version 11.0.10503000
configured using `configure '--prefix=/usr'
'--build=x86_64-pc-linux-gnu' '--host=x86_64-pc-linux-gnu'
'--mandir=/usr/share/man' '--infodir=/usr/share/info'
'--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib'
'--libdir=/usr/lib64' '--program-suffix=-emacs-23'
'--infodir=/usr/share/info/emacs-23' '--with-sound' '--with-x'
'--without-toolkit-scroll-bars' '--without-gif' '--with-jpeg'
'--with-png' '--with-rsvg' '--with-tiff' '--with-xpm' '--with-xft'
'--without-libotf' '--without-m17n-flt' '--with-x-toolkit=no'
'--without-hesiod' '--without-kerberos' '--without-kerberos5'
'--with-gpm' '--with-dbus' 'build_alias=x86_64-pc-linux-gnu'
'host_alias=x86_64-pc-linux-gnu' 'CFLAGS=-O2 -pipe' 'LDFLAGS=-Wl,-O1''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: nil
value of $XMODIFIERS: nil
locale-coding-system: nil
default-enable-multibyte-characters: t
Major mode: Python
Minor modes in effect:
show-paren-mode: t
tooltip-mode: t
tool-bar-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
global-auto-composition-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
n i c o d e C-s C-s C-s C-s C-s C-s C-s C-x b <return>
M-v M-v M-v M-v C-p C-p C-p C-p C-p C-p C-p C-p C-p
C-p C-n C-n C-n C-n C-n C-n C-f C-f C-f C-f C-f C-f
C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-p C-p C-p
C-p C-p C-p C-p C-f C-f <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> c l a s s SPC _ u n i c o d e ( s t r )
: <return> p a s s C-x C-s C-v C-v C-v C-v C-v C-v
C-v M-v M-v M-v C-x b <return> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <left> <left>
<left> <left> <left> <left> <left> <left> _ C-x C-s
M-v C-v C-n C-n C-n C-n C-n C-n C-n <return> C-p <tab>
# SPC S D <backspace> <backspace> <backspace> <backspace>
p y . t e s t . s k i p ( " w i l l SPC r e w r i t
e " ) C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n <return> p y . t e s t . s k i
p ( " w i l l SPC r e w r i t e " ) C-x C-s <help-echo>
M-x r e v e r t - u f <tab> <backspace> <backspace>
b u f <tab> <return> y M-v M-v M-v f r C-x k <return>
C-x C-f t e s t - s e r <tab> <backspace> <backspace>
<backspace> <backspace> _ s e r <tab> <return> C-v
C-v C-v M-v M-v M-x r e p o r t - e m <tab> <retur
n>
Recent messages:
Local value of py-indent-offset set to 4
Using the CPython shell
test_serializer.py changed on disk; really edit the buffer? (y, n, r or C-h)
Fontifying test_serializer.py... (regexps............)
Local value of py-indent-offset set to 4
Using the CPython shell
byte-code: File reverted: /home/benjamin/dev/repos/pylib/test_serializer.py
Fontifying test_serializer.py... (regexps............)
Local value of py-indent-offset set to 4
Using the CPython shell
call-interactively: End of buffer
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#4533: 23.1: reverting fails to update line ending mode line |
Date: |
Sun, 10 Feb 2013 11:09:51 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2.93 (gnu/linux) |
Chong Yidong <address@hidden> writes:
>> So maybe the problem is that C-x C-s should not set
>> buffer-file-coding-system-explicit (unless the C-x C-s prompted the user
>> to choose a coding-system, I guess).
>
> I see. The comments in mule.el say that
>
> ;; This variable is set in these three cases:
> ;; (1) A file is read by a coding system specified explicitly.
> ;; after-insert-file-set-coding sets the car of this value to
> ;; coding-system-for-read, and sets the cdr to nil.
> ;; (2) A buffer is saved.
> ;; After writing, basic-save-buffer-1 sets the car of this value
> ;; to last-coding-system-used.
> ;; (3) set-buffer-file-coding-system is called.
> ;; The cdr of this value is set to the specified coding system.
> ;; This variable is used for decoding in revert-buffer and encoding in
> ;; select-safe-coding-system.
>
> Indeed, this seems to imply that (2) can be omitted, as you suggest,
> since "force selecting" a coding system should trigger (1) and (3). Is
> there any reason that (2) was originally included?
Since there's been no response, and my testing showed no ill effects to
this change, I went ahead and committed it in the trunk. Let's see how
it shakes out.
--- End Message ---