Thread View: news.software.readers
9 messages
9 total messages
Started by Jeffrey C. Ollie
Fri, 12 Jul 1996 00:00
Keeping List of Newsgroups Sorted in SLRN
Author: Jeffrey C. Ollie
Date: Fri, 12 Jul 1996 00:00
Date: Fri, 12 Jul 1996 00:00
28 lines
1931 bytes
1931 bytes
Is there a way for slrn to always list the newsgroups in sorted order rather than the order that they appear in the .jnewsrc? I didn't see anything in the man pages or in the rcfile so I've just been quitting slrn and using the UNIX sort command of the .jnewsrc. FYI, I'm using 0.8.8.4. BTW, I *LOVE* slrn. It still has some rough edges, but I'll probably be switching to it completely once I've figured out a way to automatically run PGP to sign all of my posts. I just wish that the default key mappings weren't so baroque. Fortunately, you've given me the ability to change the key mappings in my .slrnrc. I'll probably change most of them once I become more familiar with the workings of slrn. My current newsreader is GNUS (the version packaged with emacs 19.29). About the only thing that I will miss will be the functions that GNUS has for converting the Date: header in the posting. You could convert it to time elapsed since the article was posted, the time that it was posted expressed in local time, and many others that I didn't bother to read up on. I'd love it if slrn had a feature like this - I find it difficult to convert GMT and other timezones to local time. Knowing the local time when an article was posted is important to me because then I know how old the information is and whether it is likely to be out of date or inaccurate.
Re: Keeping List of Newsgroups Sorted in SLRN
Author: Reality is a point of view
Date: Fri, 12 Jul 1996 00:00
Date: Fri, 12 Jul 1996 00:00
34 lines
1733 bytes
1733 bytes
+---- cbbrowne@dantzig.nodomain.nowhere wrote (12 Jul 1996 06:14:51 GMT):
| I personally have found it annoying when newsreaders have neglected
| to permit me to order my news in whatever logical fashion I prefer.
I'm still hoping for article sorting by score.
| This will sort .jnewsrc on a regular basis.
+----
FWIW I use
#!/bin/sh
oldnewsrc=~/News/.jnewsrc
newsrc=~/News/.jnewsrc.new
if [ -e $oldnewsrc ]; then
if [ -e $newsrc ]; then rm -f $newsrc; fi
grep : $oldnewsrc > $newsrc
grep -v : $oldnewsrc | sort | uniq >> $newsrc
mv -i $newsrc $oldnewsrc
fi
That leaves the order of subscribed groups alone and sorts the
unsubscribed groups. Running it while slrn is running won't
work because slrn is working with .jnewsrc~, at least in my
version. I suppose I could add a check for that . . .
--
Gary Johnson "There's no union called the AFL-CIA is there?"
gjohnson@season.com <a href="http://www.efm.org">Walk The Talk</a>
CAMPAIGN '96: Juck 'em if they can't fake a toke.
Re: Keeping List of Newsgroups Sorted in SLRN
Author: root
Date: Fri, 12 Jul 1996 00:00
Date: Fri, 12 Jul 1996 00:00
19 lines
1390 bytes
1390 bytes
In article <slrn4ubr0i.9d.cbbrowne@dantzig.nodomain.nowhere>, Christopher B. Browne wrote: >In article <slrn44ubl6u.d10.jollie@worf.netins.net>, Jeffrey C. Ollie wrote: >>Is there a way for slrn to always list the newsgroups in sorted order >>rather than the order that they appear in the .jnewsrc? I didn't see >>anything in the man pages or in the rcfile so I've just been quitting >>slrn and using the UNIX sort command of the .jnewsrc. FYI, I'm using >>0.8.8.4. > >I'm not sure I'd support the idea of adding the feature, at least not >using qsort() internally. > Clever script, but check out sorting of newsgroups in winvn. You can sort subscribed newsgroups independently of the remainder of the newsrc file.
Re: Keeping List of Newsgroups Sorted in SLRN
Author: Bennett Todd
Date: Fri, 12 Jul 1996 00:00
Date: Fri, 12 Jul 1996 00:00
29 lines
1581 bytes
1581 bytes
On 12 Jul 1996 13:27:58 GMT, Jeffrey C. Ollie <jollie@worf.netins.net> wrote:
>[...]
>Actually I was thinking of creating a shell script named "slrn" and
>putting it earlier on my path. The script would sort the .jnewsrc and
>then invoke the real slrn binary. This would probably tide me over
>until sorting could be implemented internally.
How about:
#!/bin/sh
tmp=/tmp/`basename $0`.$$
trap "rm -f $tmp" 0
f=$HOME/.jnewsrc
(grep ':' $f; grep -v ':' $f | sort) >$tmp
mv $tmp $f
exec /usr/local/bin/slrn ${1+"$@"}
Of course if you want you subscribed groups all mixed in to the unsubscribed
ones, you could change the grep-grep-sort idiom to a simple sort:
sort $f >$tmp
but I would personally want to keep the unsubscribed groups after the
subscribed ones, and keep the subscribed ones in whatever order I've chosen.
-Bennett
Re: Keeping List of Newsgroups Sorted in SLRN
Author: Steve Lamb
Date: Fri, 12 Jul 1996 00:00
Date: Fri, 12 Jul 1996 00:00
18 lines
1470 bytes
1470 bytes
On Fri, 12 Jul 1996 15:46:03 GMT, Bennett Todd <bet@ritz.mordor.com> wrote:
>but I would personally want to keep the unsubscribed groups after the
>subscribed ones, and keep the subscribed ones in whatever order I've chosen.
Simple, just don't save the unsubscribed groups. ;) I know, I know,
not everyone can use the active file. :)
--
------------ = -----------
Steve C. Lamb
This is not like TV only better. This is life. It's a piece of somebody's
life. Pure and uncut, straight from the cerebral cortex. You're there.
You're doing it, seeing it, hearing it... feeling it.
Re: Keeping List of Newsgroups Sorted in SLRN
Author: Jeffrey C. Ollie
Date: Fri, 12 Jul 1996 00:00
Date: Fri, 12 Jul 1996 00:00
50 lines
3050 bytes
3050 bytes
In article <slrn4ubr0i.9d.cbbrowne@dantzig.nodomain.nowhere>, Christopher B. Browne wrote: >In article <slrn44ubl6u.d10.jollie@worf.netins.net>, Jeffrey C. Ollie wrote: >>Is there a way for slrn to always list the newsgroups in sorted order >>rather than the order that they appear in the .jnewsrc? I didn't see >>anything in the man pages or in the rcfile so I've just been quitting >>slrn and using the UNIX sort command of the .jnewsrc. FYI, I'm using >>0.8.8.4. > >I'm not sure I'd support the idea of adding the feature, at least not >using qsort() internally. > >I personally have found it annoying when newsreaders have neglected >to permit me to order my news in whatever logical fashion I prefer. >Lexicographical ordering of newsgroup names doesn't strike me as >being particularly logical. (Is there any *real* reason that "A" >comes before "B" other than that *some* convention was needed?) I'm not advocating that everyone be forced to have their newsgroups presented in a lexicographic order. A setting in the .slrnrc file would switch back and forth. Personally, I just find it easier to find the group that I'm looking for if they are sorted. >If you want your .jnewsrc file sorted on a regular basis, feel free >to put the following in your .profile/.login/.zshrc file (whichever >applies better): > [ script trimmed ] Actually I was thinking of creating a shell script named "slrn" and putting it earlier on my path. The script would sort the .jnewsrc and then invoke the real slrn binary. This would probably tide me over until sorting could be implemented internally. >>About the only thing that I will miss will be the functions that GNUS >>has for converting the Date: header in the posting. You could convert >>it to time elapsed since the article was posted, the time that it was >>posted expressed in local time, and many others that I didn't bother >>to read up on. I'd love it if slrn had a feature like this - I find it >>difficult to convert GMT and other timezones to local time. Knowing >>the local time when an article was posted is important to me because >>then I know how old the information is and whether it is likely to be >>out of date or inaccurate. > >It's probably pretty possible to put code in to do this. slrn seems >to be fairly coherently written. Now if I just had the time to write it...
Re: Keeping List of Newsgroups Sorted in SLRN
Author: Christopher B. Browne
Date: Fri, 12 Jul 1996 00:00
Date: Fri, 12 Jul 1996 00:00
49 lines
2813 bytes
2813 bytes
In article <slrn44ubl6u.d10.jollie@worf.netins.net>, Jeffrey C. Ollie wrote: >Is there a way for slrn to always list the newsgroups in sorted order >rather than the order that they appear in the .jnewsrc? I didn't see >anything in the man pages or in the rcfile so I've just been quitting >slrn and using the UNIX sort command of the .jnewsrc. FYI, I'm using >0.8.8.4. I'm not sure I'd support the idea of adding the feature, at least not using qsort() internally. I personally have found it annoying when newsreaders have neglected to permit me to order my news in whatever logical fashion I prefer. Lexicographical ordering of newsgroup names doesn't strike me as being particularly logical. (Is there any *real* reason that "A" comes before "B" other than that *some* convention was needed?) If you want your .jnewsrc file sorted on a regular basis, feel free to put the following in your .profile/.login/.zshrc file (whichever applies better): # Sort .jnewsrc file sort ~/.jnewsrc > /tmp/.jnewsrc.sorted # Back it up... mv ~/.jnewsrc ~/.jnewsrc.old # And move the sorted copy into place... mv /tmp/.jnewsrc.sorted ~/.jnewsrc This will sort .jnewsrc on a regular basis. >About the only thing that I will miss will be the functions that GNUS >has for converting the Date: header in the posting. You could convert >it to time elapsed since the article was posted, the time that it was >posted expressed in local time, and many others that I didn't bother >to read up on. I'd love it if slrn had a feature like this - I find it >difficult to convert GMT and other timezones to local time. Knowing >the local time when an article was posted is important to me because >then I know how old the information is and whether it is likely to be >out of date or inaccurate. It's probably pretty possible to put code in to do this. slrn seems to be fairly coherently written. -- Christopher B. Browne, cbbrowne@conline.com, chris_browne@sdt.com Web: http://www.conline.com/~cbbrowne SAP Basis Consultant, UNIX Guy, Linux Guy. "Windows? Ah... The Athena Project from MIT..."
slrn sort-by-score patches
Author: Olly Betts
Date: Sat, 13 Jul 1996 00:00
Date: Sat, 13 Jul 1996 00:00
232 lines
6930 bytes
6930 bytes
In article <slrn4ud54j.8e.gjohnson@dream.season.com>, Reality is a point of view wrote:
> +---- cbbrowne@dantzig.nodomain.nowhere wrote (12 Jul 1996 06:14:51 GMT):
> | I personally have found it annoying when newsreaders have neglected
> | to permit me to order my news in whatever logical fashion I prefer.
>
>I'm still hoping for article sorting by score.
I sent John some patches for doing that, but I guess he's not had time to
integrate them yet. Anyway, here they are. They were written for a older
version, but patch applies them to 0.8.8.3 without any problems (I've not
upgraded to 0.8.8.4 yet). ESC s v in article mode switches to a view
sorted-by-score.
Olly
====
(Message outbox:3545)
To: davis@space.mit.edu
Subject: slrn patches for sort-by-score
Date: Fri, 21 Jun 1996 14:51:26 +0100
From: Olly Betts <olly@mantis.co.uk>
Hi John.
Here's some patches to allow display of articles by score value. If
threaded, the "score" for a thread is taken as the highest score of an
article in that thread.
BTW, I don't like the way ESC-s currently works: "threaded" is orthogonal to
sorting by server#/subject/score/etc, but the user interface doesn't make
this at all clear.
Cheers,
Olly
--- art.c.orig Thu Jun 13 05:35:33 1996
+++ art.c Wed Jun 19 17:49:42 1996
@@ -74,9 +74,15 @@
* 1 sort by threads
* 2 sort by subject
* 3 sort by subject and threads
+ * 4 sort by score
+ * 5 sort by score and threads
+ * 6/7 unused
*/
#define SORT_BY_THREADS 1
#define SORT_BY_SUBJECT 2
+#ifdef SLRN_HAS_SORT_BY_SCORE
+# define SORT_BY_SCORE 4
+#endif
int Slrn_Sorting_Mode = 3;
#define ALL_THREAD_FLAGS (FAKE_PARENT | FAKE_CHILDREN | FAKE_HEADER_HIGH_SCORE)
@@ -2474,8 +2480,10 @@
}
#endif
+typedef int (*header_cmp_func)(Slrn_Header_Type **, Slrn_Header_Type **);
-static void sort_by_subject (void)
+/* sort headers using the given function */
+static void sort_by ( header_cmp_func cmp_func )
{
Slrn_Header_Type **header_list, *h;
unsigned int i, nheaders;
@@ -2515,7 +2523,7 @@
}
header_list[nheaders] = NULL;
- (*qsort_fun) ((char *) header_list, nheaders, sizeof (Slrn_Header_Type *), header_subj_cmp);
+ (*qsort_fun) ((char *) header_list, nheaders, sizeof (Slrn_Header_Type *), cmp_func );
/* What to do now depends upon the current threading state. */
@@ -2567,6 +2575,26 @@
}
}
+static void sort_by_subject (void)
+{
+ sort_by( header_subj_cmp );
+}
+
+#ifdef SLRN_HAS_SORT_BY_SCORE
+static int header_score_cmp (Slrn_Header_Type **a, Slrn_Header_Type **b)
+{
+ /* sort by *descending* score */
+ int cmp = (*b)->thread_score - (*a)->thread_score;
+ if (!cmp) return (*a)->number - (*b)->number;
+ return cmp;
+}
+
+static void sort_by_score (void)
+{
+ sort_by( header_score_cmp );
+}
+#endif
+
static void sort_by_server_number (void)
{
Slrn_Header_Type *h;
@@ -2609,8 +2637,12 @@
static void toggle_sort (void)
{
+#ifdef SLRN_HAS_SORT_BY_SCORE
+ char rsp = slrn_get_response ("tTsSvVNnCc", "Sorting method: T-hreads, S-ubject, score V-alue, N-one, C-ancel");
+#else
char rsp = slrn_get_response ("tTsSNnCc", "Sorting method: T-hreads, S-ubject, N-one, C-ancel");
-
+#endif
+
switch (rsp | 0x20)
{
case 'n':
@@ -2625,8 +2657,15 @@
case 's':
sort_by_subject ();
- Slrn_Sorting_Mode |= SORT_BY_SUBJECT;
+ Slrn_Sorting_Mode = (Slrn_Sorting_Mode & SORT_BY_THREADS) | SORT_BY_SUBJECT;
+ break;
+
+#ifdef SLRN_HAS_SORT_BY_SCORE
+ case 'v':
+ sort_by_score ();
+ Slrn_Sorting_Mode = (Slrn_Sorting_Mode & SORT_BY_THREADS) | SORT_BY_SCORE;
break;
+#endif
default:
return;
@@ -2642,6 +2681,11 @@
if (Slrn_Sorting_Mode & SORT_BY_SUBJECT)
sort_by_subject ();
+
+#ifdef SLRN_HAS_SORT_BY_SCORE
+ if (Slrn_Sorting_Mode & SORT_BY_SCORE)
+ sort_by_score ();
+#endif
}
@@ -2924,11 +2968,22 @@
next = h->next;
while ((next != NULL) && (next->parent != NULL))
{
+#ifdef SLRN_HAS_SORT_BY_SCORE
+ if (next->flags & HEADER_HIGH_SCORE)
+ {
+ h->flags |= FAKE_HEADER_HIGH_SCORE;
+ }
+ if (next->score > h->thread_score)
+ {
+ h->thread_score = next->score;
+ }
+#else
if (next->flags & HEADER_HIGH_SCORE)
{
h->flags |= FAKE_HEADER_HIGH_SCORE;
break;
}
+#endif
next = next->next;
}
}
@@ -3356,6 +3411,9 @@
kill_cross_references (h);
}
}
+#ifdef SLRN_HAS_SORT_BY_SCORE
+ h->thread_score = h->score = score;
+#endif
return h;
}
@@ -5093,7 +5151,6 @@
A_KEY("pagedn", header_pagedn),
A_KEY("next_same_subject", next_header_same_subject),
A_KEY("next_high_score", next_high_score),
- A_KEY("next_high_score", next_high_score),
A_KEY("locate_header_by_msgid", locate_header_by_msgid),
A_KEY(NULL, NULL)
};
@@ -5768,6 +5825,16 @@
h->number);
}
else
+#ifdef SLRN_HAS_SORT_BY_SCORE
+ if (Slrn_Sorting_Mode & SORT_BY_SCORE)
+ {
+ SLsmg_printf ("%c %5d ",
+ ((flags & HEADER_READ) ? 'D': '-'),
+ ((h->child != NULL) && (h->child->flags & HEADER_HIDDEN))
+ ? h->thread_score : h->score);
+ }
+ else
+#endif
SLsmg_printf ("%c%5d:",
((flags & HEADER_READ) ? 'D': '-'),
h->lines);
--- art.h.orig Thu Jun 13 05:35:34 1996
+++ art.h Wed Jun 19 17:51:57 1996
@@ -52,6 +52,9 @@
#define FAKE_CHILDREN 0x100
#define FAKE_HEADER_HIGH_SCORE 0x200
unsigned int tag_number;
+#ifdef SLRN_HAS_SORT_BY_SCORE
+ int score, thread_score;
+#endif
#define MAX_TREE_SIZE 24
unsigned char tree[MAX_TREE_SIZE];
} Slrn_Header_Type;
--- features.h.orig Thu Jun 13 05:35:32 1996
+++ features.h Wed Jun 19 16:15:21 1996
@@ -11,6 +11,7 @@
#define SLRN_HAS_SPOILERS 1
#define SLRN_HAS_MIME 1
+#define SLRN_HAS_SORT_BY_SCORE 1
#ifdef VMS
# define SLRN_HAS_PIPING 0
--
cool wet grass cool wet grass cool wet grass cool wet grass cool wet grass
Re: slrn sort-by-score patches
Author: Reality is a point of view
Date: Sat, 13 Jul 1996 00:00
Date: Sat, 13 Jul 1996 00:00
36 lines
1739 bytes
1739 bytes
+---- olly@mantis.co.uk wrote (13 Jul 1996 13:12:14 GMT):
| Here's some patches to allow display of articles by score value.
Excellent!
| #define SORT_BY_THREADS 1
| +# define SORT_BY_SCORE 4
| int Slrn_Sorting_Mode = 3;
I jumped in with both feet via
int Slrn_Sorting_Mode = 5; // (SORT_BY_THREADS | SORT_BY_SCORE)
and it is GREAT!
| + if (Slrn_Sorting_Mode & SORT_BY_SCORE)
| + {
| + SLsmg_printf ("%c %5d ",
| + ((flags & HEADER_READ) ? 'D': '-'),
| + ((h->child != NULL) && (h->child->flags & HEADER_HIDDEN))
| + ? h->thread_score : h->score);
| + }
+----
After being frightened by articles that had 9999 lines I
switched to h->lines for the %5d. This is just what I was
hoping for, THANKS!
--
Gary Johnson "There's no union called the AFL-CIA is there?"
gjohnson@season.com <a href="http://www.efm.org">Walk The Talk</a>
CAMPAIGN '96: Juck 'em if they can't fake a toke.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads