Article View: news.software.readers
Article #43795Re: SLRN Macros/Hooks
From: Thorfinn
Date: Wed, 14 Oct 1998 00:00
Date: Wed, 14 Oct 1998 00:00
85 lines
3394 bytes
3394 bytes
In news.software.readers, on 13 Oct 1998 07:54:11 GMT
Scott H. Perlman <perlman@linguist.dartmouth.edu> wrote:
>IWhat would be the appropriate hook to add
>extract_article_header I frequently want to look at a header that is
>not displayed by default, and I'd like to set certain groups to do so
>autmatically.
>On the same token is there a comparable function to hide and article header
>I don't want to see?
As other people have said... I don't think there's a way to define the
list of headers that are seen/unseen in slrn.
That would probably be the most useful feature to have added.
Anyway... Here's what I do in order to get slrn to always display
headers and scores in the article list window:
=== begin macros.sl ===
%
% Copyright 1998 Thorfinn <thorfinn@tertius.net.au>
%
% Feel free to use with attribution.
%
% Make it show headers to start with.
%
variable done_singleton_show_headers = 0;
define article_mode_see_headers ()
{
if (done_singleton_show_headers == 0)
{
% Grab the header flags of the article we're pointing to
% (necessary so that we can restore them later).
variable oldflags = get_header_flags();
% Call "toggle_headers", which causes headers to be displayed in the
% current article, and incidentally displays the current article.
call("toggle_headers");
% Call "hide_article", which hides the article again, returning
% us to the original display of just the article list.
call("hide_article");
% Change the header flags back.
set_header_flags(oldflags);
% Set the display_score variable to 1, so that we show scores, too.
set_integer_variable("display_score", 1);
% Call redraw, so that the screen is redisplayed with scores.
call("redraw");
% Set the singleton variable, so we don't try to do all of this again.
done_singleton_show_headers = 1;
}
}
define article_mode_hook ()
{
% I have some other article mode hooks here,
% but they're not relevant.
article_mode_see_headers();
}
=== end macros.sl ===
Something like it on a per newsgroup basis is possible, if you, say,
keep track of the state of "toggle_headers", and remap the current
toggle_headers key so that it doesn't cause problems with your
internal state variable, either by keeping track, or just disallowing
it entirely.
Later,
Thorf
--
<a href="http://www.tertius.net.au/~thorfinn/">thorfinn@tertius.net.au</a>
C++ protects you against Murphy, not Machiavelli.
-- Damian Conway
Technical Details
Message-ID:
<slrn728b1d.ma.thorfinn@tertius.net.au>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<slrn7261p3.1g7.perlman@linguist.dartmouth.edu>Show Full Headers
Complete Article Headers
Message-ID: <slrn728b1d.ma.thorfinn@tertius.net.au> Subject: Re: SLRN Macros/Hooks Date: Wed, 14 Oct 1998 00:00:00 +0000 From: thorfinn@tertius.net.au (Thorfinn) References: <slrn7261p3.1g7.perlman@linguist.dartmouth.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 400874842 X-Silly-Line: "Yeah, but you're taking the universe out of context." X-Newsgroup: news.software.readers Organization: Unico Computer Systems User-Agent: slrn/0.9.5.3 (UNIX) Reply-To: thorfinn@tertius.net.au Newsgroups: news.software.readers X-Religion: linux slrn mutt vim