Gnus development mailing list
 help / color / mirror / Atom feed
* MIME part - pipe-to-command
@ 2002-08-27 18:41 Trey Jackson
  2002-08-28 11:10 ` Kai Großjohann
  2002-12-29 22:22 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 4+ messages in thread
From: Trey Jackson @ 2002-08-27 18:41 UTC (permalink / raw)


All,

Using Oort Gnus v0.06.

I'm constantly getting ZIPped mime attachments from my outlook
co-workers.  I'm trying to figure out how to save these attachments in
their unzipped format.  e.g. a power point slide sent via Outlook is
automatically compressed and arrives in a .ZIP archive - I'd like to
save it as a powerpoint in one easy move.

I tried using the menu option: pipe-to-command, but the command I type
doesn't actually get run on/with any piped data, or even a buffer with
the contents of the MIME part.  It gets run on a buffer containing the
header of the MIME part.  e.g. for a recent ZIPped .ppt file:

,----------------
| Content-Type: application/octet-stream
| Content-ID: <qkx1y8kb1rn.fsf@dlxw0066.pdx.intel.com>
| Content-Transfer-Encoding: binary
| 
`----------------

I'm not sure how this is supposed to be used to view/extract the mime
part - which happens to be a file named 'RFS_flow_r0.ZIP'.

Any help?

The actual function I tracked the pipe-to-saved-command is:

    mm-pipe-part  (mm-decode.el)

Is this a feature or a bug?
What am I missing here?


tia,

TJ

-- 
Trey Jackson
tjackson@ichips.intel.com

"Rule number one: don't inhale water."
-- Daniel Russell




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MIME part - pipe-to-command
  2002-08-27 18:41 MIME part - pipe-to-command Trey Jackson
@ 2002-08-28 11:10 ` Kai Großjohann
  2002-08-28 16:21   ` Trey Jackson
  2002-12-29 22:22 ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 4+ messages in thread
From: Kai Großjohann @ 2002-08-28 11:10 UTC (permalink / raw)
  Cc: ding

Does it work to use `v' on the MIME button and to then specify
something like

    cd /tmp/foo ; unzip %s

so that the file appears in /tmp/foo?

You could also define an imaginary mime type and put a useful command
in ~/.mailcap.  Then you can use `t' (view as type in the menu) on the
MIME button and specify that mime type.

    trey/zip; nifty-unzip %s

The above line could go in ~/.mailcap and then you can use that type.

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MIME part - pipe-to-command
  2002-08-28 11:10 ` Kai Großjohann
@ 2002-08-28 16:21   ` Trey Jackson
  0 siblings, 0 replies; 4+ messages in thread
From: Trey Jackson @ 2002-08-28 16:21 UTC (permalink / raw)


 >Does it work to use `v' on the MIME button and to then specify
 >something like
 >
 >    cd /tmp/foo ; unzip %s
 >
 >so that the file appears in /tmp/foo?

Yes, that does appear to work.  Thanks.

Is there a way to make the pipe command work?  The command description
sounds like the file contents will be piped through whatever shell
command you enter.  But the code doesn't appear to do that.  Is that a bug?


Before Kai's reply, I ended up adding a new button to
'gnus-mime-button-commands, which basically just did a save-part, then
my unzip command.  But Kai's solution does appear to be cleaner.

,----------------
| (add-hook 'gnus-art-load-hook tj-gnus-add-unzip-button)
| (defun tj-gnus-add-unzip-button ()
|   (nconc gnus-mime-button-commands (copy-sequence '((tj-gnus-mime-part "z" "UnZip thingy")))))
| (defun tj-gnus-mime-part ()
|   "Unzip the MIME part under point."
|   (interactive)
|   (gnus-article-check-buffer)
|   (let ((data (get-text-property (point) 'gnus-data)))
|     (when data
|       (tj-unzip-file (mm-save-part data)))))
| (defun tj-unzip-file (name)
|   "Pipe HANDLE to a process."
|   (let* ((name (string-replace " " "\\ " name))
|          (command (concat "/usr/bin/unzip -f -o -d " (file-name-directory name) " " name " && /bin/rm -f " name "")))
|     (shell-command command)))
`----------------


TJ

-- 
Trey Jackson
tjackson@ichips.intel.com

"Thou shalt not follow the NULL pointer,
 for chaos and madness await thee at its end."
-- #2 of the Ten Commandments for C programmers



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MIME part - pipe-to-command
  2002-08-27 18:41 MIME part - pipe-to-command Trey Jackson
  2002-08-28 11:10 ` Kai Großjohann
@ 2002-12-29 22:22 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 2002-12-29 22:22 UTC (permalink / raw)


Trey Jackson <tjackson@ichips.intel.com> writes:

> I tried using the menu option: pipe-to-command, but the command I type
> doesn't actually get run on/with any piped data, or even a buffer with
> the contents of the MIME part.  It gets run on a buffer containing the
> header of the MIME part.  e.g. for a recent ZIPped .ppt file:
>
> ,----------------
> | Content-Type: application/octet-stream
> | Content-ID: <qkx1y8kb1rn.fsf@dlxw0066.pdx.intel.com>
> | Content-Transfer-Encoding: binary
> | 
> `----------------

That's odd.  I use the `|' command on MIME parts all the time (to
pipe to patch, for instance), and I haven't seen any problems...

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-12-29 22:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-27 18:41 MIME part - pipe-to-command Trey Jackson
2002-08-28 11:10 ` Kai Großjohann
2002-08-28 16:21   ` Trey Jackson
2002-12-29 22:22 ` Lars Magne Ingebrigtsen

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).