Gnus development mailing list
 help / color / mirror / Atom feed
* Selective HTML rendering using group parameters
@ 2006-03-15  5:59 Nelson Ferreira
  2006-03-15  8:05 ` Nelson Ferreira
  2006-03-15  8:56 ` Katsumi Yamaoka
  0 siblings, 2 replies; 4+ messages in thread
From: Nelson Ferreira @ 2006-03-15  5:59 UTC (permalink / raw)



Hi all,

I came across a weird issue regarding group-parameters and
"group-local" variables.


I have the following in my gnus:

,---- .gnus ----
| (setq 
|  mm-automatic-display (remove "text/html" mm-automatic-display)
|  mm-discouraged-alternatives '("text/html" "text/richtext" "text/enriched" "multipart/related")
|  )
`----

in order to have HTML rendering off by default.
However there are some mailing lists I subscribed where the HTML is
well-formed enough (and there is no option for text-only :( ) where I
wanted to enable html rendering by default on those groups.

So I tried the following in the group parameters of one of the groups
with "good" HTML:


,---- group parameters ---
| ((mm-automatic-display
|   (append
|    (list "text/html")
|    mm-automatic-display))
|  (mm-discouraged-alternatives
|   (remove "text/html"
|           (remove "multipart/related" mm-discouraged-alternatives))))
`----

Sure enough if I press space from the *Group* buffer, the HTML in the
message is rendered, and it so happens in all other messages in that
"summary buffer session" .

However, if no message is immediately rendered (I press ENTER or only
ticked articles are in the summary buffer) then when the article is
shown, the HTML is not rendered.

I looked at the value of both mm-automatic-display and
mm-discouraged-alternatives and it looks like that if upon entering
the group the article buffer is created then their values are the one
coming from the group parameters, otherwise the defaults (i.e. from
.gnus) are used.

Is there any way to make sure that the group parameter set values for
variables are always transported to the article buffer regardless of
the moment in time it is created ?

Thanks,

        Nelson

PS: To save you from looking up the User Agent, I am using SXEmacs
22.1.4 and No Gnus v0.4


-- 
Nelson Ferreira




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

* Re: Selective HTML rendering using group parameters
  2006-03-15  5:59 Selective HTML rendering using group parameters Nelson Ferreira
@ 2006-03-15  8:05 ` Nelson Ferreira
  2006-03-15  8:56 ` Katsumi Yamaoka
  1 sibling, 0 replies; 4+ messages in thread
From: Nelson Ferreira @ 2006-03-15  8:05 UTC (permalink / raw)



An update below...

"njsf" == Nelson Ferreira <nelson.ferreira@ieee.org> writes:

    njsf> Hi all,
    njsf> I came across a weird issue regarding group-parameters and
    njsf> "group-local" variables.

    njsf> I have the following in my gnus:

    njsf> ,---- .gnus ----
    njsf> | (setq 
    njsf> |  mm-automatic-display (remove "text/html" mm-automatic-display)
    njsf> |  mm-discouraged-alternatives '("text/html" "text/richtext" "text/enriched" "multipart/related")
    njsf> |  )
    njsf> `----

    njsf> in order to have HTML rendering off by default.  However
    njsf> there are some mailing lists I subscribed where the HTML is
    njsf> well-formed enough (and there is no option for text-only :(
    njsf> ) where I wanted to enable html rendering by default on
    njsf> those groups.

    njsf> So I tried the following in the group parameters of one of
    njsf> the groups with "good" HTML:

    njsf> ,---- group parameters ---
    njsf> | ((mm-automatic-display
    njsf> |   (append
    njsf> |    (list "text/html")
    njsf> |    mm-automatic-display))
    njsf> |  (mm-discouraged-alternatives
    njsf> |   (remove "text/html"
    njsf> |           (remove "multipart/related" mm-discouraged-alternatives))))
    njsf> `----

    njsf> Sure enough if I press space from the *Group* buffer, the
    njsf> HTML in the message is rendered, and it so happens in all
    njsf> other messages in that "summary buffer session" .

    njsf> However, if no message is immediately rendered (I press
    njsf> ENTER or only ticked articles are in the summary buffer)
    njsf> then when the article is shown, the HTML is not rendered.

    njsf> I looked at the value of both mm-automatic-display and
    njsf> mm-discouraged-alternatives and it looks like that if upon
    njsf> entering the group the article buffer is created then
    njsf> their values are the one coming from the group parameters,
    njsf> otherwise the defaults (i.e. from .gnus) are used.

    njsf> Is there any way to make sure that the group parameter set
    njsf> values for variables are always transported to the article
    njsf> buffer regardless of the moment in time it is created ?

I tried adding mm-automatic-display and mm-discouraged-alternatives
to gnus-summary-local-variables and then playing with .gnus to set
the default value and the group parameters to deal with getting the
default and changing it in the group parameters with mostly the same
results.

Thanks,

        Nelson


[...]

-- 
Nelson Ferreira




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

