summaryrefslogtreecommitdiff
path: root/lisp/gnus/mm-decode.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2006-02-17 00:24:04 +0000
committerMiles Bader <miles@gnu.org>2006-02-17 00:24:04 +0000
commitcf5a5c38c6d1263cbdcf4561b25f5e6988f4c419 (patch)
tree5c1508ea2fce2b511fe7733888ac4ad4d8e1e634 /lisp/gnus/mm-decode.el
parent60b8fb50eefe34d56dbf42de2183ec6d21769379 (diff)
downloademacs-cf5a5c38c6d1263cbdcf4561b25f5e6988f4c419.tar.gz
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-93
Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 30-34) - Merge from emacs--devo--0 - Update from CVS
Diffstat (limited to 'lisp/gnus/mm-decode.el')
-rw-r--r--lisp/gnus/mm-decode.el29
1 files changed, 14 insertions, 15 deletions
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 996c934191c..fa77b7776f0 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -769,19 +769,18 @@ external if displayed external."
(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 (cdr (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))))
+ ;; Use nametemplate (defined in RFC1524) if it is specified
+ ;; in mailcap.
+ (let ((suffix (cdr (assoc "nametemplate" mime-info))))
+ (if (and suffix
+ (string-match "\\`%s\\(\\..+\\)\\'" suffix))
+ (setq suffix (match-string 1 suffix))
+ ;; Otherwise, use a suffix according to
+ ;; `mailcap-mime-extensions'.
+ (setq suffix (car (rassoc (mm-handle-media-type handle)
+ mailcap-mime-extensions))))
+ (setq file (mm-make-temp-file (expand-file-name "mm." dir)
+ nil suffix))))
(let ((coding-system-for-write mm-binary-coding-system))
(write-region (point-min) (point-max) file nil 'nomesg))
(message "Viewing with %s" method)
@@ -1312,8 +1311,8 @@ be determined."
;; out to a file, and then create a file
;; specifier.
(let ((file (mm-make-temp-file
- (expand-file-name "emm.xbm"
- mm-tmp-directory))))
+ (expand-file-name "emm" mm-tmp-directory)
+ nil ".xbm")))
(unwind-protect
(progn
(write-region (point-min) (point-max) file)