Gnus development mailing list
 help / color / mirror / Atom feed
* Show text/plain part if w3 fails?
@ 2004-05-19 15:26 Alan Shutko
  2004-05-19 23:41 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Shutko @ 2004-05-19 15:26 UTC (permalink / raw)


Occasionally, I'll run across a text/html part which w3 can't
handle, and see the message "Error while rendering html; showing as
text/plain".  Gnus then just displays the html unrendered.

WIBNI Gnus showed the text/plain alternative if one existed?  Has
anyone looked into doing this?  If not, I'll give it a try.

-- 
Alan Shutko <ats@acm.org> - I am the rocks.
I can't always control what my mind thinks!



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Show text/plain part if w3 fails?
  2004-05-19 15:26 Show text/plain part if w3 fails? Alan Shutko
@ 2004-05-19 23:41 ` Lars Magne Ingebrigtsen
  2004-05-20  2:32   ` Alan Shutko
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 2004-05-19 23:41 UTC (permalink / raw)


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...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Show text/plain part if w3 fails?
  2004-05-19 23:41 ` Lars Magne Ingebrigtsen
@ 2004-05-20  2:32   ` Alan Shutko
  2004-05-20 16:46     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Shutko @ 2004-05-20  2:32 UTC (permalink / raw)


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!



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Show text/plain part if w3 fails?
  2004-05-20  2:32   ` Alan Shutko
@ 2004-05-20 16:46     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 2004-05-20 16:46 UTC (permalink / raw)


Alan Shutko <ats@acm.org> writes:

> 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?

not-pref is the next in the list of preferred alternatives, and is
used later in the callback when (manually) switching between
alternatives.

So I think your approach is correct...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-05-20 16:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-19 15:26 Show text/plain part if w3 fails? Alan Shutko
2004-05-19 23:41 ` Lars Magne Ingebrigtsen
2004-05-20  2:32   ` Alan Shutko
2004-05-20 16:46     ` Lars Magne Ingebrigtsen

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).