summaryrefslogtreecommitdiff
path: root/lisp/international/mule-cmds.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2009-10-17 03:59:45 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2009-10-17 03:59:45 +0000
commit2df48a87291564f460b159f94f622f88f6c40bfb (patch)
tree2d949fe5fe9d6c200813d20f6fd46d47f1ada3f9 /lisp/international/mule-cmds.el
parent547776f9b0537d5231f7fc864715961b8d916012 (diff)
downloademacs-2df48a87291564f460b159f94f622f88f6c40bfb.tar.gz
(select-safe-coding-system): If the file
has a coding cookie, use it regardless of any other setting (bug#4712).
Diffstat (limited to 'lisp/international/mule-cmds.el')
-rw-r--r--lisp/international/mule-cmds.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 9d6f6eb4e96..af813b0172b 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -889,13 +889,12 @@ It is highly recommended to fix it before writing to a file."
default-coding-system))
(if (and auto-cs (not no-other-defaults))
- ;; If the file has a coding cookie, try to use it before anything
- ;; else (i.e. before default-coding-system which will typically come
- ;; from file-coding-system-alist).
+ ;; If the file has a coding cookie, use it regardless of any
+ ;; other setting.
(let ((base (coding-system-base auto-cs)))
- (or (memq base '(nil undecided))
- (rassq base default-coding-system)
- (push (cons auto-cs base) default-coding-system))))
+ (unless (memq base '(nil undecided))
+ (setq default-coding-system (list (cons auto-cs base)))
+ (setq no-other-defaults t))))
(unless no-other-defaults
;; If buffer-file-coding-system is not nil nor undecided, append it