[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#4533: 23.1: reverting fails to update line ending mode line
From: |
Chong Yidong |
Subject: |
bug#4533: 23.1: reverting fails to update line ending mode line |
Date: |
Mon, 15 Nov 2010 12:27:39 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> 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?
>
> Its use is not bogus. It's so that when a file's coding-system is
> incorrectly auto-detected, the user can force the use of a correct
> coding-system and subsequent revert-buffers won't disregard it.
>
> 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?
bug#4533: 23.1: reverting fails to update line ending mode line, Stefan Monnier, 2010/11/15
- bug#4533: 23.1: reverting fails to update line ending mode line,
Chong Yidong <=