summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatsumi Yamaoka <yamaoka@jpl.org>2013-08-06 13:52:59 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2013-08-06 13:52:59 +0000
commita6933dccd7ac7f5dcae6fe590b3fea68bad7f767 (patch)
tree7a219d80fb24fc3efd084f89410d7bea3dab2bb3
parent024b38fc4d3e1e09871109f428d80d37166ae032 (diff)
downloademacs-a6933dccd7ac7f5dcae6fe590b3fea68bad7f767.tar.gz
emacs-a6933dccd7ac7f5dcae6fe590b3fea68bad7f767.tar.bz2
emacs-a6933dccd7ac7f5dcae6fe590b3fea68bad7f767.zip
lisp/gnus/mm-decode.el (mm-display-external): Work for xdg-open
-rw-r--r--lisp/gnus/ChangeLog7
-rw-r--r--lisp/gnus/mm-decode.el15
2 files changed, 15 insertions, 7 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 2ae70791c16..238017e25fc 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,10 @@
+2013-08-06 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * mm-decode.el (mm-display-external): Bind process-connection-type to
+ nil; don't delete a temp file immediately even if a viewer finishes,
+ since it may be a shell script, like xdg-open, that launches a real
+ viewer program belatedly.
+
2013-08-05 Dave Abrahams <dave@boostpro.com>
* gnus-int.el (gnus-warp-to-article): Allow warping in all groups so
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 7274708f014..98d854340ee 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -962,7 +962,7 @@ external if displayed external."
(let ((command (mm-mailcap-command
method file (mm-handle-type handle))))
(unwind-protect
- (progn
+ (let ((process-connection-type nil))
(start-process "*display*"
(setq buffer
(generate-new-buffer " *mm*"))
@@ -984,12 +984,13 @@ external if displayed external."
(delete-directory (file-name-directory file)))))
(lambda (process state)
(when (eq (process-status process) 'exit)
- (condition-case nil
- (delete-file file)
- (error))
- (condition-case nil
- (delete-directory (file-name-directory file))
- (error))
+ (run-at-time
+ 10.0 nil
+ (lambda ()
+ (ignore-errors
+ (delete-file file))
+ (ignore-errors
+ (delete-directory (file-name-directory file)))))
(when (buffer-live-p outbuf)
(with-current-buffer outbuf
(let ((buffer-read-only nil)