[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding multiple attachments



At Sat, 16 Oct 2010 00:43:30 -0700,
Erik Hetzner wrote:
> 
> > On Fri, 15 Oct 2010 09:02:25 +0200 Jonathan Groll wrote:
> > > Using Wanderlust, how can one add multiple attachments to an email
> > > painlessly?
> > >
> > > Up until now I've been using C-c C-x TAB (mime-edit-insert-file), but
> > > doing this multiple times and re-entering the file path multiple times
> > > is highly inefficient.

Hi,

I realized what I posted last night doesn’t help too much.  Here is
one that remembers the directory you used last.

Also, if you turn on ido-everywhere:

  M-x ido-everywhere

You get an ido read-file-name, which might be faster.

Hope that helps.

best, Erik

(defun mime-edit-insert-multiple-files ()
  "Insert MIME parts from multiple files."
  (interactive)
  (let ((dir default-directory))
    (catch 'done
      (while t
        (let ((next-file (expand-file-name
                          (read-file-name "Insert file as MIME message: " dir))))
          (setq dir (file-name-directory next-file))
          (if (and (file-exists-p next-file)
                   (file-regular-p next-file))
              (mime-edit-insert-file next-file t)
            (throw 'done nil))
          (if (not (y-or-n-p "Attach another? ")) 
              (throw 'done nil)))))))

Sent from my free software system <http://fsf.org/>.

Attachment: pgp88ygrqRNJ8.pgp
Description: PGP signature