[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Writing a custom treater for HTML articles
From: |
Sean McAfee |
Subject: |
Writing a custom treater for HTML articles |
Date: |
Wed, 08 Dec 2010 15:46:48 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
As I noted in an earlier article, choosing w3m for mm-text-html-renderer
takes a very long time on large messages, while w3m-standalone is much
faster, but produces plainer output. I tried to write a function that
dispatches to one or the other based on the size of the message, but so
far without success. Here was my effort:
(defun render-html-appropriately ()
(if (< (buffer-size) 50000)
(gnus-article-wash-html-with-w3m)
(gnus-article-wash-html-with-w3m-standalone)))
When I viewed an HTML message, I got this error:
mm-inline-text-html: Wrong number of arguments: (...), 1
So apparently an argument is expected, but I can't tell what it is;
mm-inline-text-html is not documented. I rewrote my function:
(defun render-html-appropriately (&rest args)
(insert (format "%s" args)))
Now this gets inserted into the message buffer:
(( *mm*<3> (text/html) nil nil nil nil nil nil))
Not very helpful.
What's the right way to write a renderer? The docs suggest to me that
the rendering function would simply be called without arguments in the
buffer to be treated, but apparently it's more complicated than that.
- Writing a custom treater for HTML articles,
Sean McAfee <=