From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/2009 Path: news.gmane.org!not-for-mail From: Hubert Canon Newsgroups: gmane.emacs.gnus.user Subject: better gnus-thread-score-function Date: Thu, 30 Jan 2003 15:24:41 +0000 Organization: Inforama, Sophia Antipolis Message-ID: <85bs1yy81y.fsf.Hubert.Canon@free.fr> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1138668593 13514 80.91.229.2 (31 Jan 2006 00:49:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 00:49:53 +0000 (UTC) Original-X-From: nobody Tue Jan 17 17:30:02 2006 Original-Path: quimby.gnus.org!newsfeed1.e.nsc.no!nsc.no!nextra.com!news.tele.dk!news.tele.dk!small.news.tele.dk!fr.usenet-edu.net!usenet-edu.net!proxad.net!feeder2-1.proxad.net!news3-1.free.fr!not-for-mail Original-Newsgroups: gnu.emacs.gnus X-Accept-Language: fr,fr-BE,en,en-UK,en-US,de,ar,tr,it X-Troll: ya des chances... X-Comment: membre du CAS, du GASDPQL, du MACQPAD et du MMQLPI User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (sparc-sun-solaris2.7) X-Face: +6ROl)bD3}7=jo{T&\>oU+kz,Rj"Tpo5Sc\BG1$HVG!_Z05$,c"!Wf+f1U/FZ)fZdAA9 Hi all ! [please excuse me english, it is not my mother tongue] I use adaptive scoring and I sort by total thread score. I didn't find a suitable gnus-thread-score-function. I used to use '+ but it gives too much importance to big threads, and 'max is not so good because one good author in a bad thread lift it up too much. So I tried to do my own : I wanted to give the thread the mean score. Here is my try : (defvar my-gnus-thread-score-function-divisor ;;; we hope that there will not be more than 100000 articles in a thread 100000) (defun my-gnus-thread-score-function-nb-articles (x) (floor (+ 0.5 (* (- x (floor x)) my-gnus-thread-score-function-divisor)))) (defun my-gnus-thread-score-function (article-score &rest subthread-scores) ;;; the result is the mean with the number of articles in the ;;; thread in the fractionnal part. (if subthread-scores (let ((total-article-number (apply '+ 1.0 (mapcar 'my-gnus-thread-score-function-nb-articles subthread-scores)))) (+ (ceiling (apply '+ article-score subthread-scores) total-article-number) (/ total-article-number my-gnus-thread-score-function-divisor))) (+ (float article-score) (/ 1.0 my-gnus-thread-score-function-divisor)))) (setq gnus-thread-score-function 'my-gnus-thread-score-function) I tested a bit, and it seems to give the expected value. What do you think ?