* mime-play.el (mime-mailcap-method-sentinel): Restore deleting
authoryoichi <yoichi>
Sun, 14 Dec 2003 13:49:14 +0000 (13:49 +0000)
committeryoichi <yoichi>
Sun, 14 Dec 2003 13:49:14 +0000 (13:49 +0000)
directory routine and protection of 1st arg of `message' dropped
in the last change.
(mime-mailcap-delete-played-files): Ditto.

ChangeLog
mime-play.el

index 9b6ff0e..469c89d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-12-14  Yoichi NAKAYAMA <yoichi@geiin.org>
+
+       * 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  <ari@mbf.sphere.ne.jp>
 
        * mime-play.el (mime-play-delete-file-immediately): New user option.
index 32283ad..59c8bb6 100644 (file)
@@ -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)