Relicense "GPLv2 or later" files to "GPLv3 or later".
[gnus] / lisp / mm-util.el
index 13b4f57..148a994 100644 (file)
@@ -9,7 +9,7 @@
 
 ;; 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)