[notmuch] emacs: On getting support for inline images

Carl Worth cworth at cworth.org
Wed Feb 10 12:20:00 PST 2010


For a while I've seen that I can very conveniently deal with attachments
such as PDF files or even OpenOffice (or PowerPoint) presentations with
the notmuch/emacs client. I simply hit 'v' and an external viewer comes
up with the attached file. That's all very nice.

But strangely, I've also noticed that attached images don't get the same
treatment.

I investigated a bit and discovered that the images are being rendered
within emacs and inside of a temporary buffer that is being used by the
function invoked by 'v'. Before this function returns, the temporary
buffer including the nicely inline-rendered image is being killed. (And
I suspect the exact same thing is happening with encrypted messages
where hitting 'v' gets emacs to prompt for the passphrase, but then
nothing is displayed to the user.)

I was able to get images working by customizing the
mm-inline-media-tests variable. I removed the image/png clause from the
value, and now when I hit 'v' I get a nice, external image viewer as
configured in /etc/mailcap, etc.

Here are some ideas for possible (and independent) fixes:

1. With the current setup, we know we are using a temporary buffer that
   the user won't see, so notmuch could temporarily set
   mm-inline-media-tests to nil forcing everything to use external
   viewers when the user presses 'v'.

2. The original presentation of Mime parts could examine
   mm-inline-media-tests and directly render anything possible within
   the original presentation of the message. This would allow images to
   be viewed directly without requiring the user to press 'v'. And the
   user could configure this existing variable to control what content
   is displayed inline.

3. We could move away from these various mm- functions for displaying
   MIME parts and simply add functionality to the notmuch command line
   for extracting individual MIME parts from messages, (which is
   something that a non-emacs client will likely want anyway). Then we
   can use the lower-level functions to display things directly. (For
   example, displaying an image looks as simple as calling the
   create-image and put-image functions).

Anyway, there's a lot that can be done here to make the presentation
much more usable. And of course, I'll always be glad for any help!

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20100210/3e96fbae/attachment.pgp>


More information about the notmuch mailing list