diff lisp/gnus/mm-decode.el @ 64693:6bf3cc5c6ab3

Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505 Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 99) - Update from CVS 2005-07-29 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/gnus-art.el (gnus-article-next-page-1): Reduce the number of lines to scroll rather than to stop it. * lisp/gnus/mml.el (mml-generate-default-type): Add doc string. (mml-generate-mime-1): Use mm-default-file-encoding or make it default to application/octet-stream when determining the content type if it is not specified for the part or the mml contents; add a comment about mml-generate-default-type. 2005-07-29 Reiner Steib <Reiner.Steib@gmx.de> * lisp/gnus/mml.el (mml-generate-mime-1): Use mm-default-file-encoding or make it default to application/octet-stream when determining the content type if it is not specified for the external contents. 2005-07-27 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/mm-decode.el (mm-display-external): Delete temp file, directory and buffer immediately if the external process is exited.
author Miles Bader <miles@gnu.org>
date Sun, 31 Jul 2005 00:12:23 +0000
parents 18a818a2ee7c
children fafd692d1e40 edf295560b5a
line wrap: on
line diff
--- a/lisp/gnus/mm-decode.el	Sat Jul 30 19:04:19 2005 +0000
+++ b/lisp/gnus/mm-decode.el	Sun Jul 31 00:12:23 2005 +0000
@@ -817,11 +817,32 @@
 	    (let ((command (mm-mailcap-command
 			    method file (mm-handle-type handle))))
 	      (unwind-protect
-		  (start-process "*display*"
-				 (setq buffer
-				       (generate-new-buffer " *mm*"))
-				 shell-file-name
-				 shell-command-switch command)
+		  (progn
+		    (start-process "*display*"
+				   (setq buffer
+					 (generate-new-buffer " *mm*"))
+				   shell-file-name
+				   shell-command-switch command)
+		    (set-process-sentinel
+		     (get-buffer-process buffer)
+		     `(lambda (process state)
+			(when (eq 'exit (process-status process))
+			  ;; Don't use `ignore-errors'.
+			  (condition-case nil
+			      (delete-file ,file)
+			    (error))
+			  (condition-case nil
+			      (delete-directory ,(file-name-directory file))
+			    (error))
+			  (condition-case nil
+			      (kill-buffer ,buffer)
+			    (error))
+			  (condition-case nil
+			      ,(macroexpand (list 'mm-handle-set-undisplayer
+						  (list 'quote handle)
+						  nil))
+			    (error))
+			  (message "Displaying %s...done" ,command)))))
 		(mm-handle-set-external-undisplayer
 		 handle (cons file buffer)))
 	      (message "Displaying %s..." command))