[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/gnus/mm-decode.el
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/gnus/mm-decode.el |
Date: |
Fri, 09 Dec 2005 03:58:00 -0500 |
Index: emacs/lisp/gnus/mm-decode.el
diff -c emacs/lisp/gnus/mm-decode.el:1.28 emacs/lisp/gnus/mm-decode.el:1.29
*** emacs/lisp/gnus/mm-decode.el:1.28 Sat Oct 1 04:00:50 2005
--- emacs/lisp/gnus/mm-decode.el Fri Dec 9 08:57:57 2005
***************
*** 335,342 ****
somewhat unwanted, then the value of this variable should be set
to:
! (\"text/html\" \"text/richtext\")"
! :type '(repeat string)
:group 'mime-display)
(defcustom mm-tmp-directory
--- 335,345 ----
somewhat unwanted, then the value of this variable should be set
to:
! (\"text/html\" \"text/richtext\")
!
! Adding \"image/.*\" might also be useful. Spammers use it as the
! prefered part of multipart/alternative messages."
! :type '(repeat regexp) ;; See `mm-preferred-alternative-precedence'.
:group 'mime-display)
(defcustom mm-tmp-directory
***************
*** 761,767 ****
(gnus-map-function mm-file-name-rewrite-functions
(file-name-nondirectory filename))
dir))
! (setq file (mm-make-temp-file (expand-file-name "mm." dir))))
(let ((coding-system-for-write mm-binary-coding-system))
(write-region (point-min) (point-max) file nil 'nomesg))
(message "Viewing with %s" method)
--- 764,782 ----
(gnus-map-function mm-file-name-rewrite-functions
(file-name-nondirectory filename))
dir))
! (setq file (mm-make-temp-file (expand-file-name "mm." dir)))
! (let ((newname
! ;; Use nametemplate (defined in RFC1524) if it is
! ;; specified in mailcap.
! (if (assoc "nametemplate" mime-info)
! (format (assoc "nametemplate" mime-info) file)
! ;; Add a suffix according to `mailcap-mime-extensions'.
! (concat file (car (rassoc (mm-handle-media-type handle)
! mailcap-mime-extensions))))))
! (unless (string-equal file newname)
! (when (file-exists-p file)
! (rename-file file newname))
! (setq file newname))))
(let ((coding-system-for-write mm-binary-coding-system))
(write-region (point-min) (point-max) file nil 'nomesg))
(message "Viewing with %s" method)
***************
*** 819,824 ****
--- 834,842 ----
(ignore-errors (kill-buffer buffer))))))
'inline)
(t
+ ;; Deleting the temp file should be postponed for some wrappers,
+ ;; shell scripts, and so on, which might exit right after having
+ ;; started a viewer command as a background job.
(let ((command (mm-mailcap-command
method file (mm-handle-type handle))))
(unwind-protect
***************
*** 830,853 ****
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))
--- 848,885 ----
shell-command-switch command)
(set-process-sentinel
(get-buffer-process buffer)
! (lexical-let ;; Don't use `let'.
! ;; Function used to remove temp file and directory.
! ((fn `(lambda nil
! ;; Don't use `ignore-errors'.
! (condition-case nil
! (delete-file ,file)
! (error))
! (condition-case nil
! (delete-directory
! ,(file-name-directory file))
! (error))))
! ;; Form uses to kill the process buffer and
! ;; remove the undisplayer.
! (fm `(progn
! (kill-buffer ,buffer)
! ,(macroexpand
! (list 'mm-handle-set-undisplayer
! (list 'quote handle)
! nil))))
! ;; Message to be issued when the process exits.
! (done (format "Displaying %s...done" command))
! ;; In particular, the timer object (which is
! ;; a vector in Emacs but is a list in XEmacs)
! ;; requires that it is lexically scoped.
! (timer (run-at-time 2.0 nil 'ignore)))
! (lambda (process state)
! (when (eq 'exit (process-status process))
! (if (memq timer timer-list)
! (timer-set-function timer fn)
! (funcall fn))
! (ignore-errors (eval fm))
! (message "%s" done))))))
(mm-handle-set-external-undisplayer
handle (cons file buffer)))
(message "Displaying %s..." command))
- [Emacs-diffs] Changes to emacs/lisp/gnus/mm-decode.el,
Miles Bader <=