Synch to No Gnus 200503230048.
[elisp/gnus.git-] / lisp / mm-util.el
index f5d4be0..0a51090 100644 (file)
@@ -668,7 +668,7 @@ But this is very much a corner case, so don't worry about it."
 
 (defmacro mm-xemacs-find-mime-charset (begin end)
   (when (featurep 'xemacs)
-    `(mm-xemacs-find-mime-charset-1 ,begin ,end)))
+    `(and (featurep 'mule) (mm-xemacs-find-mime-charset-1 ,begin ,end))))
 
 (defun mm-find-mime-charset-region (b e &optional hack-charsets)
   "Return the MIME charsets needed to encode the region between B and E.
@@ -903,7 +903,7 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'."
                 (file-directory-p
                  (setq dir (concat (file-name-directory
                                     (directory-file-name path))
-                                   "etc/" (or package "gnus/")))))
+                                   "etc/images/" (or package "gnus/")))))
        (push dir result))
       (push path result))))
 
@@ -942,8 +942,9 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'."
   "Return the MIME charset corresponding to CODING-SYSTEM.
 To make this function work with XEmacs, the APEL package is required."
   (when coding-system
-    (or (coding-system-get coding-system :mime-charset)
-       (coding-system-get coding-system 'mime-charset)
+    (or (and (fboundp 'coding-system-get)
+            (or (coding-system-get coding-system :mime-charset)
+                (coding-system-get coding-system 'mime-charset)))
        (and (featurep 'xemacs)
             (or (and (fboundp 'coding-system-to-mime-charset)
                      (not (eq (symbol-function 'coding-system-to-mime-charset)
@@ -959,11 +960,13 @@ To make this function work with XEmacs, the APEL package is required."
 
 (defun mm-decompress-buffer (filename &optional inplace force)
   "Decompress buffer's contents, depending on jka-compr.
-Only when FORCE is non-nil or `auto-compression-mode' is enabled and
-FILENAME agrees with `jka-compr-compression-info-list', decompression
-is done.  If INPLACE is nil, return decompressed data or nil without
-modifying the buffer.  Otherwise, replace the buffer's contents with
-the decompressed data.  The buffer's multibyteness must be turned off."
+Only when FORCE is t or `auto-compression-mode' is enabled and FILENAME
+agrees with `jka-compr-compression-info-list', decompression is done.
+Signal an error if FORCE is neither nil nor t and compressed data are
+not decompressed because `auto-compression-mode' is disabled.
+If INPLACE is nil, return decompressed data or nil without modifying
+the buffer.  Otherwise, replace the buffer's contents with the
+decompressed data.  The buffer's multibyteness must be turned off."
   (when (and filename
             (if force
                 (prog1 t (require 'jka-compr))
@@ -971,6 +974,9 @@ the decompressed data.  The buffer's multibyteness must be turned off."
                    (jka-compr-installed-p))))
     (let ((info (jka-compr-get-compression-info filename)))
       (when info
+       (unless (or (memq force (list nil t))
+                   (jka-compr-installed-p))
+         (error ""))
        (let ((prog (jka-compr-info-uncompress-program info))
              (args (jka-compr-info-uncompress-args info))
              (msg (format "%s %s..."