Gnus development mailing list
 help / color / mirror / Atom feed
* Canonical method for avoiding HTML expansion?
@ 1999-12-07 21:47 Lloyd Zusman
  1999-12-08  3:35 ` Dale Hagglund
  1999-12-08  9:26 ` Hrvoje Niksic
  0 siblings, 2 replies; 6+ messages in thread
From: Lloyd Zusman @ 1999-12-07 21:47 UTC (permalink / raw)


I recently asked something similar to this, but I can't find a
response that specifically addresses this question.  Forgive me if I
missed the appropriate reply ...

I'm using the latest CVS version of Gnus, and I have the following
assignment in my `.gnus.el' ...
 
  (setq mm-discouraged-alternatives 
        '("text/html" 
          "text/richtext")) 

Up until recently (within the last few weeks), this seemed to properly
prevent expansion of HTML when it appears within email and posts.
However, lately Gnus has been expanding the HTML to the max, including
automatic attempts to download images and the like, and it's a real
pain to try to abort this once it begins.

I was told here that the `mm-discouraged-alternatives' variable
controls cases where there is both text and HTML in a message.  I'm
not sure if this is still working the way it's supposed to, but even
if so, there apparently is enough non-perfectly-compliantly-MIME-ized
HTML junk coming to me so that `mm-discouraged-alternatives' gets
frequently ignored.

In any case, I'd like to be able to prevent the automatic expansion of
*all* HTML and only have that done on demand.  Clearly Gnus is able to
determine when there is HTML (or else it wouldn't know to try to
automatically expand it), and so the processing that I'd like to have
happen would go something like this:

(1)  Gnus somehow determines that there is HTML that could be expanded.

(2)  The normal HTML-expansion code gets bypassed and the portion of
     the message that could be expanded gets processed in one of the
     following ways (in order of preference):

     A.  It gets hidden and buttonized so that I would only see
         it if I specifically select the button.

     B.  A quick-and-dirty HTML-tag-removal is done as part of
         something akin to article treatment.

     C.  The HTML just shows up intact as text, with all the tags
         appearing "as is" within the message.

I know that all of these are at least theoretically do-able, but what
I'm looking for are the canonical methods for accomplishing one or
more of these.

A related question is this: within which hook(s) could I put my own
code in order to prevent and intercept the normal HTML expansion?

Thanks in advance.

-- 
 Lloyd Zusman
 ljz@asfast.com



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

* Re: Canonical method for avoiding HTML expansion?
  1999-12-07 21:47 Canonical method for avoiding HTML expansion? Lloyd Zusman
@ 1999-12-08  3:35 ` Dale Hagglund
  1999-12-09 17:00   ` Lloyd Zusman
  1999-12-08  9:26 ` Hrvoje Niksic
  1 sibling, 1 reply; 6+ messages in thread
From: Dale Hagglund @ 1999-12-08  3:35 UTC (permalink / raw)


Lloyd Zusman <ljz@asfast.com> writes:

> I recently asked something similar to this, but I can't find a
> response that specifically addresses this question.  Forgive me if I
> missed the appropriate reply ...

> In any case, I'd like to be able to prevent the automatic expansion of
> *all* HTML and only have that done on demand.  

I added the following to my .gnus file not too long ago.

      (setq mm-inline-media-tests
            (cons '("text/html" nil (lambda (h) nil))
                  mm-inline-media-tests))

After some confusion on my part (because I had accidentally typed a
command that changed some other stuff) this does what I want.

text/html parts are not automatically displayed using w3 or any other
browser; they are given buttons, and the html text is shown inline.
if you click the button twice, gnus starts any text/html viewer
specified in you .mailcap file.

Dale.


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

