summaryrefslogtreecommitdiff
path: root/lisp/international/mule-cmds.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/international/mule-cmds.el')
-rw-r--r--lisp/international/mule-cmds.el21
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 3e312f3cafd..2965b95e3b3 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -811,7 +811,7 @@ re-visited and edited.)
Optional 3rd arg DEFAULT-CODING-SYSTEM specifies a coding system or a
list of coding systems to be prepended to the default coding system
list. However, if DEFAULT-CODING-SYSTEM is a list and the first
-element is t, the cdr part is used as the defualt coding system list,
+element is t, the cdr part is used as the default coding system list,
i.e. `buffer-file-coding-system', `default-buffer-file-coding-system',
and the most preferred coding system are not used.
@@ -878,9 +878,6 @@ It is highly recommended to fix it before writing to a file."
(rassq base default-coding-system)
(push (cons auto-cs base) default-coding-system))))
- ;; From now on, the list of defaults is reversed.
- (setq default-coding-system (nreverse default-coding-system))
-
(unless no-other-defaults
;; If buffer-file-coding-system is not nil nor undecided, append it
;; to the defaults.
@@ -888,8 +885,9 @@ It is highly recommended to fix it before writing to a file."
(let ((base (coding-system-base buffer-file-coding-system)))
(or (eq base 'undecided)
(rassq base default-coding-system)
- (push (cons buffer-file-coding-system base)
- default-coding-system))))
+ (setq default-coding-system
+ (append default-coding-system
+ (list (cons buffer-file-coding-system base)))))))
;; If default-buffer-file-coding-system is not nil nor undecided,
;; append it to the defaults.
@@ -897,8 +895,10 @@ It is highly recommended to fix it before writing to a file."
(let ((base (coding-system-base default-buffer-file-coding-system)))
(or (eq base 'undecided)
(rassq base default-coding-system)
- (push (cons default-buffer-file-coding-system base)
- default-coding-system))))
+ (setq default-coding-system
+ (append default-coding-system
+ (list (cons default-buffer-file-coding-system
+ base)))))))
;; If the most preferred coding system has the property mime-charset,
;; append it to the defaults.
@@ -908,8 +908,9 @@ It is highly recommended to fix it before writing to a file."
(setq base (coding-system-base preferred))
(coding-system-get preferred :mime-charset)
(not (rassq base default-coding-system))
- (push (cons preferred base)
- default-coding-system))))
+ (setq default-coding-system
+ (append default-coding-system
+ (list (cons preferred base)))))))
(if select-safe-coding-system-accept-default-p
(setq accept-default-p select-safe-coding-system-accept-default-p))