wl-mime.el (wl-mime-save-content): Fix incorrect usage of `read-file-name'.
authordmaus <dmaus>
Sun, 12 Feb 2012 13:56:01 +0000 (13:56 +0000)
committerdmaus <dmaus>
Sun, 12 Feb 2012 13:56:01 +0000 (13:56 +0000)
* wl-mime.el (wl-mime-save-content): Fix incorrect usage of
`read-file-name'.

Function signature is

(read-file-name PROMPT &optional DIR DEFAULT-FILENAME MUSTMATCH INITIAL PREDICATE)

Passing the full path to the target file as second argument causes
problems with saving attachments when `ido-mode' is enabled. The
function signature didn't change in 22 and as it seems didn't change
in 21 (guessing from the usage, couldn't compile 21 on x64 system).

wl/ChangeLog
wl/wl-mime.el

index 20e2f2f..0dcbec9 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-12  David Maus  <dmaus@ictsoc.de>
+
+       * wl-mime.el (wl-mime-save-content): Fix incorrect usage of
+       `read-file-name'.
+
 2012-01-01  TAKAHASHI Kaoru  <kaoru@kaisei.org>
 
        * wl-demo.el (wl-demo-copyright-notice): Add 2012.
index 364f426..9d28f8b 100644 (file)
@@ -749,11 +749,12 @@ With ARG, ask destination folder."
 (defun wl-mime-save-content (entity situation)
   (let ((filename (expand-file-name
                   (read-file-name "Save to file: "
-                                  (expand-file-name
-                                   (or (mime-entity-safe-filename entity)
-                                       ".")
-                                   (or wl-mime-save-directory
-                                       wl-temporary-file-directory))))))
+                                  (or wl-mime-save-directory
+                                      wl-temporary-file-directory)
+                                  nil nil
+                                  (or (mime-entity-safe-filename entity)
+                                      ".")
+                                   ))))
     (while (file-directory-p filename)
       (setq filename (read-file-name "Please set filename (not directory): "
                                     filename)))