From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/57569 Path: main.gmane.org!not-for-mail From: Alan Shutko Newsgroups: gmane.emacs.gnus.general Subject: Re: Show text/plain part if w3 fails? Date: Wed, 19 May 2004 21:32:43 -0500 Sender: ding-owner@lists.math.uh.edu Message-ID: <871xlf4ylw.fsf@wesley.springies.com> References: <877jv8h1z6.fsf@wesley.springies.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085020439 20725 80.91.224.253 (20 May 2004 02:33:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 May 2004 02:33:59 +0000 (UTC) Original-X-From: ding-owner+M6109@lists.math.uh.edu Thu May 20 04:33:52 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BQdNX-0000Ki-00 for ; Thu, 20 May 2004 04:33:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1BQdNR-0005G9-00; Wed, 19 May 2004 21:33:45 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1BQdNN-0005G4-00 for ding@lists.math.uh.edu; Wed, 19 May 2004 21:33:41 -0500 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1BQdNM-0008Ne-GZ for ding@lists.math.uh.edu; Wed, 19 May 2004 21:33:40 -0500 Original-Received: from simon.springies.com (125-102.bestdsl.net [216.162.125.102]) by justine.libertine.org (Postfix) with ESMTP id 915C13A006A for ; Wed, 19 May 2004 21:33:39 -0500 (CDT) Original-Received: from wesley.springies.com (wesley.springies.com [192.168.1.2]) by simon.springies.com (Postfix) with ESMTP id 7EA763E85 for ; Wed, 19 May 2004 21:33:38 -0500 (CDT) Original-Received: by wesley.springies.com (Postfix, from userid 1000) id F292142942; Wed, 19 May 2004 21:33:37 -0500 (CDT) Original-To: ding@gnus.org In-Reply-To: (Lars Magne Ingebrigtsen's message of "Thu, 20 May 2004 01:41:42 +0200") User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:57569 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:57569 Lars Magne Ingebrigtsen writes: > Alan Shutko writes: > >> WIBNI Gnus showed the text/plain alternative if one existed? Has >> anyone looked into doing this? If not, I'll give it a try. > > I don't recall seeing anybody tackling this, so it would be great if > you would... Well, here's a first cut. But right now, it just displays not-pref, it won't try iterating over all of the possible alternatives. I need to understand how the priorities work with the handles. What _is_ not-pref used for, if we have more than two alternatives? cvs server: Diffing . Index: gnus-art.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v retrieving revision 7.37 diff -u -r7.37 gnus-art.el --- gnus-art.el 18 May 2004 19:17:37 -0000 7.37 +++ gnus-art.el 20 May 2004 02:23:06 -0000 @@ -4788,7 +4788,11 @@ (mail-parse-ignored-charsets (with-current-buffer gnus-summary-buffer gnus-newsgroup-ignored-charsets))) - (mm-display-part preferred) + (condition-case () + (mm-display-part preferred) + (error + (delete-region (car begend) (point-max)) + (mm-display-part not-pref))) ;; Do highlighting. (save-excursion (save-restriction Index: mm-view.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/mm-view.el,v retrieving revision 7.12 diff -u -r7.12 mm-view.el --- mm-view.el 7 May 2004 07:36:52 -0000 7.12 +++ mm-view.el 20 May 2004 02:23:06 -0000 @@ -155,25 +155,7 @@ ;; Don't let w3 set the global version of ;; this variable. (fill-column fill-column)) - (if (or debug-on-error debug-on-quit) - (w3-region (point-min) (point-max)) - (condition-case () - (w3-region (point-min) (point-max)) - (error - (delete-region (point-min) (point-max)) - (let ((b (point)) - (charset (mail-content-type-get - (mm-handle-type handle) 'charset))) - (if (or (eq charset 'gnus-decoded) - (eq mail-parse-charset 'gnus-decoded)) - (save-restriction - (narrow-to-region (point) (point)) - (mm-insert-part handle) - (goto-char (point-max))) - (insert (mm-decode-string (mm-get-part handle) - charset)))) - (message - "Error while rendering html; showing as text/plain"))))))) + (w3-region (point-min) (point-max)))))) (mm-handle-set-undisplayer handle `(lambda () -- Alan Shutko - I am the rocks. The Force is with Dataman!