Article View: news.software.readers
Article #38457SLRN 0.9.4.5, display score + lines (patch)
From: Andreas M. Kirchwitz
Date: Wed, 04 Feb 1998 00:00
Date: Wed, 04 Feb 1998 00:00
85 lines
3055 bytes
3055 bytes
Hello fans of slrn!
Slrn is great, but I didn't manage it to let slrn display the score
_and_ lines values on the article index screen.
Thus, I've written a patch, that displays the score (similar to the
existing "display_score" setting) _and_ the number of lines at the
same time. The patch introduces a new config variable named
"display_score_and_lines" for the slrnrc file. Obviously, slrn should
be compiled with SLRN_HAS_SORT_BY_SCORE set, and you should disable
"display_score" in your slrnrc file.
The trade-off, of course, is less space for the subject, but even
on 80 chars per line there's enough space left. And by the way,
xterms are resizable. ;-)
The most recent version is available in the World Wide Web from my
slrn page "http://www.eantc.de/~amk/patches.html". The patch for
slrn0.9.4.5 is appended below (should also apply over older versions
without any rejects).
Comments are welcome!
Greetings, Andreas
--- src/startup.c.orig Thu Jan 22 09:27:27 1998
+++ src/startup.c Wed Jan 28 21:37:39 1998
@@ -309,6 +309,7 @@
#endif
#if SLRN_HAS_SORT_BY_SCORE
{"display_score", &Slrn_Display_Score},
+ {"display_score_and_lines", &Slrn_Display_Score_and_Lines},
#else
{"display_score", NULL},
#endif
--- src/art.h.orig Thu Jan 22 09:27:27 1998
+++ src/art.h Wed Jan 28 21:38:14 1998
@@ -148,6 +148,7 @@
#if SLRN_HAS_SORT_BY_SCORE
extern int Slrn_Display_Score;
+extern int Slrn_Display_Score_and_Lines;
#endif
--- src/art.c.orig Thu Jan 22 09:27:27 1998
+++ src/art.c Wed Jan 28 21:36:41 1998
@@ -95,6 +95,7 @@
int Slrn_Use_Header_Numbers = 1;
#if SLRN_HAS_SORT_BY_SCORE
int Slrn_Display_Score;
+int Slrn_Display_Score_and_Lines = 0;
#endif
int Slrn_High_Score_Min = 1;
int Slrn_Low_Score_Max = 0;
@@ -7256,6 +7257,23 @@
((flags & HEADER_READ) ? 'D': '-'),
((h->child != NULL) && (h->child->flags & HEADER_HIDDEN))
? h->thread_score : h->score);
+ }
+ else if (Slrn_Display_Score_and_Lines)
+ {
+ long myscore = ((h->child != NULL) && (h->child->flags & HEADER_HIDDEN))
+ ? h->thread_score : h->score;
+ SLsmg_printf ("%c", ((flags & HEADER_READ) ? 'D': '-'));
+ if (myscore == 0)
+ {
+ SLsmg_printf (" ");
+ }
+ else
+ {
+ slrn_set_color (HIGH_SCORE_COLOR);
+ SLsmg_printf ("%6d", myscore);
+ slrn_set_color (0);
+ }
+ SLsmg_printf ("%5d:", h->lines);
}
#endif
else SLsmg_printf ("%c%5d:",
Technical Details
Message-ID:
<slrn6dh0bf.6rv.amk@krell.snafu.de>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-mailShow Full Headers
Complete Article Headers
Message-ID: <slrn6dh0bf.6rv.amk@krell.snafu.de> Subject: SLRN 0.9.4.5, display score + lines (patch) Date: Wed, 04 Feb 1998 00:00:00 +0000 From: amk@krell.snafu.de (Andreas M. Kirchwitz) 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: 322005804 Organization: Department of Fun & Games Newsgroups: news.software.readers