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

Re: Easier w3m integration



> Most of the time, I'm only interested in the text part of an email,
> but occasionally I want to see the HTML without switching to a
> browser.  Right now, for me, that means turning on mime buttons,
> switching to the message pane, locating the right button and doing a
> `M-x mime-preview-toggle-content'.  Is there a way to do this quickly,
> from the Summary pane?

I wrote below code in my ~/.emacs.  This code makes text/html entity to
be displayed when alternate text/plain entity does not exist.

(eval-after-load "mime-view"
  '(progn
     (autoload 'mime-w3m-preview-text/html "mime-w3m")
     (ctree-set-calist-strictly
      'mime-preview-condition
      '((type . text)
	(subtype . html)
	(body . visible)
	(body-presentation-method . mime-w3m-preview-text/html)))
     (set-alist 'mime-view-type-subtype-score-alist
		'(text . html) 3)
     (set-alist 'mime-view-type-subtype-score-alist
		'(text . plain) 4)))


And try below function in summary mode.  By this, text/html entity is
prefered to text/plain.  Take care that text/plain and text/html must
have different score.

(defun wl-summary-exchange-plain-html-score ()
  (interactive)
  (let ((html (assoc '(text . html) mime-view-type-subtype-score-alist))
	(plain (assoc '(text . plain) mime-view-type-subtype-score-alist)))
    (setq mime-view-type-subtype-score-alist
	  (delq html
		(delq plain mime-view-type-subtype-score-alist)))
    (when html (set-alist 'mime-view-type-subtype-score-alist
			  '(text . plain) (cdr html)))
    (when plain (set-alist 'mime-view-type-subtype-score-alist
			   '(text . html) (cdr plain))))
  (wl-message-buffer-cache-clean-up)
  (wl-summary-redisplay))


Another possible (and quick) approach is to change behaviour of
multipart/alternative entity into the same as multipart/mixed.  In
this case, both text/plain and text/html entities would be displayed
(not confirmed).

-- 
Kazuhiro Ito