From: yoichi Date: Sun, 14 Dec 2003 13:49:14 +0000 (+0000) Subject: * mime-play.el (mime-mailcap-method-sentinel): Restore deleting X-Git-Tag: semi-1_14_6~6 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a737ec4d697ec1f1e6db68fed815669d8cd4bbd;p=elisp%2Fsemi.git * mime-play.el (mime-mailcap-method-sentinel): Restore deleting directory routine and protection of 1st arg of `message' dropped in the last change. (mime-mailcap-delete-played-files): Ditto. --- diff --git a/ChangeLog b/ChangeLog index 9b6ff0e..469c89d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-12-14 Yoichi NAKAYAMA + + * mime-play.el (mime-mailcap-method-sentinel): Restore deleting + directory routine and protection of 1st arg of `message' dropped + in the last change. + (mime-mailcap-delete-played-files): Ditto. + 2003-12-12 ARISAWA Akihiro * mime-play.el (mime-play-delete-file-immediately): New user option. diff --git a/mime-play.el b/mime-play.el index 32283ad..59c8bb6 100644 --- a/mime-play.el +++ b/mime-play.el @@ -157,7 +157,7 @@ specified, play as it. Default MODE is \"play\"." (mime-format-mailcap-command method (cons (cons 'filename name) situation))) - (coding-system-for-read mime-play-messages-coding-system)) + (coding-system-for-read mime-play-messages-coding-system)) (start-process command mime-echo-buffer-name shell-file-name shell-command-switch command)))) (set-alist 'mime-mailcap-method-filename-alist process name) @@ -166,15 +166,19 @@ specified, play as it. Default MODE is \"play\"." (defun mime-mailcap-method-sentinel (process event) (when mime-play-delete-file-immediately (let ((file (cdr (assq process mime-mailcap-method-filename-alist)))) - (if (file-exists-p file) - (delete-file file))) + (when (file-exists-p file) + (ignore-errors + (delete-file file) + (delete-directory (file-name-directory file))))) (remove-alist 'mime-mailcap-method-filename-alist process)) - (message (format "%s %s" process event))) + (message "%s %s" process event)) (defun mime-mailcap-delete-played-files () (dolist (elem mime-mailcap-method-filename-alist) (when (file-exists-p (cdr elem)) - (delete-file (cdr elem))))) + (ignore-errors + (delete-file (cdr elem)) + (delete-directory (file-name-directory (cdr elem))))))) (add-hook 'kill-emacs-hook 'mime-mailcap-delete-played-files)