From 7b83605019f318002c69dbc87e7080f2186aef02 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 7 Jun 2022 23:06:33 +0300 Subject: [PATCH] mu4e-view: fix naming of temp files --- mu4e/mu4e-view.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index 4854d780..36a46a3a 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -1222,7 +1222,10 @@ otherwise random; the result is placed in a temporary directory with a unique name. Returns the full path for the file created. The directory and file are self-destructed." (let* ((tmpdir (make-temp-file "mu4e-temp-" t)) - (fname (cdr-safe (assoc 'filename (assoc "attachment" (cdr handle))))) + (fname (mm-handle-filename handle)) + (fname (and fname + (gnus-map-function mm-file-name-rewrite-functions + (file-name-nondirectory fname)))) (fname (if fname (concat tmpdir "/" (replace-regexp-in-string "/" "-" fname)) (let ((temporary-file-directory tmpdir))