From: Kenichi Handa Date: Tue, 3 Mar 2009 01:57:22 +0000 (+0000) Subject: (select-safe-coding-system): If cdr X-Git-Tag: emacs-pretest-23.0.92~379 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=659be2587af45dcb1d076d14bdce38e02cf2efd4;p=emacs.git (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. --- diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 451ac39cbfa..feed9870a8e 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -930,28 +930,30 @@ It is highly recommended to fix it before writing to a file." (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))))))) - - ;; 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))))))) + (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 select-safe-coding-system-accept-default-p (setq accept-default-p select-safe-coding-system-accept-default-p))