aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa <[email protected]>2009-03-03 01:58:22 +0000
committerKenichi Handa <[email protected]>2009-03-03 01:58:22 +0000
commit86c507f71d7bf49796f8b83715d1a0a854c91038 (patch)
tree24e126879600dc840f63ead85e00cfefb1b58ae6
parent659be2587af45dcb1d076d14bdce38e02cf2efd4 (diff)
(basic-save-buffer-1): Set car part of
buffer-file-coding-system-explicit. (revert-buffer): Check car part of buffer-file-coding-system-explicit.
-rw-r--r--lisp/ChangeLog17
-rw-r--r--lisp/files.el9
2 files changed, 24 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1dda3a53f4..34ae0aa1af 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,20 @@
+2009-03-03 Kenichi Handa <[email protected]>
+
+ * files.el (basic-save-buffer-1): Set car part of
+ buffer-file-coding-system-explicit.
+ (revert-buffer): Check car part of
+ buffer-file-coding-system-explicit.
+
+ * international/mule-cmds.el (select-safe-coding-system): If cdr
+ part of buffer-file-coding-system-explicit is set, ignore
+ default-buffer-file-coding-system and the most preferred coding
+ system.
+
+ * international/mule.el (set-buffer-file-coding-system): Set cdr
+ part of buffer-file-coding-system-explicit.
+ (after-insert-file-set-coding): Set
+ buffer-file-coding-system-explicit to a cons.
+
2009-03-02 Glenn Morris <[email protected]>
* calendar/calendar.el (diary-date-forms, calendar-date-display-form):
diff --git a/lisp/files.el b/lisp/files.el
index afe6b4c3b6..1f458dd4ee 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4187,7 +4187,10 @@ Before and after saving the buffer, this function runs
(let ((coding-system-for-write save-buffer-coding-system))
(basic-save-buffer-2))
(basic-save-buffer-2))
- (setq buffer-file-coding-system-explicit last-coding-system-used)))
+ (if buffer-file-coding-system-explicit
+ (setcar buffer-file-coding-system-explicit last-coding-system-used)
+ (setq buffer-file-coding-system-explicit
+ (cons last-coding-system-used nil)))))
;; This returns a value (MODES . BACKUPNAME), like backup-buffer.
(defun basic-save-buffer-2 ()
@@ -4705,7 +4708,9 @@ non-nil, it is called instead of rereading visited file contents."
;; internal coding.
(if auto-save-p 'auto-save-coding
(or coding-system-for-read
- buffer-file-coding-system-explicit))))
+ (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