unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* emacs: On getting support for inline images
@ 2010-02-10 20:20 Carl Worth
  2010-02-10 20:54 ` Carl Worth
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Carl Worth @ 2010-02-10 20:20 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 2290 bytes --]

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

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-02-11  8:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-10 20:20 emacs: On getting support for inline images Carl Worth
2010-02-10 20:54 ` Carl Worth
2010-02-10 23:36   ` Michal Sojka
2010-02-11  8:00   ` David Edmondson
2010-02-10 21:10 ` Jesse Rosenthal
2010-02-10 21:53 ` Alexander Botero-Lowry
2010-02-11  3:57 ` micah anderson

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).