Function: sanitize-coding-system-list

sanitize-coding-system-list is a byte-compiled function defined in mule-cmds.el.gz.

Signature

(sanitize-coding-system-list CODINGS)

Documentation

Return a list of coding systems presumably more user-friendly than CODINGS.

Source Code

;; Defined in /usr/src/emacs/lisp/international/mule-cmds.el.gz
(defun sanitize-coding-system-list (codings)
  "Return a list of coding systems presumably more user-friendly than CODINGS."
  ;; Change each safe coding system to the corresponding
  ;; mime-charset name if it is also a coding system.  Such a name
  ;; is more friendly to users.
  (setq codings
        (mapcar (lambda (cs)
                  (let ((mime-charset (coding-system-get cs 'mime-charset)))
                    (if (and mime-charset (coding-system-p mime-charset)
                             (coding-system-equal cs mime-charset))
                        mime-charset cs)))
                codings))

  ;; Don't offer variations with locking shift, which you
  ;; basically never want.
  (let (l)
    (dolist (elt codings (setq codings (nreverse l)))
      (unless (or (eq 'coding-category-iso-7-else
		      (coding-system-category elt))
		  (eq 'coding-category-iso-8-else
		      (coding-system-category elt)))
	(push elt l))))

  ;; Remove raw-text, emacs-mule and no-conversion unless nothing
  ;; else is available.
  (or (delq 'raw-text
            (delq 'emacs-mule
                  (delq 'no-conversion (copy-sequence codings))))
      codings))