From: Kevin Ryde <user42@zip.com.au>
Subject: Re: gnus-mime-copy-part and jka-compr
Date: Sat, 04 Jan 2003 10:35:05 +1000 [thread overview]
Message-ID: <87el7tg3ba.fsf@zip.com.au> (raw)
In-Reply-To: <m3adihdium.fsf@quimbies.gnus.org> (Lars Magne Ingebrigtsen's message of "Fri, 03 Jan 2003 22:27:45 +0100")
[-- Attachment #1: Type: text/plain, Size: 107 bytes --]
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>
> Can you send me the previous code changes as a diff?
[-- Attachment #2: gnus-art.el.uncompress.diff --]
[-- Type: text/plain, Size: 2366 bytes --]
--- gnus-art.el.~6.265.~ 2003-01-04 10:22:58.000000000 +1000
+++ gnus-art.el 2003-01-04 10:32:28.000000000 +1000
@@ -1,5 +1,5 @@
;;; gnus-art.el --- article mode commands for Gnus
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
;; Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -3907,6 +3907,36 @@ (defun gnus-mime-view-part-as-type (&opt
(mm-merge-handles gnus-article-mime-handles handle))
(gnus-mm-display-part handle))))
+(eval-when-compile
+ (require 'jka-compr))
+
+;; jka-compr.el uses a "sh -c" to direct stderr to err-file, but these days
+;; emacs can do that itself.
+;;
+(defun gnus-mime-jka-compr-maybe-uncompress ()
+ "Uncompress the current buffer if `auto-compression-mode' is enabled.
+The uncompress method used is derived from `buffer-file-name'."
+ (when (and (fboundp 'jka-compr-installed-p)
+ (jka-compr-installed-p))
+ (let ((info (jka-compr-get-compression-info buffer-file-name)))
+ (when info
+ (let ((basename (file-name-nondirectory buffer-file-name))
+ (args (jka-compr-info-uncompress-args info))
+ (prog (jka-compr-info-uncompress-program info))
+ (message (jka-compr-info-uncompress-message info))
+ (err-file (jka-compr-make-temp-name)))
+ (if message
+ (message "%s %s..." message basename))
+ (unwind-protect
+ (unless (memq (apply 'call-process-region
+ (point-min) (point-max)
+ prog
+ t (list t err-file) nil
+ args)
+ jka-compr-acceptable-retval-list)
+ (jka-compr-error prog args basename message err-file))
+ (jka-compr-delete-temp-file err-file)))))))
+
(defun gnus-mime-copy-part (&optional handle)
"Put the MIME part under point into a new buffer."
(interactive)
@@ -3928,6 +3958,7 @@ (defun gnus-mime-copy-part (&optional ha
(unwind-protect
(progn
(setq buffer-file-name (expand-file-name base))
+ (gnus-mime-jka-compr-maybe-uncompress)
(normal-mode))
(setq buffer-file-name nil))
(goto-char (point-min)))))
next prev parent reply other threads:[~2003-01-04 0:35 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-17 22:51 Kevin Ryde
2002-12-28 21:16 ` Lars Magne Ingebrigtsen
2002-12-28 22:12 ` Kai Großjohann
2002-12-28 22:37 ` Lars Magne Ingebrigtsen
2002-12-28 23:03 ` Kai Großjohann
2002-12-28 23:19 ` Lars Magne Ingebrigtsen
2003-01-02 23:02 ` Kevin Ryde
2003-01-02 23:10 ` Lars Magne Ingebrigtsen
2003-01-03 21:19 ` Kevin Ryde
2003-01-03 21:27 ` Lars Magne Ingebrigtsen
2003-01-04 0:35 ` Kevin Ryde [this message]
2003-01-04 0:41 ` Lars Magne Ingebrigtsen
2003-01-15 0:34 ` Kevin Ryde
2003-01-15 1:34 ` New IMAP user with some Q's dave-mlist
2003-01-15 7:14 ` Kai Großjohann
2003-01-15 12:58 ` Simon Josefsson
2003-01-15 20:18 ` gnus-mime-copy-part and jka-compr Lars Magne Ingebrigtsen
2002-12-28 21:17 ` Lars Magne Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87el7tg3ba.fsf@zip.com.au \
--to=user42@zip.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).