Gnus development mailing list
 help / color / mirror / Atom feed
* removing obnoxious mailing list trailers?
@ 1998-11-19 16:53 Karl Kleinpaste
  1998-11-19 17:09 ` Colin Rafferty
  0 siblings, 1 reply; 7+ messages in thread
From: Karl Kleinpaste @ 1998-11-19 16:53 UTC (permalink / raw)


I have a certain wild fantasy...

(OK, I have...quite a few.  This one applies to Gnus.)

I'm on a whole bunch of mailing lists.  Some of them have annoying
Subject strings which I happily destroy with nnmail-list-identifiers
and nnmail-remove-list-identifiers.  Joy, joy.

Some of them have obnoxious quasi-signature trailer files which
describe, in horrid detail, who runs the list, what organization is
(not) responsible for list content, how to (un)subscribe, how to get
list info, how to...

The (lack of) content in these seems endless.  The most heinous
offender in this category happens to be a list whose trailer is, no
exaggeration, 32 lines long -- routinely longer than anyone's actual
contribution to the list.

I'd like a new wrench, a new knob to twist...something which operates
on the same philosophical basis as nnmail-list-identifiers, which
would allow me, on a per-group basis, to hack-n-slash these long,
obnoxious trailers from every slice of mail that arrives in that group.

I wonder if I'm the only person ever to fantasize in this particular
way.  That would seem unlikely, since someone else clearly fantasized,
and then implemented, nnmail-list-identifiers /et al/.

Anyone?


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

* Re: removing obnoxious mailing list trailers?
  1998-11-19 16:53 removing obnoxious mailing list trailers? Karl Kleinpaste
@ 1998-11-19 17:09 ` Colin Rafferty
  1998-11-19 20:48   ` Got a couple weird ones here (hacking article-display-hook) Karl Kleinpaste
  0 siblings, 1 reply; 7+ messages in thread
From: Colin Rafferty @ 1998-11-19 17:09 UTC (permalink / raw)


Karl Kleinpaste writes:

> I'd like a new wrench ... which would allow me, on a per-group
> basis, to hack-n-slash these long, obnoxious trailers from every
> slice of mail that arrives in that group.

You could probably do something group-local with `gnus-signature-separator'
and `gnus-article-hide-signature'.

-- 
Colin


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

* Got a couple weird ones here (hacking article-display-hook)
  1998-11-19 17:09 ` Colin Rafferty
@ 1998-11-19 20:48   ` Karl Kleinpaste
  1998-11-20  0:17     ` Håvard Fosseng
                       ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Karl Kleinpaste @ 1998-11-19 20:48 UTC (permalink / raw)


Colin Rafferty <craffert@ms.com> writes:
> You could probably do something group-local with `gnus-signature-separator'
> and `gnus-article-hide-signature'.

Indeed, yes, and thanx.  Those clues gave me something to work with,
but unfortunately (or fortunately, as the case may be) they led me to
discovering a couple odd bugs.

First -- not a bug specifically, but something of an operational lack
-- what I need is a means to add something to
gnus-article-display-hook on a per-group basis.  That is, I don't want
signature hiding to be done anywhere but one particular group.  This
doesn't seem to exist in any form; trying to do it via either group
properties with `G p' or by adding (local (var form)) in scorefiles
doesn't give the right result: Both end up with buffer-local versions
of gnus-article-display-hook, which are local to the *Summary* buffer,
and seem to have no effect in the *Article* buffer.  I can't even
usefully set gnus-signature-separator via such mechanisms; edebug'ing
through article-hide-signature shows (correctly, I suppose, but
inconveniently) that the unmodified gnus-signature-separator is what's
active in the *Article* buffer.  But I can at least set
gnus-signature-separator globally in .gnus, since its setting doesn't
really conflict with anything elsewhere, and that's fine, I guess.

So, second, I thought I'd try a different approach: Add or remove
signature hiding to the global gnus-article-display-hook, on a
per-group basis:

(setq gnus-select-group-hook
      (function
       (lambda ()
	 (if (string-match "that.bad.mailing.list" gnus-newsgroup-name)
	     (add-hook 'gnus-article-display-hook 'gnus-article-hide-signature t)
	   (remove-hook 'gnus-article-display-hook 'gnus-article-hide-signature))
	 ))

Wretched to look at, but seemingly workable.  And in fact, at first
glance it appears to do the right thing.

However, with this in place, and thus with gnus-article-display-hook
possibly altering slightly with each group entry, I've lost the
ability to get a totally raw article via `C-u g'.

I don't understand this one at all.  I've just spent about 20 minutes
with edebug'ing through gnus-summary-show-article,
gnus-summary-select-article, and friends, trying to figure out what
value of gnus-article-display-hook is in use at what points, and
frankly I just don't get it.  The best understanding I've gotten is
that, at times, gnus-article-display-hook's value is a buffer-local
value of '(gnus-article-hide-signature) all by itself; it doesn't seem
to matter exactly, whether one has invoked `g' with an argument or
not.  The visual cue that something weird has happened is that, when
using `C-u g', though signature hiding isn't done, nonetheless
quotation coloring still happens, and most headers are still hidden.

This affects all groups, once -hide-signature has been added once:
Thereafter, while signature-hiding happens only in the affected group
and nowhere else, I can't get a truly raw article in any group.

--karl


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

