;; Classify the defaults into safe, rejected, and unsafe.
(dolist (elt default-coding-system)
- (if (or (eq (coding-system-type (car elt)) 'undecided)
- (memq (cdr elt) codings))
+ (if (memq (cdr elt) codings)
+ ;; This is safe. Is it acceptable?
(if (and (functionp accept-default-p)
(not (funcall accept-default-p (cdr elt))))
+ ;; No, not acceptable.
(push (car elt) rejected)
+ ;; Yes, acceptable.
(push (car elt) safe))
+ ;; This is not safe.
(push (car elt) unsafe)))
+ ;; If there are safe ones, the first one is what we want.
(if safe
(setq coding-system (car safe))))