Gnus development mailing list
 help / color / mirror / Atom feed
* Suggestion for Summary highlighting
@ 2001-05-22  1:44 Nevin Kapur
  2001-05-24 13:02 ` Kai Großjohann
  0 siblings, 1 reply; 9+ messages in thread
From: Nevin Kapur @ 2001-05-22  1:44 UTC (permalink / raw)


Currently, the highlighting of high/low scored articles in the
*Summary* buffer is controlled by whether their score is higher/lower
than gnus-summary-default-score.

It would be nice if one could instead specify a range, so that if an
article's was greater than the a specified threshold it would be
highlighted as high and if it were lower than a different specified
threshold, it would be highlighted as low, with no highlighting in
between. For example, one could specify the higher threshold as 10 and
lower as -10, in effect introducing a gray region of scores that were
neither high nor low.

Of course this is currently possible by setting gnus-summary-highlight
appropriately. The following patch makes available two variables
gnus-summary-default-high-score and gnus-summary-default-low-score
that implement this functionality. With their default values as 0, the
highlighting proceeds as normal. I don't think will break any existing
code.

I am submitting it for review for inclusion.

Index: lisp/gnus-sum.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v
retrieving revision 6.67
diff -u -r6.67 gnus-sum.el
--- lisp/gnus-sum.el	2001/05/01 17:09:44	6.67
+++ lisp/gnus-sum.el	2001/05/21 01:40:33
@@ -199,6 +199,20 @@
   :type '(choice (const :tag "disable")
 		 integer))
 
+(defcustom gnus-summary-default-high-score 0
+  "*Default threshold for a high scored article.
+An article will be highlighted as high scored if its score is greater
+than this score."
+  :group 'gnus-score-default
+  :type 'integer)
+
+(defcustom gnus-summary-default-low-score 0
+  "*Default threshold for a low scored article.
+An article will be highlighted as low scored if its score is smaller
+than this score."
+  :group 'gnus-score-default
+  :type 'integer)
+
 (defcustom gnus-summary-zcore-fuzz 0
   "*Fuzziness factor for the zcore in the summary buffer.
 Articles with scores closer than this to `gnus-summary-default-score'
@@ -791,33 +805,33 @@
 (defcustom gnus-summary-highlight
   '(((= mark gnus-canceled-mark)
      . gnus-summary-cancelled-face)
-    ((and (> score default)
+    ((and (> score default-high)
 	  (or (= mark gnus-dormant-mark)
 	      (= mark gnus-ticked-mark)))
      . gnus-summary-high-ticked-face)
-    ((and (< score default)
+    ((and (< score default-low)
 	  (or (= mark gnus-dormant-mark)
 	      (= mark gnus-ticked-mark)))
      . gnus-summary-low-ticked-face)
     ((or (= mark gnus-dormant-mark)
 	 (= mark gnus-ticked-mark))
      . gnus-summary-normal-ticked-face)
-    ((and (> score default) (= mark gnus-ancient-mark))
+    ((and (> score default-high) (= mark gnus-ancient-mark))
      . gnus-summary-high-ancient-face)
-    ((and (< score default) (= mark gnus-ancient-mark))
+    ((and (< score default-low) (= mark gnus-ancient-mark))
      . gnus-summary-low-ancient-face)
     ((= mark gnus-ancient-mark)
      . gnus-summary-normal-ancient-face)
-    ((and (> score default) (= mark gnus-unread-mark))
+    ((and (> score default-high) (= mark gnus-unread-mark))
      . gnus-summary-high-unread-face)
-    ((and (< score default) (= mark gnus-unread-mark))
+    ((and (< score default-low) (= mark gnus-unread-mark))
      . gnus-summary-low-unread-face)
     ((= mark gnus-unread-mark)
      . gnus-summary-normal-unread-face)
-    ((and (> score default) (memq mark (list gnus-downloadable-mark
+    ((and (> score default-high) (memq mark (list gnus-downloadable-mark
 					     gnus-undownloaded-mark)))
      . gnus-summary-high-unread-face)
-    ((and (< score default) (memq mark (list gnus-downloadable-mark
+    ((and (< score default-low) (memq mark (list gnus-downloadable-mark
 					     gnus-undownloaded-mark)))
      . gnus-summary-low-unread-face)
     ((and (memq mark (list gnus-downloadable-mark gnus-undownloaded-mark))
@@ -825,9 +839,9 @@
      . gnus-summary-normal-unread-face)
     ((memq mark (list gnus-downloadable-mark gnus-undownloaded-mark))
      . gnus-summary-normal-read-face)
-    ((> score default)
+    ((> score default-high)
      . gnus-summary-high-read-face)
-    ((< score default)
+    ((< score default-low)
      . gnus-summary-low-read-face)
     (t
      . gnus-summary-normal-read-face))
@@ -840,10 +854,12 @@
 
 You can use the following variables in the FORM field.
 
-score:   The articles score
-default: The default article score.
-below:   The score below which articles are automatically marked as read.
-mark:    The articles mark."
+score:        The article's score
+default:      The default article score.
+default-high: The default score for high scored articles.
+default-low:  The default score for low scored articles.
+below:        The score below which articles are automatically marked as read.
+mark:         The articles mark."
   :group 'gnus-summary-visual
   :type '(repeat (cons (sexp :tag "Form" nil)
 		       face)))
@@ -9955,7 +9971,9 @@
 	 (mark (or (gnus-summary-article-mark) gnus-unread-mark))
 	 (inhibit-read-only t))
     ;; Eval the cars of the lists until we find a match.
-    (let ((default gnus-summary-default-score))
+    (let ((default gnus-summary-default-score)
+	  (default-high gnus-summary-default-high-score)
+	  (default-low gnus-summary-default-low-score))
       (while (and list
 		  (not (eval (caar list))))
 	(setq list (cdr list))))

-- 
Nevin


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-05-27 20:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-22  1:44 Suggestion for Summary highlighting Nevin Kapur
2001-05-24 13:02 ` Kai Großjohann
2001-05-24 14:15   ` Nevin Kapur
2001-05-24 17:46   ` Colin Walters
2001-05-24 22:13     ` Kai Großjohann
2001-05-24 22:25       ` Nevin Kapur
2001-05-27 14:10   ` Raja R Harinath
2001-05-27 14:32     ` Nevin Kapur
2001-05-27 20:03     ` Kai Großjohann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).