Article View: news.software.readers
Article #47856Re: slrn-show full header
From: Jan Hlavacek
Date: Fri, 09 Apr 1999 00:00
Date: Fri, 09 Apr 1999 00:00
65 lines
3157 bytes
3157 bytes
On 9 Apr 99 15:58:55 GMT, Peppe <c928400@student.dtu.dk> wrote:
> As I don't know how to check for the state of these togglings, I once came
> up with the following approach. It lends itself to all three special editor
> options being set (which I have), after which I found no need for the
> "editor_command" option.
>
> if (andelse {strlen (get_variable_value ("mail_editor_command"))}
> {strlen (get_variable_value ("post_editor_command"))}
> {strlen (get_variable_value ("score_editor_command"))})
> set_string_variable ("editor_command", "0");
> define article_mode_hook ()
> {
> if (get_variable_value ("editor_command") == "0")
> {
> call("toggle_headers");
> set_string_variable ("editor_command", "1");
> }
> }
>
> As usual, these go in eg .slrn.sl which is then "interpret .slrn.sl"�ed
> from .slrnrc.
>
> It would be benefitial if one could set a global variable here, but I
> didn't stumble over a way to do so while reading the slang docs.
How about this (untested)
variable Headers_Visible = 0;
define my_toggle_headers ()
{
Headers_Visible = ~(Headers_Visible);
call ("toggle_headers");
}
definekey ("my_toggle_headers", "t", "article");
define show_headers ()
{
!if (Headers_Visible) {my_toggle_headers());
}
define hide_headers ()
{
if (Headers_Visible) {my_toggle_headers());
}
define article_mode_hook ()
{
show_headers ();
}
You could also make the Headers_Visible variable static/private so
nobody could accidentaly change it. You also have to make sure that
everywhere you curently use `call("toggle_headers")', you replace it by
`my_toggle_headers()', to the global variable always reflects the
current status.
--
Jan Hlav\'{a}\v{c}ek <lahvak@math.mps.ohio-state.edu> (BCC's will bounce)
home page: http://www.math.ohio-state.edu/~lahvak/
slrn page: http://www.math.ohio-state.edu/~lahvak/software/slrn.html
slrn documentation: http://www.math.ohio-state.edu/~lahvak/software/slrn/
Technical Details
Message-ID:
<slrn7gsmjv.b3d.lahvak@octagon.mps.ohio-state.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-mailReferences:
<7eha49$fpn@sjx-ixn10.ix.netcom.com> <slrn7got8i.3u8.hezu@tuuri.ling.helsinki.fi> <slrn7gs920.fc.c928400@urdybet.pbk.dk>Show Full Headers
Complete Article Headers
Message-ID: <slrn7gsmjv.b3d.lahvak@octagon.mps.ohio-state.edu> Subject: Re: slrn-show full header Date: Fri, 09 Apr 1999 00:00:00 +0000 From: lahvak@math.mps.ohio-state.edu (Jan Hlavacek) References: <7eha49$fpn@sjx-ixn10.ix.netcom.com> <slrn7got8i.3u8.hezu@tuuri.ling.helsinki.fi> <slrn7gs920.fc.c928400@urdybet.pbk.dk> 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: 464550318 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: usenet@math.ohio-state.edu X-Trace: mathserv.mps.ohio-state.edu 923687550 12542 128.146.111.74 (9 Apr 1999 19:52:30 GMT) Organization: Department of Mathematics, The Ohio State University Mime-Version: 1.0 User-Agent: slrn/0.9.5.4 (UNIX) Reply-To: lahvak@math.mps.ohio-state.edu NNTP-Posting-Date: 9 Apr 1999 19:52:30 GMT Newsgroups: news.software.readers