changeset 102363:822c5b674d12

(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.
author Kenichi Handa <handa@m17n.org>
date Tue, 03 Mar 2009 01:57:22 +0000
parents 60b5e159913b
children cc888000a97c
files lisp/international/mule-cmds.el
diffstat 1 files changed, 23 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule-cmds.el	Tue Mar 03 01:56:14 2009 +0000
+++ b/lisp/international/mule-cmds.el	Tue Mar 03 01:57:22 2009 +0000
@@ -930,28 +930,30 @@
 		      (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.
-      (if default-buffer-file-coding-system
-	  (let ((base (coding-system-base default-buffer-file-coding-system)))
-	    (or (eq base 'undecided)
-		(rassq base default-coding-system)
-		(setq default-coding-system
-		      (append default-coding-system
-			      (list (cons default-buffer-file-coding-system
-					  base)))))))
+      (unless (and buffer-file-coding-system-explicit
+		   (cdr buffer-file-coding-system-explicit))
+	;; If default-buffer-file-coding-system is not nil nor undecided,
+	;; append it to the defaults.
+	(if default-buffer-file-coding-system
+	    (let ((base (coding-system-base default-buffer-file-coding-system)))
+	      (or (eq base 'undecided)
+		  (rassq 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.
-      (let ((preferred (coding-system-priority-list t))
-	    base)
-	(and (coding-system-p preferred)
-	     (setq base (coding-system-base preferred))
-	     (coding-system-get preferred :mime-charset)
-	     (not (rassq base default-coding-system))
-	     (setq default-coding-system
-		   (append default-coding-system
-			   (list (cons preferred base)))))))
+	;; If the most preferred coding system has the property mime-charset,
+	;; append it to the defaults.
+	(let ((preferred (coding-system-priority-list t))
+	      base)
+	  (and (coding-system-p preferred)
+	       (setq base (coding-system-base preferred))
+	       (coding-system-get preferred :mime-charset)
+	       (not (rassq 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))