From: yamaoka Date: Sat, 12 Feb 2005 02:12:27 +0000 (+0000) Subject: Synch to No Gnus 200502120211. X-Git-Tag: t-gnus-6_17_4-quimby-~563 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f702159a4d7cb8471a17884108880aa8d7961728;p=elisp%2Fgnus.git- Synch to No Gnus 200502120211. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8332d24..4e48d3c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,12 @@ 2005-02-12 Katsumi Yamaoka + * gnus-art.el (gnus-mime-copy-part): Don't decode compressed parts. + * mm-util.el (mm-coding-system-to-mime-charset): Make it work with non-Mule XEmacs as well. + (mm-decompress-buffer): Signal an error intentionally if it does + not decompress compressed data because auto-compression-mode is + disabled. 2005-02-11 Teodor Zlatanov diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 0878c59..0fe3be3 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -4606,19 +4606,24 @@ are decompressed." (unless handle (setq handle (get-text-property (point) 'gnus-data))) (when handle - (let* ((filename (or (mail-content-type-get (mm-handle-disposition handle) - 'name) - (mail-content-type-get (mm-handle-disposition handle) - 'filename))) - (contents (mm-with-unibyte-buffer - (mm-insert-part handle) - (or (mm-decompress-buffer filename) + (let ((filename (or (mail-content-type-get (mm-handle-disposition handle) + 'name) + (mail-content-type-get (mm-handle-disposition handle) + 'filename))) + contents dont-decode charset coding-system) + (mm-with-unibyte-buffer + (mm-insert-part handle) + (setq contents (or (condition-case nil + (mm-decompress-buffer filename nil 'sig) + (error + (setq dont-decode t) + nil)) (buffer-string)))) - charset coding-system) - (setq filename (if filename - (file-name-nondirectory filename) - "*decoded*")) + (setq filename (cond (filename (file-name-nondirectory filename)) + (dont-decode "*raw data*") + (t "*decoded*"))) (cond + (dont-decode) ((not arg) (unless (setq charset (mail-content-type-get (mm-handle-type handle) 'charset)) diff --git a/lisp/mm-util.el b/lisp/mm-util.el index d21d0ed..23861ee 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -960,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)) @@ -972,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..."