CODE: An EMACS/MH hack you'll never care about

I'm the only person I know in the whole world who still uses command-line MH with emacs to compose MH messages. (Several come close, but none exactly that.) This is the sad story of my latest fight with this ancient albatross...

One of the most annoying things about MH is the MIME handling. It's soo close to being beautiful, but just misses. This, for example, is what you have to stick in your email message to send an Open Office document named foo.sxi as an attachment to your email:

 #application/vnd.vnd.sun.xml.impress; name="foo.sxi" \
  /home/bart/foo.sxi

Now you do a little dance with MH "whatnow" and you're set. But what an error-prone typing nightmare! OK, here's my 15-minute solution, after years of whining about the problem. Comes pretty close IMHO!

First, cobble together some emacs lisp code (attached) that will let you hit \C-c\C-a in emacs MH message editing mode, prompt you for the file to be attached, invoke a shell script with the filename to get it expanded to the right mystic nonsense, and then insert that nonsense into the buffer.

Then, write the shell script (attached) that does the expansion, by grubbing through /etc/mime.types.

I'm not sure whether I'm cool, or the world's biggest idiotdweeb, but I'm sure enjoying my new toy.