From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/14215 Path: news.gmane.org!not-for-mail From: Sean McAfee Newsgroups: gmane.emacs.gnus.user Subject: Writing a custom treater for HTML articles Date: Thu, 28 Oct 2010 11:56:51 -0700 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1291957112 13445 80.91.229.12 (10 Dec 2010 04:58:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Dec 2010 04:58:32 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Fri Dec 10 05:58:28 2010 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQv3p-0006rB-DS for gegu-info-gnus-english@m.gmane.org; Fri, 10 Dec 2010 05:58:26 +0100 Original-Received: from localhost ([127.0.0.1]:57565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQv0h-0002YC-I4 for gegu-info-gnus-english@m.gmane.org; Thu, 09 Dec 2010 23:55:11 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Thu, 28 Oct 2010 13:56:51 -0500 Original-Newsgroups: gnu.emacs.gnus User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:vZSgUoc+xK46+4+XpHcT22Rg+U4= Original-Lines: 30 Original-X-Trace: sv3-fy9mascPCF8B8f4JoRHDxOd9uVcf25Wlacc5JBSLofM5LgTmm1p91aPiTchXhZXdHNr9KfAWtqHlqTW!xNP4KgbanLBBUMuOdfH97jRNHh9dNEB5FiP8OAaiwcf7wdN2TQqruSjK8+zeXljNFkvIa20f4v3K!KEkSIWhUpMKVyJVtFDMqcdCf Original-X-Complaints-To: www.supernews.com/docs/abuse.html X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2212 Original-Xref: usenet.stanford.edu gnu.emacs.gnus:84889 X-Mailman-Approved-At: Thu, 09 Dec 2010 20:27:53 -0500 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:14215 Archived-At: 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.