diff options
| author | Kenichi Handa | 2009-03-03 01:57:22 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2009-03-03 01:57:22 +0000 |
| commit | 659be2587af45dcb1d076d14bdce38e02cf2efd4 (patch) | |
| tree | 7063c20e4224498cd5b99e9de117712ac8b7dee5 | |
| parent | 4c549102e5c1329da17f338f445bfc001e5a51b2 (diff) | |
| download | emacs-659be2587af45dcb1d076d14bdce38e02cf2efd4.tar.gz emacs-659be2587af45dcb1d076d14bdce38e02cf2efd4.zip | |
(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.
| -rw-r--r-- | lisp/international/mule-cmds.el | 46 |
1 files changed, 24 insertions, 22 deletions
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." | |||
| 930 | (append default-coding-system | 930 | (append default-coding-system |
| 931 | (list (cons buffer-file-coding-system base))))))) | 931 | (list (cons buffer-file-coding-system base))))))) |
| 932 | 932 | ||
| 933 | ;; If default-buffer-file-coding-system is not nil nor undecided, | 933 | (unless (and buffer-file-coding-system-explicit |
| 934 | ;; append it to the defaults. | 934 | (cdr buffer-file-coding-system-explicit)) |
| 935 | (if default-buffer-file-coding-system | 935 | ;; If default-buffer-file-coding-system is not nil nor undecided, |
| 936 | (let ((base (coding-system-base default-buffer-file-coding-system))) | 936 | ;; append it to the defaults. |
| 937 | (or (eq base 'undecided) | 937 | (if default-buffer-file-coding-system |
| 938 | (rassq base default-coding-system) | 938 | (let ((base (coding-system-base default-buffer-file-coding-system))) |
| 939 | (setq default-coding-system | 939 | (or (eq base 'undecided) |
| 940 | (append default-coding-system | 940 | (rassq base default-coding-system) |
| 941 | (list (cons default-buffer-file-coding-system | 941 | (setq default-coding-system |
| 942 | base))))))) | 942 | (append default-coding-system |
| 943 | 943 | (list (cons default-buffer-file-coding-system | |
| 944 | ;; If the most preferred coding system has the property mime-charset, | 944 | base))))))) |
| 945 | ;; append it to the defaults. | 945 | |
| 946 | (let ((preferred (coding-system-priority-list t)) | 946 | ;; If the most preferred coding system has the property mime-charset, |
| 947 | base) | 947 | ;; append it to the defaults. |
| 948 | (and (coding-system-p preferred) | 948 | (let ((preferred (coding-system-priority-list t)) |
| 949 | (setq base (coding-system-base preferred)) | 949 | base) |
| 950 | (coding-system-get preferred :mime-charset) | 950 | (and (coding-system-p preferred) |
| 951 | (not (rassq base default-coding-system)) | 951 | (setq base (coding-system-base preferred)) |
| 952 | (setq default-coding-system | 952 | (coding-system-get preferred :mime-charset) |
| 953 | (append default-coding-system | 953 | (not (rassq base default-coding-system)) |
| 954 | (list (cons preferred base))))))) | 954 | (setq default-coding-system |
| 955 | (append default-coding-system | ||
| 956 | (list (cons preferred base)))))))) | ||
| 955 | 957 | ||
| 956 | (if select-safe-coding-system-accept-default-p | 958 | (if select-safe-coding-system-accept-default-p |
| 957 | (setq accept-default-p select-safe-coding-system-accept-default-p)) | 959 | (setq accept-default-p select-safe-coding-system-accept-default-p)) |