Gnus development mailing list
 help / color / mirror / Atom feed
* Treatment for gnus-article-wash-html?
@ 2003-01-02 19:26 pete-temp-12-29-2002
  2003-01-02 19:35 ` Lars Magne Ingebrigtsen
  2003-01-02 22:07 ` pete-temp-12-29-2002
  0 siblings, 2 replies; 7+ messages in thread
From: pete-temp-12-29-2002 @ 2003-01-02 19:26 UTC (permalink / raw)


Is there any reason why there isn't a treatment variable for
gnus-article-wash-html?  I'd like to be able to force some of my
nnrss:groups to invoke gnus-article-wash-html automatically.  I
basically want to do something like this in my .gnus:

(setq gnus-treat-wash-html     '("^nnrss:Lamba"))

In this case, my Lamba the Ultimate RSS feed sends HTML that would
automatically be washed.  Right now, I have to always type 'W h' which
is a bit tedious.  

I'm a Gnus/Emacs/Elisp newbie (1 week), but I did take a peek in
gnus-art.el to see if I could get it to work, unfortunately, I had no
success.  I tried to do something like this:

Index: lisp/gnus-art.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v
retrieving revision 6.261
diff -u -r6.261 gnus-art.el
--- lisp/gnus-art.el	2003/01/02 18:55:07	6.261
+++ lisp/gnus-art.el	2003/01/02 19:11:29
@@ -1241,6 +1241,15 @@
   :link '(custom-manual "(gnus)Customizing Articles")
   :type gnus-article-treat-custom)
 
+(defcustom gnus-treat-wash-html nil
+  "Format as HTML.
+Valid values are nil, t, `head', `last', an integer or a predicate.
+See Info node `(gnus)Customizing Articles' for details."
+  :version "21.1"
+  :group 'gnus-article-treat
+  :link '(custom-manual "(gnus)Customizing Articles")
+  :type gnus-article-treat-custom)
+
 (defcustom gnus-treat-fill-long-lines nil
   "Fill long lines.
 Valid values are nil, t, `head', `last', an integer or a predicate.
@@ -1346,6 +1355,7 @@
     (gnus-treat-buttonize-head gnus-article-add-buttons-to-head)
     (gnus-treat-display-smileys gnus-treat-smiley)
     (gnus-treat-capitalize-sentences gnus-article-capitalize-sentences)
+    (gnus-treat-wash-html gnus-article-wash-html)
     (gnus-treat-emphasize gnus-article-emphasize)
     (gnus-treat-hide-citation gnus-article-hide-citation)
     (gnus-treat-hide-citation-maybe gnus-article-hide-citation-maybe)


Any help or pointers would be appreciated.  Perhaps I'm not even going
about this the right way.

Thanks!
Pete

ps Gnus is AWESOME!



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

* Re: Treatment for gnus-article-wash-html?
  2003-01-02 19:26 Treatment for gnus-article-wash-html? pete-temp-12-29-2002
@ 2003-01-02 19:35 ` Lars Magne Ingebrigtsen
  2003-01-02 20:21   ` pete-temp-12-29-2002
  2003-01-02 22:07 ` pete-temp-12-29-2002
  1 sibling, 1 reply; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-02 19:35 UTC (permalink / raw)


pete-temp-12-29-2002@kazmier.com writes:

> Is there any reason why there isn't a treatment variable for
> gnus-article-wash-html?  I'd like to be able to force some of my
> nnrss:groups to invoke gnus-article-wash-html automatically.  I
> basically want to do something like this in my .gnus:
>
> (setq gnus-treat-wash-html     '("^nnrss:Lamba"))

[...]

> I'm a Gnus/Emacs/Elisp newbie (1 week), but I did take a peek in
> gnus-art.el to see if I could get it to work, unfortunately, I had no
> success.  I tried to do something like this:

Thanks for the patch; I've applied it to Oort Gnus v0.08 (i. e., CVS).

Hm...  That looks like it should work, basically.  Nothing happens
when you use this?

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



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

* Re: Treatment for gnus-article-wash-html?
  2003-01-02 19:35 ` Lars Magne Ingebrigtsen
@ 2003-01-02 20:21   ` pete-temp-12-29-2002
  2003-01-02 20:38     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: pete-temp-12-29-2002 @ 2003-01-02 20:21 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Thanks for the patch; I've applied it to Oort Gnus v0.08 (i. e.,
> CVS).
>
> Hm...  That looks like it should work, basically.  Nothing happens
> when you use this?

Doh!!  It actually did work, I just can't spell 'Lambda' so it was
never being applied.  :-)  There is still one additional problem
though, the washing affects the entire article including the headers.
As a result of the HTML washing, the headers are all on one long
line.

The docs state that when a string list is used as the value to the
treatment variable, the treatment specified is performed on all body
parts.  So things work as documented, but is there anyway to get the
behavior I'm looking for?

Here is a doc patch for the first patch I submitted.

Thanks!
Pete


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch to gnus.texi --]
[-- Type: text/x-patch, Size: 526 bytes --]

Index: texi/gnus.texi
===================================================================
RCS file: /usr/local/cvsroot/gnus/texi/gnus.texi,v
retrieving revision 6.358
diff -u -r6.358 gnus.texi
--- texi/gnus.texi	2003/01/02 19:14:58	6.358
+++ texi/gnus.texi	2003/01/02 20:15:26
@@ -10634,6 +10634,7 @@
 @item gnus-treat-strip-pgp (t, last, integer)
 @item gnus-treat-strip-trailing-blank-lines (t, last, integer)
 @item gnus-treat-unsplit-urls (t, integer)
+@item gnus-treat-wash-html (t, integer)
 
 @xref{Article Washing}.
 

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

* Re: Treatment for gnus-article-wash-html?
  2003-01-02 20:21   ` pete-temp-12-29-2002
@ 2003-01-02 20:38     ` Lars Magne Ingebrigtsen
  2003-01-02 21:44       ` Pete Kazmier
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-02 20:38 UTC (permalink / raw)


pete-temp-12-29-2002@kazmier.com writes:

> Doh!!  It actually did work, I just can't spell 'Lambda' so it was
> never being applied.  :-)  There is still one additional problem
> though, the washing affects the entire article including the headers.
> As a result of the HTML washing, the headers are all on one long
> line.