* Re: Selective HTML rendering using group parameters
  2006-03-15  5:59 Selective HTML rendering using group parameters Nelson Ferreira
  2006-03-15  8:05 ` Nelson Ferreira
@ 2006-03-15  8:56 ` Katsumi Yamaoka
  2006-03-15 20:20   ` Nelson Ferreira
  1 sibling, 1 reply; 4+ messages in thread
From: Katsumi Yamaoka @ 2006-03-15  8:56 UTC (permalink / raw)


>>>>> In <m3bqw85ju6.fsf@tuxie.homelinux.net> Nelson Ferreira wrote:

> I came across a weird issue regarding group-parameters and
> "group-local" variables.

> I have the following in my gnus:

> ,---- .gnus ----
>| (setq
>|  mm-automatic-display (remove "text/html" mm-automatic-display)
>|  mm-discouraged-alternatives '("text/html" "text/richtext" "text/enriched" "multipart/related")
>|  )
> `----

> in order to have HTML rendering off by default.
> However there are some mailing lists I subscribed where the HTML is
> well-formed enough (and there is no option for text-only :( ) where I
> wanted to enable html rendering by default on those groups.

> So I tried the following in the group parameters of one of the groups
> with "good" HTML:

> ,---- group parameters ---
>| ((mm-automatic-display
>|   (append
>|    (list "text/html")
>|    mm-automatic-display))
>|  (mm-discouraged-alternatives
>|   (remove "text/html"
>|           (remove "multipart/related" mm-discouraged-alternatives))))
> `----

> Sure enough if I press space from the *Group* buffer, the HTML in the
> message is rendered, and it so happens in all other messages in that
> "summary buffer session" .

> However, if no message is immediately rendered (I press ENTER or only
> ticked articles are in the summary buffer) then when the article is
> shown, the HTML is not rendered.

[...]

Well, I think you may want to use `gnus-newsgroup-variables' to
declare that those mm- variables are the group parameters.  Does
this Info document help?

(info "(gnus)RSS")
--8<---------------cut here---------------start------------->8---
   Even if you have added `"text/html"' to the
`mm-discouraged-alternatives' variable (*note Display Customization:
(emacs-mime)Display Customization.) since you don't want to see HTML
parts, it might be more useful especially in `nnrss' groups to display
`text/html' parts.  Here's an example of setting
`mm-discouraged-alternatives' as a group parameter (*note Group
Parameters::) in order to display `text/html' parts only in `nnrss'
groups:

     ;; Set the default value of `mm-discouraged-alternatives'.
     (eval-after-load "gnus-sum"
       '(add-to-list
         'gnus-newsgroup-variables
         '(mm-discouraged-alternatives
           . '("text/html" "image/.*"))))

     ;; Display `text/html' parts in `nnrss' groups.
     (add-to-list
      'gnus-parameters
      '("\\`nnrss:" (mm-discouraged-alternatives nil)))
--8<---------------cut here---------------end--------------->8---



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

* Re: Selective HTML rendering using group parameters
  2006-03-15  8:56 ` Katsumi Yamaoka
@ 2006-03-15 20:20   ` Nelson Ferreira
  0 siblings, 0 replies; 4+ messages in thread
From: Nelson Ferreira @ 2006-03-15 20:20 UTC (permalink / raw)


"Katsumi" == Katsumi Yamaoka <yamaoka@jpl.org> writes:

    >>>>>> In <m3bqw85ju6.fsf@tuxie.homelinux.net> Nelson Ferreira wrote:

[...]


    Katsumi> [...]

    Katsumi> Well, I think you may want to use `gnus-newsgroup-variables' to
    Katsumi> declare that those mm- variables are the group parameters.  Does
    Katsumi> this Info document help?

Katsumi, that did the trick!

I now have this in my .gnus:

,----
| ;; Set the default value of `mm-discouraged-alternatives' and 'mm-automatic-display'.
| (eval-after-load "gnus-sum"
|   '(progn 
|      (add-to-list 
|       'gnus-newsgroup-variables 
|       '(mm-discouraged-alternatives
|         . '("text/html" "text/richtext" "text/enriched"
|             "multipart/related" "image/.*")))
|      (add-to-list 
|       'gnus-newsgroup-variables 
|       (list 'mm-automatic-display 'quote (remove "text/html" mm-automatic-display)))))
`----

and my group parameters is now:

,----
| ((mm-discouraged-alternatives
|   (remove "text/html" "multipart/related"
|           (or mm-discouraged-alternatives
|               (default-value mm-discouraged-alternatives))))
|  (mm-automatic-display
|   (append
|    (list "text/html")
|    (or mm-automatic-display
|        (default-value mm-automatic-display)))))
`----


[...]


-- 
Nelson Ferreira




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

end of thread, other threads:[~2006-03-15 20:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-15  5:59 Selective HTML rendering using group parameters Nelson Ferreira
2006-03-15  8:05 ` Nelson Ferreira
2006-03-15  8:56 ` Katsumi Yamaoka
2006-03-15 20:20   ` Nelson Ferreira

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