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

Re: Adding multiple attachments



At Sat, 16 Oct 2010 08:20:56 +0200,
Harald Judt wrote:
>
> Hi,
>
> 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.
>
> A long time ago, someone posted this function somewhere:
>
> (defun mime-edit-insert-multiple-files (name)
>    "Function to insert multiple files, e.g. `~/images/*.jpg'"
>    (let (file-list)
>      (setq file-list (file-expand-wildcards name))
>      (while (car file-list)
>        (mime-edit-insert-file (car file-list))
>        (setq file-list (cdr file-list)))))
>
> I hope this helps.

It would be nice to prompt the user for multiple files, & easily
enough done:

  (defun mime-edit-insert-multiple-files ()
    "Insert MIME parts from multiple files."
    (interactive)
    (catch 'done
      (while t
        (let ((next-file (expand-file-name
                          (read-file-name "Insert file as MIME message: "))))
          (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 "Insert another? "))
            (throw 'done nil)))))

Maybe something like this could be in SEMI?

best, Erik

Attachment: pgpWIaVCiVcaW.pgp
Description: PGP signature