From: Sean McAfee <eefacm@gmail.com>
To: info-gnus-english@gnu.org
Subject: Writing a custom treater for HTML articles
Date: Thu, 28 Oct 2010 11:56:51 -0700 [thread overview]
Message-ID: <bp8ocae2ljg.fsf@usca1uw-JZWWPM1.sanmateo.corp.akamai.com> (raw)
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.
next reply other threads:[~2010-10-28 18:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-28 18:56 Sean McAfee [this message]
2010-10-29 21:50 ` Lars Magne Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bp8ocae2ljg.fsf@usca1uw-JZWWPM1.sanmateo.corp.akamai.com \
--to=eefacm@gmail.com \
--cc=info-gnus-english@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).