Gnus development mailing list
 help / color / mirror / Atom feed
From: Karl Kleinpaste <karl@justresearch.com>
Subject: Got a couple weird ones here (hacking article-display-hook)
Date: 19 Nov 1998 15:48:35 -0500	[thread overview]
Message-ID: <vxkd86jtnmk.fsf_-_@beaver.jprc.com> (raw)
In-Reply-To: Colin Rafferty's message of "19 Nov 1998 12:09:32 -0500"

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


  reply	other threads:[~1998-11-19 20:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-19 16:53 removing obnoxious mailing list trailers? Karl Kleinpaste
1998-11-19 17:09 ` Colin Rafferty
1998-11-19 20:48   ` Karl Kleinpaste [this message]
1998-11-20  0:17     ` Got a couple weird ones here (hacking article-display-hook) 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vxkd86jtnmk.fsf_-_@beaver.jprc.com \
    --to=karl@justresearch.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).