From f702159a4d7cb8471a17884108880aa8d7961728 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Sat, 12 Feb 2005 02:12:27 +0000 Subject: [PATCH] Synch to No Gnus 200502120211. --- lisp/ChangeLog | 5 +++++ lisp/gnus-art.el | 27 ++++++++++++++++----------- lisp/mm-util.el | 15 ++++++++++----- 3 files changed, 31 insertions(+), 16 deletions(-) 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..." -- 1.7.10.4