From d55ad120d0c93883f5e3c38d005fd81a2d20416c Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Fri, 7 May 2010 07:22:53 +0000 Subject: [PATCH] Patch from Julien Danjou . * gnus-art.el (gnus-mime-pipe-part): Add optional argument `cmd'; pass it to mm-pipe-part. * mm-decode.el (mm-pipe-part): Add optional argument `cmd'; use it if it is given. --- lisp/ChangeLog | 8 ++++++++ lisp/gnus-art.el | 7 ++++--- lisp/mm-decode.el | 13 +++++++------ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0ee07a6a4..1ddb2402a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2010-05-07 Julien Danjou + + * gnus-art.el (gnus-mime-pipe-part): Add optional argument `cmd'; pass + it to mm-pipe-part. + + * mm-decode.el (mm-pipe-part): Add optional argument `cmd'; use it if + it is given. + 2010-05-07 Katsumi Yamaoka * binhex.el (binhex-decode-region-internal) diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 7ce3a4374..5f899b306 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -5041,13 +5041,14 @@ Deleting parts may malfunction or destroy the article; continue? ")) (when data (mm-save-part data)))) -(defun gnus-mime-pipe-part () - "Pipe the MIME part under point to a process." +(defun gnus-mime-pipe-part (&optional cmd) + "Pipe the MIME part under point to a process. +Use CMD as the process." (interactive) (gnus-article-check-buffer) (let ((data (get-text-property (point) 'gnus-data))) (when data - (mm-pipe-part data)))) + (mm-pipe-part data cmd)))) (defun gnus-mime-view-part () "Interactively choose a viewing method for the MIME part under point." diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 171afac31..410b4f045 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -1301,12 +1301,13 @@ text/\\(\\sw+\\)\\(?:\;\\s-*charset=\\(.+\\)\\)?[\"'][^>]*>" nil t) (mm-write-region (point-min) (point-max) file nil nil nil 'binary t) (set-default-file-modes current-file-modes))))) -(defun mm-pipe-part (handle) - "Pipe HANDLE to a process." - (let* ((name (mail-content-type-get (mm-handle-type handle) 'name)) - (command - (gnus-read-shell-command - "Shell command on MIME part: " mm-last-shell-command))) +(defun mm-pipe-part (handle &optional cmd) + "Pipe HANDLE to a process. +Use CMD as the process." + (let ((name (mail-content-type-get (mm-handle-type handle) 'name)) + (command (or cmd + (gnus-read-shell-command + "Shell command on MIME part: " mm-last-shell-command)))) (mm-with-unibyte-buffer (mm-insert-part handle) (mm-add-meta-html-tag handle) -- 2.25.1