* Re: Canonical method for avoiding HTML expansion?
  1999-12-07 21:47 Canonical method for avoiding HTML expansion? Lloyd Zusman
  1999-12-08  3:35 ` Dale Hagglund
@ 1999-12-08  9:26 ` Hrvoje Niksic
  1999-12-08 13:12   ` David S. Goldberg
  1 sibling, 1 reply; 6+ messages in thread
From: Hrvoje Niksic @ 1999-12-08  9:26 UTC (permalink / raw)


Lloyd Zusman <ljz@asfast.com> writes:

>   (setq mm-discouraged-alternatives 
>         '("text/html" 
>           "text/richtext"))

This won't help unless there is an actual non-HTML alternative
somewhere.  If you get the message that contains HTML only, Gnus has
no choice but to display it.  mm-discouraged-alternatives seems to
work for me.

I think one way to treat HTML expansion would be to treat all HTML
stuff as attachments (your solution A.)  There's no way to do that in
Gnus currently.  I think.


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

* Re: Canonical method for avoiding HTML expansion?
  1999-12-08  9:26 ` Hrvoje Niksic
@ 1999-12-08 13:12   ` David S. Goldberg
  1999-12-08 15:26     ` Lloyd Zusman
  0 siblings, 1 reply; 6+ messages in thread
From: David S. Goldberg @ 1999-12-08 13:12 UTC (permalink / raw)


> I think one way to treat HTML expansion would be to treat all HTML
> stuff as attachments (your solution A.)  There's no way to do that
> in Gnus currently.  I think.

There is.  Lars applied my patch that created
mm-inline-override-types.  I set it to (list "text/html") and now any
text/html I get is shown as an attachment.
-- 
Dave Goldberg
Post: The Mitre Corporation\MS B325\202 Burlington Rd.\Bedford, MA 01730
Phone: 781-271-3887
Email: dsg@mitre.org


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

* Re: Canonical method for avoiding HTML expansion?
  1999-12-08 13:12   ` David S. Goldberg
@ 1999-12-08 15:26     ` Lloyd Zusman
  0 siblings, 0 replies; 6+ messages in thread
From: Lloyd Zusman @ 1999-12-08 15:26 UTC (permalink / raw)


dsg@mitre.org (David S. Goldberg) writes:

> > I think one way to treat HTML expansion would be to treat all HTML
> > stuff as attachments (your solution A.)  There's no way to do that
> > in Gnus currently.  I think.
> 
> There is.  Lars applied my patch that created
> mm-inline-override-types.  I set it to (list "text/html") and now any
> text/html I get is shown as an attachment.

Yep. that works for me ... now, in my `.gnus.el', I have ...

  (setq mm-inline-override-types
        (setq mm-discouraged-alternatives
	      '("text/html"
	        "text/richtext")))

... and all the HTML indeed gets buttonized per my solution A.

Thanks!

-- 
 Lloyd Zusman
 ljz@asfast.com


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

* Re: Canonical method for avoiding HTML expansion?
  1999-12-08  3:35 ` Dale Hagglund
@ 1999-12-09 17:00   ` Lloyd Zusman
  0 siblings, 0 replies; 6+ messages in thread
From: Lloyd Zusman @ 1999-12-09 17:00 UTC (permalink / raw)


Dale Hagglund <rdh@best.com> writes:

> Lloyd Zusman <ljz@asfast.com> writes:
> 
> > [ ... ]
> >
> > In any case, I'd like to be able to prevent the automatic expansion of
> > *all* HTML and only have that done on demand.  
> 
> I added the following to my .gnus file not too long ago.
> 
>       (setq mm-inline-media-tests
>             (cons '("text/html" nil (lambda (h) nil))
>                   mm-inline-media-tests))
> 
> [ ... ]
> 
> text/html parts are not automatically displayed using w3 or any other
> browser; they are given buttons, and the html text is shown inline.
> if you click the button twice, gnus starts any text/html viewer
> specified in you .mailcap file.

Yes, this works exactly the way you stated ... thanks!  And it brings
up another question: is there any way to use `mm-inline-media-tests'
or something akin to this to cause the default behavior to be that the
HTML would still be buttonized, but not shown inline, and that it
would only be shown inline after the button is first selected?

Thanks again, in advance.

-- 
 Lloyd Zusman
 ljz@asfast.com


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

end of thread, other threads:[~1999-12-09 17:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-07 21:47 Canonical method for avoiding HTML expansion? Lloyd Zusman
1999-12-08  3:35 ` Dale Hagglund
1999-12-09 17:00   ` Lloyd Zusman
1999-12-08  9:26 ` Hrvoje Niksic
1999-12-08 13:12   ` David S. Goldberg
1999-12-08 15:26     ` Lloyd Zusman

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