Function: mm-inline-text-html-render-with-w3m-standalone
mm-inline-text-html-render-with-w3m-standalone is a byte-compiled
function defined in mm-view.el.gz.
Signature
(mm-inline-text-html-render-with-w3m-standalone HANDLE)
Documentation
Render a text/html part using w3m.
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/mm-view.el.gz
(defun mm-inline-text-html-render-with-w3m-standalone (handle)
"Render a text/html part using w3m."
(if (mm-w3m-standalone-supports-m17n-p)
(let ((source (mm-get-part handle))
(charset (or (mail-content-type-get (mm-handle-type handle)
'charset)
(symbol-name mail-parse-charset)))
cs)
(if (and charset
(setq cs (mm-charset-to-coding-system charset nil t))
(not (eq cs 'ascii)))
(setq charset (format "%s" (mm-coding-system-to-mime-charset cs)))
;; The default.
(setq charset "iso-8859-1"
cs 'iso-8859-1))
(mm-insert-inline
handle
(mm-with-unibyte-buffer
(insert source)
(mm-enable-multibyte)
(let ((coding-system-for-write 'binary)
(coding-system-for-read cs))
(call-process-region
(point-min) (point-max)
"w3m" t t nil "-dump" "-T" "text/html"
"-I" charset "-O" charset))
(buffer-string))))
(mm-inline-render-with-stdin handle nil "w3m" "-dump" "-T" "text/html")))