* Re: Got a couple weird ones here (hacking article-display-hook)
  1998-11-19 20:48   ` Got a couple weird ones here (hacking article-display-hook) Karl Kleinpaste
@ 1998-11-20  0:17     ` Håvard Fosseng
  1998-11-20  0:21     ` Håvard Fosseng
  1998-11-20  2:49     ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 7+ messages in thread
From: Håvard Fosseng @ 1998-11-20  0:17 UTC (permalink / raw)
  Cc: ding

Karl Kleinpaste writes:

> So, second, I thought I'd try a different approach: Add or remove
> signature hiding to the global gnus-article-display-hook, on a
> per-group basis:
> 
> (setq gnus-select-group-hook
>       (function
>        (lambda ()
> 	 (if (string-match "that.bad.mailing.list" gnus-newsgroup-name)
> 	     (add-hook 'gnus-article-display-hook 'gnus-article-hide-signature t)
> 	   (remove-hook 'gnus-article-display-hook 'gnus-article-hide-signature))
> 	 ))

Another approach I've used is:

(defadvice gnus-article-hide-signature (around not-aq activate)
  "Don't hide signatures in alt.quotations and comp.text.sgml"
  (unless (string-match "alt.quotations\\|sgml" gnus-newsgroup-name)
    ad-do-it))



- Håvard Fosseng

-- 
S'il fallait tolérer aux autres tout ce qu'on se permet à soi-même, la
vie ne serait plus tenable.
                     -- Georges Courteline






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

* Re: Got a couple weird ones here (hacking article-display-hook)
  1998-11-19 20:48   ` Got a couple weird ones here (hacking article-display-hook) Karl Kleinpaste
  1998-11-20  0:17     ` Håvard Fosseng
@ 1998-11-20  0:21     ` Håvard Fosseng
  1998-11-20  2:49     ` Lars Magne Ingebrigtsen
  2 siblings, 0 replies; 7+ messages in thread
From: Håvard Fosseng @ 1998-11-20  0:21 UTC (permalink / raw)
  Cc: ding

Karl Kleinpaste writes:

> First -- not a bug specifically, but something of an operational lack
> -- what I need is a means to add something to
> gnus-article-display-hook on a per-group basis.  That is, I don't want
> signature hiding to be done anywhere but one particular group.

I have some interest in the inverse problem: Run some article washing
function eveywhere *except*...



- Håvard Fosseng

-- 
S'il fallait tolérer aux autres tout ce qu'on se permet à soi-même, la
vie ne serait plus tenable.
                     -- Georges Courteline






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

* Re: Got a couple weird ones here (hacking article-display-hook)
  1998-11-19 20:48   ` Got a couple weird ones here (hacking article-display-hook) Karl Kleinpaste
  1998-11-20  0:17     ` Håvard Fosseng
  1998-11-20  0:21     ` Håvard Fosseng
@ 1998-11-20  2:49     ` Lars Magne Ingebrigtsen
  1998-11-20  4:53       ` Karl Kleinpaste
  2 siblings, 1 reply; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-11-20  2:49 UTC (permalink / raw)


Karl Kleinpaste <karl@justresearch.com> writes:

> trying to do it via either group
> properties with `G p' or by adding (local (var form)) in scorefiles
> doesn't give the right result: Both end up with buffer-local versions
> of gnus-article-display-hook, which are local to the *Summary* buffer,
> and seem to have no effect in the *Article* buffer.

The vars from the group properties are supposed to be set locally in
the article buffer as well.  (It's done in
`gnus-article-setup-buffer'.) 

> However, with this in place, and thus with gnus-article-display-hook
> possibly altering slightly with each group entry, I've lost the
> ability to get a totally raw article via `C-u g'.

That's weird...  No, it isn't.  If you have a local version of
`gnus-article-display-hook' hanging around, `C-u g' won't work.
That's not nice...  Hm...

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


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

* Re: Got a couple weird ones here (hacking article-display-hook)
  1998-11-20  2:49     ` Lars Magne Ingebrigtsen
@ 1998-11-20  4:53       ` Karl Kleinpaste
  0 siblings, 0 replies; 7+ messages in thread
From: Karl Kleinpaste @ 1998-11-20  4:53 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> That's weird...  No, it isn't.  If you have a local version of
> `gnus-article-display-hook' hanging around, `C-u g' won't work.
> That's not nice...  Hm...

One part of my report was definitely bogus.  There's certainly some
kind of problem with there being a local -display-hook, which
interferes with `C-u g'; however, my basic difficulty with
adding/removing -hide-signature in the selct-hook was because of
having inadvertently left a local var form in group properties.
Apologies, regrets.  This localized bit was interfering with my
general effort in the select-hook; now that I've fixed the group
properties, the select-hook use of add/remove -hide-signature works
fine.

/mutter/,
--karl


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

end of thread, other threads:[~1998-11-20  4:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-19 16:53 removing obnoxious mailing list trailers? Karl Kleinpaste
1998-11-19 17:09 ` Colin Rafferty
1998-11-19 20:48   ` Got a couple weird ones here (hacking article-display-hook) Karl Kleinpaste
1998-11-20  0:17     ` Håvard Fosseng
1998-11-20  0:21     ` Håvard Fosseng
1998-11-20  2:49     ` Lars Magne Ingebrigtsen
1998-11-20  4:53       ` Karl Kleinpaste

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