From: morioka Date: Fri, 15 May 1998 01:38:26 +0000 (+0000) Subject: (mime-mailcap-method-filename-alist): New variable. X-Git-Tag: remi-1_4_0-pre3~2 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b577ba1ead3c3c8f7bef8af317f2e1ce6377fb5;p=elisp%2Fsemi.git (mime-mailcap-method-filename-alist): New variable. (mime-mailcap-method-sentinel): New function. (mime-activate-mailcap-method): Use 'mime-mailcap-method-sentinel. --- diff --git a/mime-play.el b/mime-play.el index 41009ab..ef682d6 100644 --- a/mime-play.el +++ b/mime-play.el @@ -197,6 +197,8 @@ specified, play as it. Default MODE is \"play\"." ;;; @ external decoder ;;; +(defvar mime-mailcap-method-filename-alist nil) + (defun mime-activate-mailcap-method (start end situation) (save-excursion (save-restriction @@ -211,16 +213,28 @@ specified, play as it. Default MODE is \"play\"." end name (cdr (assq 'encoding situation))) (message "External method is starting...") - (let ((command - (mailcap-format-command - method - (cons (cons 'filename name) situation)))) - (start-process command mime-echo-buffer-name - shell-file-name shell-command-switch command) + (let ((process + (let ((command + (mailcap-format-command + method + (cons (cons 'filename name) situation)))) + (start-process command mime-echo-buffer-name + shell-file-name shell-command-switch command) + ))) + (set-alist 'mime-mailcap-method-filename-alist process name) + (set-process-sentinel process 'mime-mailcap-method-sentinel) ) - (mime-show-echo-buffer) + ;;(mime-show-echo-buffer) )))) +(defun mime-mailcap-method-sentinel (process event) + (let ((file (cdr (assq process mime-mailcap-method-filename-alist)))) + (if (file-exists-p file) + (delete-file file) + )) + (remove-alist 'mime-mailcap-method-filename-alist process) + (message (format "%s %s" process event))) + (defun mime-activate-external-method (beg end cal) (save-excursion (save-restriction