Hm.  That's not supposed to happen...  I've done some minor tweaks to
the HTML washing function, so could you try updating to the latest
CVS and see whether the problem still exists?  If it does, I'll poke
around some more...

> The docs state that when a string list is used as the value to the
> treatment variable, the treatment specified is performed on all body
> parts.  So things work as documented, but is there anyway to get the
> behavior I'm looking for?

It's supposed to be applied only to the body parts, and not the
headers. 

> Here is a doc patch for the first patch I submitted.

Thanks for the patch; I've applied it to Oort Gnus v0.08 (i. e., CVS).

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



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

* Re: Treatment for gnus-article-wash-html?
  2003-01-02 20:38     ` Lars Magne Ingebrigtsen
@ 2003-01-02 21:44       ` Pete Kazmier
  2003-01-02 21:48         ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Pete Kazmier @ 2003-01-02 21:44 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 632 bytes --]

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Hm.  That's not supposed to happen...  I've done some minor tweaks
> to the HTML washing function, so could you try updating to the
> latest CVS and see whether the problem still exists?  If it does,
> I'll poke around some more...

The problem still exists, i.e. if I specify a string list as the value
of the treatment variable, it gets applied to all parts of the article
(including the headers).

After looking at the code (bear in mind that I'm a complete newbie), I
think I have corrected the problem. I was able to fix this behavior
with the following patch.

Thanks,
Pete


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch to fix treatment of headers --]
[-- Type: text/x-patch, Size: 664 bytes --]

Index: lisp/gnus-art.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v
retrieving revision 6.264
diff -u -r6.264 gnus-art.el
--- lisp/gnus-art.el	2003/01/02 20:45:14	6.264
+++ lisp/gnus-art.el	2003/01/02 21:30:06
@@ -6253,6 +6253,8 @@
   (cond
    ((null val)
     nil)
+   (condition
+    (eq condition val))
    ((and (listp val)
 	 (stringp (car val)))
     (apply 'gnus-or (mapcar `(lambda (s)
@@ -6271,8 +6273,6 @@
 	(equal (car val) type))
        (t
 	(error "%S is not a valid predicate" pred)))))
-   (condition
-    (eq condition val))
    ((eq val t)
     t)
    ((eq val 'head)

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

* Re: Treatment for gnus-article-wash-html?
  2003-01-02 21:44       ` Pete Kazmier
@ 2003-01-02 21:48         ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-02 21:48 UTC (permalink / raw)


Pete Kazmier <pete@kazmier.com> writes:

> After looking at the code (bear in mind that I'm a complete newbie), I
> think I have corrected the problem. I was able to fix this behavior
> with the following patch.

Thanks for the patch; I've applied it to Oort Gnus v0.08 (i. e., CVS).

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



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

* Re: Treatment for gnus-article-wash-html?
  2003-01-02 19:26 Treatment for gnus-article-wash-html? pete-temp-12-29-2002
  2003-01-02 19:35 ` Lars Magne Ingebrigtsen
@ 2003-01-02 22:07 ` pete-temp-12-29-2002
  1 sibling, 0 replies; 7+ messages in thread
From: pete-temp-12-29-2002 @ 2003-01-02 22:07 UTC (permalink / raw)


pete-temp-12-29-2002@kazmier.com writes:
> Is there any reason why there isn't a treatment variable for
> gnus-article-wash-html?  I'd like to be able to force some of my
> nnrss:groups to invoke gnus-article-wash-html automatically.  I
> basically want to do something like this in my .gnus:
>
> (setq gnus-treat-wash-html     '("^nnrss:Lamba"))

Ironically, I've decided not to use a list of strings for the value of
gnus-treat-wash-thml because its probably faster to just create a
group parameter and set gnus-treat-wash-html to t, not to mention it
keeps group specific stuff out of my .gnus file.  

If I had never attempted to use the list of string regexps, I would
never have found the problem with the condition test being in the
wrong place in gnus-treat-predicate, because it would never have
manifested itself.  Go figure.  

Anyways, Gnus is the best!!  Keep up the great work!!

Thanks!
Pete



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

end of thread, other threads:[~2003-01-02 22:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-02 19:26 Treatment for gnus-article-wash-html? pete-temp-12-29-2002
2003-01-02 19:35 ` Lars Magne Ingebrigtsen
2003-01-02 20:21   ` pete-temp-12-29-2002
2003-01-02 20:38     ` Lars Magne Ingebrigtsen
2003-01-02 21:44       ` Pete Kazmier
2003-01-02 21:48         ` Lars Magne Ingebrigtsen
2003-01-02 22:07 ` pete-temp-12-29-2002

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