Thread View: news.software.readers
4 messages
4 total messages
Started by Ed Vielmetti
Tue, 10 Sep 1991 20:36
fine-grained control of sorting in newsgroups
Author: Ed Vielmetti
Date: Tue, 10 Sep 1991 20:36
Date: Tue, 10 Sep 1991 20:36
22 lines
1576 bytes
1576 bytes
One way that I organize my news reading is to periodically re-sort the
.newsrc file, using the "fixnewsrc" script that ckd@eff.org (Chris
Davis) built.
I'm thinking that it would be useful to take the same approach to some
newsgroups, percolating some of the consistently interesting stuff to
the top of the sort list, and then sorting the rest by some stable
thing (by thread or date or what have you). This is another
refinement on a "kill file", but more than just a kill file it would
be a selective sort on the newsgroup. e.g. for comp.archives is might
look like "put stuff with [comp.*] at the top, then the rest.". Or
whatever.
GNUS might be able to do this with a proper sort hook, but I don't
hack elisp....
--
Edward Vielmetti, vice president for research, MSEN Inc. emv@msen.com
MSEN, Inc. 628 Brooks Ann Arbor MI 48103 +1 313 741 1120
for information on MSEN products and services contact info@msen.com
Re: fine-grained control of sorting in newsgroups
Author: Dan_Jacobson
Date: Tue, 10 Sep 1991 22:52
Date: Tue, 10 Sep 1991 22:52
197 lines
9087 bytes
9087 bytes
>>>>> On 10 Sep 91 20:36:53 GMT, emv@msen.com (Ed Vielmetti) said:
Ed> One way that I organize my news reading is to periodically re-sort the
Ed> .newsrc file, using the "fixnewsrc" script that ckd@eff.org (Chris
Ed> Davis) built.
Ed> I'm thinking that it would be useful to take the same approach to some
Ed> newsgroups, percolating some of the consistently interesting stuff to
Ed> the top of the sort list, and then sorting the rest by some stable
Ed> thing (by thread or date or what have you). This is another
Ed> refinement on a "kill file", but more than just a kill file it would
Ed> be a selective sort on the newsgroup. e.g. for comp.archives is might
Ed> look like "put stuff with [comp.*] at the top, then the rest.". Or
Ed> whatever.
Ed> GNUS might be able to do this with a proper sort hook, but I don't
Ed> hack elisp....
Here's what I use in GNUS. [With the following code, I do
(setq newsgroup-type-priority-list nil)
(setq newsgroup-name-priority-list
'(
"important"
"^news\\.announce\\.new"
....
myself, and run it every few weeks.]
;From: ashwin@gatech.edu (Ashwin Ram)
;Newsgroups: gnu.emacs.gnus
;Subject: Re: How to sort the groups alphabeticaly?
;Date: 22 Oct 90 14:50:16 GMT
;Reply-To: ashwin@pravda.gatech.edu (Ashwin Ram)
;Organization: Georgia Institute of Technology, College of Computing
;In-reply-to: hilken.bln@nixpbe.uucp's message of 17 Oct 90 10:37:52 GMT
;
;I have code that (a) sorts the .newsrc file in order of "priority", and then
;(b) maintains it in that order by inserting new newsgroups in the appropriate
;place. (a) is slow but you only do it once. I've been using the code for
;several weeks now without running into any bugs.
;
;"Priority" is defined using a list that allows you to specify newsgroup names
;or name substrings in order of priority. You get two variables you can
;customize. E.g., the following settings specify that you want to read "comp"
;groups first, then "sci" groups, then "soc" groups, and everything else
;doesn't matter (that's the type-priority list); furthermore, you want to read
;"general" groups first, then groups about "ai", then groups about "gnus", and
;everything else doesn't matter.
;
; (setq newsgroup-type-priority-list '("comp" "sci" "soc"))
; (setq newsgroup-name-priority-list '("\\.general" "\\.ai" "gnus")))
;
;Either list can include arbitrary regexps. The newsgroups are sorted
;alphabetically, but weighted by the above priorities. So for example given
;the above variables you'd get "comp.ai" before "comp.emacs.gnus" before
;"comp.arch" (say).
;
;If you don't care about priorities, you can leave these variables alone and
;stay with regular alphabetical order.
;
;Code follows:
;
;----- cut ----- cut ----- cut ----- cut ----- cut ----- cut ----- cut -----
;; GNUS-PRIORITY.EL
;; Copyleft (c) Ashwin Ram, 7/1/90. Usual GNU rules apply.
;;
;; Code to allow GNUS to maintain .newsrc in order of priority of newsgroups.
;; Default order is alphabetical, but certain type hierarchies (e.g., "comp")
;; or certain newsgroup name substrings (e.g., "ai") can be boosted up if
;; desired.
;;
;; How to customize:
;; (setq newsgroup-type-priority-list ...)
;; (setq newsgroup-name-priority-list ...)
;;
;; How to use:
;; (require 'gnus-priority)
;; Manually, in .newsrc buffer: M-x newsrc-sort
;; To have new newsgroups inserted in the appropriate position automatically:
;; (setq gnus-subscribe-newsgroup-method
;; (function
;; (lambda (newsgroup)
;; (gnus-subscribe-newsgroup newsgroup
;; (car (find '(lambda (n) (newsgroup< newsgroup (car n)))
;; gnus-newsrc-assoc))))))
;; Variables for customization
;; ---------------------------
;; Example:
;;
;; To read "comp" groups first, then "soc" groups, then "sci" groups, and
;; everything else alphabetically:
;; (setq newsgroup-type-priority-list '("comp" "sci" "soc"))
;;
;; To read "general" groups first, then groups about "ai", then groups
;; about "gnus", and everything else alphabetically:
;; (setq newsgroup-name-priority-list '("\\.general" "\\.ai"))
;;
;; Either list can include arbitrary regexps. The newsgroups are sorted
;; alphabetically, but weighted by the above priorities. So for example
;; given the above variables you'd get "comp.ai" before "comp.emacs.gnus"
;; before "comp.arch" (say).
;;
;; If you don't care about priorities, you can leave these variables alone
;; and stay with regular alphabetical order.
(defvar newsgroup-type-priority-list nil
"List of newsgroup type/hierarchy names in descending order of priority.
Types not mentioned are of zero priority. See also newsgroup-name-priority-list.")
(defvar newsgroup-name-priority-list nil
"List of newsgroup name components/substrings in descending order of priority.
Components not mentioned are of zero priority. See also newsgroup-type-priority-list.")
;; Main prioritization functions
;; -----------------------------
(defun newsgroup< (a b)
"Newsgroup A comes before newsgroup B if it is higher priority.
If priorities are equal, alphabetical order is used."
(let ((pa (newsgroup-priority a))
(pb (newsgroup-priority b)))
(cond ((> pa pb) t)
((= pa pb) (string< a b))
(t nil))))
(defun newsgroup-priority (newsgroup)
(let* ((newsgroup-type
(and (string-match "^[^.]*\\." newsgroup)
(substring newsgroup 0 (- (match-end 0) 1))))
(newsgroup-type-index (mem 'equal newsgroup-type newsgroup-type-priority-list))
(newsgroup-name-index (mem '(lambda (a b) (string-match b a)) newsgroup newsgroup-name-priority-list)))
(+ (* (length newsgroup-type-priority-list)
(if newsgroup-type-index (length newsgroup-type-index) 0))
(if newsgroup-name-index (length newsgroup-name-index) 0))))
;; Main user functions.
;; --------------------
(defun newsrc-sort ()
"Sort newsgroups in .newsrc using newsgroup< predicate."
(interactive)
(require 'sort)
; (find-file "~/.newsrc")
(save-excursion
(goto-char (point-min))
(message "Sorting newsrc (finding sort keys)...")
(let* ((sort-lists (sort-build-lists 'forward-line 'end-of-line nil nil))
(old (reverse sort-lists)))
(cond ((null sort-lists) nil)
(t (message "Sorting newsrc (sorting records)...")
(setq sort-lists
(sort sort-lists
(function
(lambda (a b) (newsgroup< (car a) (car b))))))))
(message "Sorting newsrc (reordering buffer)...")
(sort-reorder-buffer sort-lists old)
(message "Sorting newsrc... done"))))
;; Uncomment this if you want new newsgroups to be placed at the
;; appropriate position automatically.
;;
;; (setq gnus-subscribe-newsgroup-method
;; (function
;; (lambda (newsgroup)
;; (gnus-subscribe-newsgroup newsgroup
;; (car (find '(lambda (n) (newsgroup< newsgroup (car n)))
;; gnus-newsrc-assoc))))))
;; Simple Lisp utilities.
;; ----------------------
(defun find (pred l)
(while (not (funcall pred (car l)))
(setq l (cdr l)))
(car l))
(defun mem (pred x l)
(let ((done nil))
(while (and l (not done))
(if (funcall pred x (car l))
(setq done t)
(setq l (cdr l))))
l))
(provide 'gnus-priority)
;; End of GNUS-PRIORITY.EL
;----- cut ----- cut ----- cut ----- cut ----- cut ----- cut ----- cut -----
;
;Hope this helps. Improvements welcome.
;
;Ashwin Ram <ashwin@cc.gatech.edu>
;College of Computing
;Georgia Institute of Technology, Atlanta, Georgia 30332-0280
Re: fine-grained control of sorting in newsgroups
Author: Garrett Wollman
Date: Wed, 11 Sep 1991 16:20
Date: Wed, 11 Sep 1991 16:20
29 lines
1905 bytes
1905 bytes
In article <EMV.91Sep10163653@cato.aa.ox.com> emv@msen.com (Ed Vielmetti) writes: >GNUS might be able to do this with a proper sort hook, but I don't >hack elisp.... I was considering doing something like this for trn, but eventually decided that I didn't have the time, etc. Basically my idea was to invent a clipping language, along the lines of Brad Templeton's NewsClip. The clipping function for each newsgroup, instead of returning a simple kill/don't kill value for each article, would instead evaluate thread titles based on subject, senders, number of responses, etc.; it would return a score from 0 to 1000 (does this start to sound familiar?) which would then be used as a sort key intead of the thread number. Thus, you might... "TLA" subject contains "Henry Spencer" sender contains or 1000 return "Nick Szabo" sender contains -1 return # kill articles from Nick instead of your usual kill file mechanism. -GAWollman -- Garrett A. Wollman - wollman@emily.uvm.edu - uvm-gen!wollman Disclaimer: I'm not even sure this represents *my* opinion, never mind UVM's, EMBA's, EMBA-CF's, or indeed anyone else's.
Re: fine-grained control of sorting in newsgroups
Author: Brad Templeton
Date: Wed, 11 Sep 1991 19:23
Date: Wed, 11 Sep 1991 19:23
8 lines
1030 bytes
1030 bytes
NewsClip already works on assigning a value to an article, but now all it does is test if the value is greater than zero for read/don't read. If a newsreader comes along that can use the value and sort on it, then this becomes more valuable. -- Brad Templeton, ClariNet Communications Corp. -- Waterloo, Ontario 519/884-7473
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