]> git.eshelyaron.com Git - emacs.git/commitdiff
(select-safe-coding-system): If the file
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 17 Oct 2009 03:59:45 +0000 (03:59 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 17 Oct 2009 03:59:45 +0000 (03:59 +0000)
has a coding cookie, use it regardless of any other setting (bug#4712).

lisp/ChangeLog
lisp/international/mule-cmds.el

index 1cf7714e80e9f3a986f5621e4b6529492d19774d..0fcfead46e349e688abd4fbf3792a91233193045 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-17  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * international/mule-cmds.el (select-safe-coding-system): If the file
+       has a coding cookie, use it regardless of any other setting (bug#4712).
+
 2009-10-17  Glenn Morris  <rgm@gnu.org>
 
        * cedet/semantic/grammar.el (semantic-grammar--lex-delim-spec):
index 9d6f6eb4e967d0017780b881f5fc07faf9f2c1b4..af813b0172b2bb59c98556bb9f8c3b377d6abd83 100644 (file)
@@ -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