Subject: bug#20480: mml-attach-file then just RET gives wrong error message

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 26 Jan 2017 19:10:13 +0100

M9< Dan Jacobson <[email-masked]> writes:

> No big deal, but if one does C-c C-a
> but then just hits return,
> One gets mml-minibuffer-read-file: No such file: ~/News/drafts/drafts/16
> when one should really get "... is a directory".

That's not as easy as you'd think.  `read-file-name':

If DEFAULT-FILENAME is omitted or
nil, then if INITIAL is non-nil, the default is DIR combined with
INITIAL; otherwise, if the current buffer is visiting a file,
that file serves as the default; otherwise, the default is simply
the string inserted into the minibuffer.

Like, WTF.

Hm...  perhaps if I bind buffer-file-name...  Yup, that work.  Fixed on
the trunk now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no