Own gnus-thread-score-function: If any followup have positive score assign
authorOleksandr Gavenko <gavenkoa@gmail.com>
Tue, 28 Aug 2012 22:48:16 +0300
changeset 919 fcd73bc6b91c
parent 918 f7a88390ec90
child 920 91e961e6627e
Own gnus-thread-score-function: If any followup have positive score assign greater available score to thread, else assign lesser available score.
.emacs-my
--- a/.emacs-my	Fri Aug 24 21:08:18 2012 +0300
+++ b/.emacs-my	Tue Aug 28 22:48:16 2012 +0300
@@ -1522,6 +1522,20 @@
      (add-hook 'message-sent-hook 'gnus-score-followup-thread)
      ))
 
+(defun my-gnus-thread-score-function (&rest scores)
+  "If any followup have positive score assign greater available
+score to thread, else assign lesser available score."
+  (let ( (max (apply 'max scores)) (min (apply 'min scores)) )
+    (if (< 0 max) max min)))
+(setq gnus-thread-score-function #'my-gnus-thread-score-function)
+(defun my-gnus-thread-total-score ()
+  "Helper to debug `gnus-thread-score-function' function."
+  (interactive)
+  (message
+   (int-to-string
+    (gnus-thread-total-score
+     (gnus-id-to-thread (mail-header-id (gnus-summary-article-header)))))))
+
 ;; Especially highlight my message and replays to me.
 (eval-after-load 'gnus-sum
   '(progn