From 050afd6435efc2403cfa574b53475aba30b43054 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 13 Feb 2003 20:06:36 +0000 Subject: [PATCH] (sort-coding-systems): Use \'. (select-safe-coding-system): Remove redundant assq check. Remove raw-text, emacs-mule and no-conversion from the list of proposed encodings unless there's nothing else. --- lisp/international/mule-cmds.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index ffa3840801d..92df9fcb4c0 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -439,7 +439,7 @@ non-nil, it is used to sort CODINGS in the different way than above." (t 32)) 0)) (if (memq base lang-preferred) 8 0) - (if (string-match "-with-esc$" (symbol-name base)) + (if (string-match "-with-esc\\'" (symbol-name base)) 0 4) (if (eq (coding-system-type base) 2) ;; For ISO based coding systems, prefer @@ -658,7 +658,6 @@ and TO is ignored." (if buffer-file-coding-system (let ((base (coding-system-base buffer-file-coding-system))) (or (eq base 'undecided) - (assq buffer-file-coding-system default-coding-system) (rassq base default-coding-system) (setq default-coding-system (append default-coding-system @@ -674,7 +673,6 @@ and TO is ignored." (and (coding-system-p preferred) (setq base (coding-system-base preferred)) (coding-system-get preferred 'mime-charset) - (not (assq preferred default-coding-system)) (not (rassq base default-coding-system)) (setq default-coding-system (append default-coding-system @@ -749,6 +747,14 @@ and TO is ignored." (coding-system-category elt))) (push elt l)))) + ;; Remove raw-text, emacs-mule and no-conversion unless nothing + ;; else is available. + (setq codings + (or (delq 'raw-text + (delq 'emacs-mule + (delq 'no-conversion codings))) + '(raw-text emacs-mule no-conversion))) + (let ((window-configuration (current-window-configuration))) (save-excursion ;; If some defaults are unsafe, make sure the offending -- 2.39.2