diff options
| author | Chong Yidong | 2013-02-10 11:08:21 +0800 |
|---|---|---|
| committer | Chong Yidong | 2013-02-10 11:08:21 +0800 |
| commit | 0ccdf61ed6527800856123189c799beca78218e3 (patch) | |
| tree | bada00a5a29c09d1a292b55cebb4f5af61d57f78 | |
| parent | 490a9458c8310140a255b30330e9940fb68e27ef (diff) | |
| download | emacs-0ccdf61ed6527800856123189c799beca78218e3.tar.gz emacs-0ccdf61ed6527800856123189c799beca78218e3.zip | |
* files.el (basic-save-buffer-1): Don't set buffer-file-coding-system-explicit.
Fixes: debbugs:4533
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/files.el | 4 | ||||
| -rw-r--r-- | lisp/international/mule.el | 21 |
3 files changed, 16 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cc5aa18d27f..c0a91bb75dc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2013-02-10 Chong Yidong <cyd@gnu.org> | 1 | 2013-02-10 Chong Yidong <cyd@gnu.org> |
| 2 | 2 | ||
| 3 | * files.el (basic-save-buffer-1): Do not set | ||
| 4 | buffer-file-coding-system-explicit (Bug#4533). | ||
| 5 | |||
| 3 | * mail/emacsbug.el (report-emacs-bug): Change binding of | 6 | * mail/emacsbug.el (report-emacs-bug): Change binding of |
| 4 | report-emacs-bug-insert-to-mailer to C-c M-i (Bug#13510). | 7 | report-emacs-bug-insert-to-mailer to C-c M-i (Bug#13510). |
| 5 | 8 | ||
diff --git a/lisp/files.el b/lisp/files.el index 9fca70d36f7..c9e5d2763fe 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -4646,9 +4646,7 @@ Before and after saving the buffer, this function runs | |||
| 4646 | (basic-save-buffer-2)) | 4646 | (basic-save-buffer-2)) |
| 4647 | (basic-save-buffer-2)) | 4647 | (basic-save-buffer-2)) |
| 4648 | (if buffer-file-coding-system-explicit | 4648 | (if buffer-file-coding-system-explicit |
| 4649 | (setcar buffer-file-coding-system-explicit last-coding-system-used) | 4649 | (setcar buffer-file-coding-system-explicit last-coding-system-used)))) |
| 4650 | (setq buffer-file-coding-system-explicit | ||
| 4651 | (cons last-coding-system-used nil))))) | ||
| 4652 | 4650 | ||
| 4653 | ;; This returns a value (MODES EXTENDED-ATTRIBUTES BACKUPNAME), like | 4651 | ;; This returns a value (MODES EXTENDED-ATTRIBUTES BACKUPNAME), like |
| 4654 | ;; backup-buffer. | 4652 | ;; backup-buffer. |
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 995df2fb9a7..47c7087518e 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -1132,17 +1132,20 @@ FORM is a form to evaluate to define the coding-system." | |||
| 1132 | (put (intern name) 'coding-system-define-form form) | 1132 | (put (intern name) 'coding-system-define-form form) |
| 1133 | (setq coding-system-alist (cons (list name) coding-system-alist))))) | 1133 | (setq coding-system-alist (cons (list name) coding-system-alist))))) |
| 1134 | 1134 | ||
| 1135 | ;; This variable is set in these three cases: | 1135 | ;; This variable is set in these two cases: |
| 1136 | ;; (1) A file is read by a coding system specified explicitly. | 1136 | ;; (1) A file is read by a coding system specified explicitly. |
| 1137 | ;; after-insert-file-set-coding sets the car of this value to | 1137 | ;; `after-insert-file-set-coding' sets the car of this value to |
| 1138 | ;; coding-system-for-read, and sets the cdr to nil. | 1138 | ;; `coding-system-for-read', and sets the cdr to nil. |
| 1139 | ;; (2) A buffer is saved. | 1139 | ;; (2) `set-buffer-file-coding-system' is called. |
| 1140 | ;; After writing, basic-save-buffer-1 sets the car of this value | ||
| 1141 | ;; to last-coding-system-used. | ||
| 1142 | ;; (3) set-buffer-file-coding-system is called. | ||
| 1143 | ;; The cdr of this value is set to the specified coding system. | 1140 | ;; The cdr of this value is set to the specified coding system. |
| 1144 | ;; This variable is used for decoding in revert-buffer and encoding in | 1141 | ;; This variable is used for decoding in `revert-buffer' and encoding |
| 1145 | ;; select-safe-coding-system. | 1142 | ;; in `select-safe-coding-system'. |
| 1143 | ;; | ||
| 1144 | ;; When saving a buffer, if `buffer-file-coding-system-explicit' is | ||
| 1145 | ;; already non-nil, `basic-save-buffer-1' sets its CAR to the value of | ||
| 1146 | ;; `last-coding-system-used'. (It used to set it unconditionally, but | ||
| 1147 | ;; that seems unnecessary; see Bug#4533.) | ||
| 1148 | |||
| 1146 | (defvar buffer-file-coding-system-explicit nil | 1149 | (defvar buffer-file-coding-system-explicit nil |
| 1147 | "The file coding system explicitly specified for the current buffer. | 1150 | "The file coding system explicitly specified for the current buffer. |
| 1148 | The value is a cons of coding systems for reading (decoding) and | 1151 | The value is a cons of coding systems for reading (decoding) and |