;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
(if (fboundp (car elem))
(defalias nfunc (car elem))
(defalias nfunc (cdr elem)))))
- '((decode-coding-string . (lambda (s a) s))
- (encode-coding-string . (lambda (s a) s))
- (encode-coding-region . ignore)
- (coding-system-list . ignore)
- (decode-coding-region . ignore)
+ '((coding-system-list . ignore)
(char-int . identity)
(coding-system-equal . equal)
(annotationp . ignore)
(string-match (car elem) buffer-name)
(throw 'return (cdr elem))))))))))))
+(eval-and-compile
+ (if (featurep 'xemacs)
+ (if (featurep 'file-coding)
+ ;; Don't modify string if CODING-SYSTEM is nil.
+ (progn
+ (defun mm-decode-coding-string (str coding-system)
+ (if coding-system
+ (decode-coding-string str coding-system)
+ str))
+ (defun mm-encode-coding-string (str coding-system)
+ (if coding-system
+ (encode-coding-string str coding-system)
+ str))
+ (defun mm-decode-coding-region (start end coding-system)
+ (if coding-system
+ (decode-coding-region start end coding-system)))
+ (defun mm-encode-coding-region (start end coding-system)
+ (if coding-system
+ (encode-coding-region start end coding-system))))
+ (defun mm-decode-coding-string (str coding-system) str)
+ (defun mm-encode-coding-string (str coding-system) str)
+ (defalias 'mm-decode-coding-region 'ignore)
+ (defalias 'mm-encode-coding-region 'ignore))
+ (defalias 'mm-decode-coding-string 'decode-coding-string)
+ (defalias 'mm-encode-coding-string 'encode-coding-string)
+ (defalias 'mm-decode-coding-region 'decode-coding-region)
+ (defalias 'mm-encode-coding-region 'encode-coding-region)))
+
(defalias 'mm-string-to-multibyte
(cond
((featurep 'xemacs)
(mm-coding-system-p cp))
(add-to-list 'mm-charset-synonym-alist (cons alias cp)))))
-(defcustom mm-charset-synonym-alist
+(defvar mm-charset-synonym-alist
`(
;; Not in XEmacs, but it's not a proper MIME charset anyhow.
,@(unless (mm-coding-system-p 'x-ctext)
)
"A mapping from unknown or invalid charset names to the real charset names.
-See `mm-codepage-iso-8859-list' and `mm-codepage-ibm-list'."
- :type '(repeat
- :convert-widget (lambda (widget)
- (apply 'widget-convert (widget-type widget)
- (eval (car (widget-get widget :args)))))
- `((cons :format "%v"
- (symbol :tag "Synonym")
- ,(if (get 'coding-system 'widget-type)
- 'coding-system
- '(symbol :tag "Coding system")))))
- :group 'mime)
+See `mm-codepage-iso-8859-list' and `mm-codepage-ibm-list'.")
(defcustom mm-codepage-iso-8859-list
(list 1250 ;; Windows-1250 is a variant of Latin-2 heavily used by Microsoft