--- mm-util.el 1999/07/10 22:52:26 1.1 +++ mm-util.el 1999/07/10 23:11:50 @@ -24,19 +24,6 @@ ;;; Code: -(defconst mm-running-xemacs (string-match "XEmacs" emacs-version)) - -(defconst mm-binary-coding-system - (if mm-running-xemacs - 'binary 'no-conversion) - "100% binary coding system.") - -(defconst mm-text-coding-system - (and (fboundp 'coding-system-list) - (if (memq system-type '(windows-nt ms-dos ms-windows)) - 'raw-text-dos 'raw-text)) - "Text-safe coding system (For removing ^M).") - (defvar mm-mime-mule-charset-alist '((us-ascii ascii) (iso-8859-1 latin-iso8859-1) @@ -118,16 +105,34 @@ (x-ctext . ctext)) "A mapping from invalid charset names to the real charset names.") -(defconst mm-auto-save-coding-system +(defun mm-coding-system-p (sym) + "Return non-nil if SYM is a coding system." + (or (and (fboundp 'coding-system-p) (coding-system-p sym)) + (memq sym (mm-get-coding-system-list)))) + +(defvar mm-binary-coding-system (cond - ((memq 'emacs-mule (mm-get-coding-system-list)) - (if (memq system-type '(windows-nt ms-dos ms-windows)) - 'emacs-mule-dos 'emacs-mule)) - ((memq 'escape-quoted (mm-get-coding-system-list)) - 'escape-quoted) - ((memq 'no-conversion (mm-get-coding-system-list)) - 'no-conversion) + ((mm-coding-system-p 'no-conversion) 'no-conversion) + ((mm-coding-system-p 'binary) 'binary) (t nil)) + "100% binary coding system.") + +(defvar mm-text-coding-system + (or (if (memq system-type '(windows-nt ms-dos ms-windows)) + (and (mm-coding-system-p 'raw-text-dos) 'raw-text-dos) + (and (mm-coding-system-p 'raw-text) 'raw-text)) + mm-binary-coding-system) + "Text-safe coding system (For removing ^M).") + +(defvar mm-auto-save-coding-system + (cond + ((mm-coding-system-p 'emacs-mule) + (if (memq system-type '(windows-nt ms-dos ms-windows)) + (if (mm-coding-system-p 'emacs-mule-dos) + 'emacs-mule-dos mm-binary-coding-system) + 'emacs-mule)) + ((mm-coding-system-p 'escape-quoted) 'escape-quoted) + (t mm-binary-coding-system)) "Coding system of auto save file.") ;;; Internal variables: