Discussion:
Ido and Wanderlust
Greg Bognar
2018-12-05 22:33:49 UTC
Permalink
Hi,

I use Wanderlust (https://github.com/wanderlust/wanderlust) for email. It
depends on SEMI (https://github.com/wanderlust/semi) to provide MIME features,
one of which is the mime-save-content function to save attachments (defined in
mime-play.el, line 263,
https://github.com/wanderlust/semi/blob/semi-1_14-wl/mime-play.el).

I also use ido. But when I enable ido.el with

(ido-everywhere)

mime-save-content stops working. It wants to save the attachment with the file
name that's on top of the completion list (prompting to overwrite it) and the
default name (ie, the name of the attached file) does not get inserted.

An alternative is to use Wanderlust's own wl-mime-save-content (defined in
wl-mime.el, line 894,
https://github.com/wanderlust/wanderlust/blob/master/wl/wl-mime.el), which
beings by inserting the attachment's file name into its own prompt, but if you
want to change the directory it switches to the ido prompt with the same result
as above. The only solution in both cases is to exit the ido prompt with C-f.

Both functions use ido-read-file-name for read-file-name as ido sets
read-file-name-function. I'm wondering what it is about ido-read-file-name that
causes this behavior.

Thanks,
Greg
Óscar Fuentes
2018-12-06 02:54:15 UTC
Permalink
Post by Greg Bognar
I use Wanderlust (https://github.com/wanderlust/wanderlust) for email. It
depends on SEMI (https://github.com/wanderlust/semi) to provide MIME features,
one of which is the mime-save-content function to save attachments (defined in
mime-play.el, line 263,
https://github.com/wanderlust/semi/blob/semi-1_14-wl/mime-play.el).
I also use ido. But when I enable ido.el with
(ido-everywhere)
mime-save-content stops working. It wants to save the attachment with the file
name that's on top of the completion list (prompting to overwrite it) and the
default name (ie, the name of the attached file) does not get inserted.
I see this behavior in other prompts. The solution is to use C-j, which
tells Ido to accept wathever is written on the prompt instead of the
proposed completion.
Greg Bognar
2018-12-06 08:54:19 UTC
Permalink
I don't see how C-j is a solution. C-j won't insert by default the attachment's
file name, so you end up having to type it after the directory (or type a
different file name). That's very inconvenient.

Dropping back to the default prompt with C-f solves this problem -- it
"remembers" the attachment's file name so you can save it to the directory of
your choice.

But shouldn't this be considered a bug with ido, especially if it has the same
problem in other prompts? After all, the default read-file-name *can* handle
the situation, while ido cannot. Given that ido is advertised as a "drop-in
replacement" for read-file-name, it should provide the same functionality, one
would think.
Post by Óscar Fuentes
Post by Greg Bognar
I use Wanderlust (https://github.com/wanderlust/wanderlust) for email. It
depends on SEMI (https://github.com/wanderlust/semi) to provide MIME features,
one of which is the mime-save-content function to save attachments (defined in
mime-play.el, line 263,
https://github.com/wanderlust/semi/blob/semi-1_14-wl/mime-play.el).
I also use ido. But when I enable ido.el with
(ido-everywhere)
mime-save-content stops working. It wants to save the attachment with the file
name that's on top of the completion list (prompting to overwrite it) and the
default name (ie, the name of the attached file) does not get inserted.
I see this behavior in other prompts. The solution is to use C-j, which
tells Ido to accept wathever is written on the prompt instead of the
proposed completion.
Óscar Fuentes
2018-12-06 16:42:27 UTC
Permalink
Post by Greg Bognar
I don't see how C-j is a solution. C-j won't insert by default the attachment's
file name, so you end up having to type it after the directory (or type a
different file name). That's very inconvenient.
Have you tried it?
Greg Bognar
2018-12-06 22:03:27 UTC
Permalink
Post by Óscar Fuentes
Post by Greg Bognar
I don't see how C-j is a solution. C-j won't insert by default the attachment's
file name, so you end up having to type it after the directory (or type a
different file name). That's very inconvenient.
Have you tried it?
Yes, but I did get myself confused. It turns out C-j does not work with
wl-mime-save-content at all, but it does work with mime-save-content.

(Wanderlust remembers which one you initially chose in an Emacs session, so in
order to test the other function, Emacs needs to be restarted each time. I
probably lost track which function I was testing.)

I'm not sure what is responsible for the difference between wl-mime-save-content
and mime-save-content in this regard. I guess I can just use the latter, then.
Thanks!

Loading...