From fb8989f53376606d580b2cd981bc39ac10358c1a Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 27 Jul 2005 08:28:01 +0000 Subject: [PATCH] Synch to No Gnus 200507270827. --- lisp/ChangeLog | 5 +++++ lisp/mm-decode.el | 31 ++++++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 88c9b62..6c6a3ad 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2005-07-27 Katsumi Yamaoka + + * mm-decode.el (mm-display-external): Delete temp file, directory + and buffer immediately if the external process is exited. + 2005-07-26 Katsumi Yamaoka * gnus-art.el (gnus-article-next-page-1): Don't scroll if there're diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index af6c139..55bed68 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -811,11 +811,32 @@ external if displayed external." (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)) -- 1.7.10.4