Gnus development mailing list
 help / color / mirror / Atom feed
From: Alan Shutko <ats@acm.org>
Subject: Re: Show text/plain part if w3 fails?
Date: Wed, 19 May 2004 21:32:43 -0500	[thread overview]
Message-ID: <871xlf4ylw.fsf@wesley.springies.com> (raw)
In-Reply-To: <m3pt90x9vt.fsf@quimbies.gnus.org> (Lars Magne Ingebrigtsen's message of "Thu, 20 May 2004 01:41:42 +0200")

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Alan Shutko <ats@acm.org> 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 <ats@acm.org> - I am the rocks.
The Force is with Dataman!



  reply	other threads:[~2004-05-20  2:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-19 15:26 Alan Shutko
2004-05-19 23:41 ` Lars Magne Ingebrigtsen
2004-05-20  2:32   ` Alan Shutko [this message]
2004-05-20 16:46     ` 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=871xlf4ylw.fsf@wesley.springies.com \
    --to=ats@acm.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).