Re: problems reading mail with mime parts

John Covici <[email protected]> Fri, 29 Nov 2019 01:56:51 -0500
Newsgroups gmane.mail.wanderlust.general.japanese
Organization Covici Computer Systems
Message-ID <[email protected]>
OK. That is great and I shall try it.

On Thu, 28 Nov 2019 15:56:59 -0500,
Greg Bognar wrote:
> 
> > Thanks a lot for that.  Where would I put the key definition to invoke
> > this function?
> 
> You could put something like
> 
> (define-key wl-summary-mode-map "hr" 'render-raw-html-body)
> 
> in your wl-init-file.  (I chose the keys h and r since most keys are already
> taken in wl-summary-mode-map.)
> 
> > Also, there is some text before the html tag, doe shr ignore such text?
> 
> It displays the headers that are visible in the message buffer.  That should be
> fine.  Try it and you'll see.
> 
> > On Wed, 27 Nov 2019 21:47:14 -0500,
> > Greg Bognar wrote:
> > > 
> > > > I would like to do automatically what I have been doing manually, i.e. mark
> > > > the region and do shr-render-region, along with disabling read only mode if
> > > > that is necessary.  Is there a hook where I can put that?
> > > 
> > > As Kazuhiro said, when there is no Content-Type header, the content is treated
> > > as text/plain part.  You would have to tell WL the difference between a message
> > > body that is html and one that is plain text.  My guess is that then you would
> > > use wl-message-buffer-created-hook and wl-message-redisplay-hook.  See also
> > > https://www.emacswiki.org/emacs/WlHooks.
> > > 
> > > Wouldn't it be easier to write a function that renders the message buffer and
> > > bind it to a key in wl-summary-mode-map?  That way, when the cursor is on a
> > > message in the summary window that has only html text, you could display it with
> > > a keypress.
> > > 
> > > You don't need to select a region and disable read-only-mode.  You could use
> > > shr-render-buffer instead.  I'm no elisp expert, but this seems to work on a
> > > test message:
> > > 
> > > (defun render-raw-html-body ()
> > >   (interactive)
> > >   (let ((cur-buf (current-buffer)))
> > >     (wl-summary-toggle-disp-msg 'on)
> > >     (when (wl-summary-set-message-buffer-or-redisplay 'ignore-original)
> > >       (shr-render-buffer (current-buffer))
> > >       (set-buffer cur-buf))))
> 

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

         John Covici wb2una
         [email protected]