Gnus development mailing list
 help / color / mirror / Atom feed
* spam-marked patch (need feedback)
@ 2002-07-11 14:04 Ted Zlatanov
  2002-07-13 19:37 ` Kai Großjohann
  0 siblings, 1 reply; 4+ messages in thread
From: Ted Zlatanov @ 2002-07-11 14:04 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 856 bytes --]

Attached is a patch against gnus-sum.el to introduce the spam mark as
an exclusive (primary) mark.  The patch also creates a variable
gnus-newsgroup-spam-marked which will have the number of articles
marked as spam; a %h parameter for the summary format line is
introduced to show the number of articles marked as spam.  I know the
name of gnus-newsgroup-spam-marked is awkward, but I was trying to be
consistent with the other variable names (gnus-newsgroup-spam would
have been too vague).

This being the first time I've delved into the Gnus internals, I'd
appreciate feedback.  Simon Josefsson and Kai were very helpful in
getting me started.

I'm more or less back from my broken hand, so once this patch goes in
I will start on the spam.el functionality I discussed on the list
earlier.  Let me know if I should summarize my plan again.

Thanks
Ted


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: spam-marked.patch --]
[-- Type: text/x-patch, Size: 7550 bytes --]

Index: gnus-sum.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v
retrieving revision 6.216
diff -c -r6.216 gnus-sum.el
*** gnus-sum.el	2002/07/09 13:24:14	6.216
--- gnus-sum.el	2002/07/09 21:04:51
***************
*** 542,548 ****
    :type 'boolean)
  
  (defcustom gnus-auto-expirable-marks
!   (list gnus-spam-mark gnus-killed-mark gnus-del-mark gnus-catchup-mark
  	gnus-low-score-mark gnus-ancient-mark gnus-read-mark
  	gnus-souped-mark gnus-duplicate-mark)
    "*The list of marks converted into expiration if a group is auto-expirable."
--- 542,548 ----
    :type 'boolean)
  
  (defcustom gnus-auto-expirable-marks
!   (list gnus-killed-mark gnus-del-mark gnus-catchup-mark
  	gnus-low-score-mark gnus-ancient-mark gnus-read-mark
  	gnus-souped-mark gnus-duplicate-mark)
    "*The list of marks converted into expiration if a group is auto-expirable."
***************
*** 1133,1138 ****
--- 1133,1139 ----
      (?u gnus-tmp-user-defined ?s)
      (?d (length gnus-newsgroup-dormant) ?d)
      (?t (length gnus-newsgroup-marked) ?d)
+     (?h (length gnus-newsgroup-spam-marked) ?d)
      (?r (length gnus-newsgroup-reads) ?d)
      (?z (gnus-summary-article-score gnus-tmp-article-number) ?d)
      (?E gnus-newsgroup-expunged-tally ?d)
***************
*** 1172,1177 ****
--- 1173,1181 ----
  (defvar gnus-newsgroup-marked nil
    "Sorted list of ticked articles in the current newsgroup (a subset of unread art).")
  
+ (defvar gnus-newsgroup-spam-marked nil
+   "List of ranges of articles that have been marked as spam.")
+ 
  (defvar gnus-newsgroup-killed nil
    "List of ranges of articles that have been through the scoring process.")
  
***************
*** 1257,1262 ****
--- 1261,1267 ----
      gnus-newsgroup-last-folder gnus-newsgroup-last-file
      gnus-newsgroup-auto-expire gnus-newsgroup-unreads
      gnus-newsgroup-unselected gnus-newsgroup-marked
+     gnus-newsgroup-spam-marked
      gnus-newsgroup-reads gnus-newsgroup-saved
      gnus-newsgroup-replied gnus-newsgroup-forwarded
      gnus-newsgroup-recent
***************
*** 2730,2735 ****
--- 2735,2741 ----
  (defun gnus-article-read-p (article)
    "Say whether ARTICLE is read or not."
    (not (or (memq article gnus-newsgroup-marked)
+ 	   (memq article gnus-newsgroup-spam-marked)
  	   (memq article gnus-newsgroup-unreads)
  	   (memq article gnus-newsgroup-unselected)
  	   (memq article gnus-newsgroup-dormant))))
***************
*** 2835,2840 ****
--- 2841,2847 ----
      ((memq ,number gnus-newsgroup-downloadable) gnus-downloadable-mark)
      ((memq ,number gnus-newsgroup-unreads) gnus-unread-mark)
      ((memq ,number gnus-newsgroup-marked) gnus-ticked-mark)
+     ((memq ,number gnus-newsgroup-spam-marked) gnus-spam-mark)
      ((memq ,number gnus-newsgroup-dormant) gnus-dormant-mark)
      ((memq ,number gnus-newsgroup-expirable) gnus-expirable-mark)
      (t (or (cdr (assq ,number gnus-newsgroup-reads))
***************
*** 2975,2980 ****
--- 2982,2988 ----
      (setq gnus-summary-buffer (current-buffer))
      (let ((name gnus-newsgroup-name)
  	  (marked gnus-newsgroup-marked)
+ 	  (spam gnus-newsgroup-spam-marked)
  	  (unread gnus-newsgroup-unreads)
  	  (headers gnus-current-headers)
  	  (data gnus-newsgroup-data)
***************
*** 2997,3002 ****
--- 3005,3011 ----
  	(set-buffer gnus-group-buffer)
  	(setq gnus-newsgroup-name name
  	      gnus-newsgroup-marked marked
+ 	      gnus-newsgroup-spam-marked spam
  	      gnus-newsgroup-unreads unread
  	      gnus-current-headers headers
  	      gnus-newsgroup-data data
***************
*** 4950,4955 ****
--- 4959,4966 ----
      (cond
       ((eq type 'tick)
        (memq article gnus-newsgroup-marked))
+      ((eq type 'spam)
+       (memq article gnus-newsgroup-spam-marked))
       ((eq type 'unsend)
        (memq article gnus-newsgroup-unsendable))
       ((eq type 'undownload)
***************
*** 9314,9319 ****
--- 9325,9331 ----
    (let ((article (gnus-summary-article-number)))
      (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
      (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
+     (setq gnus-newsgroup-spam-marked (delq article gnus-newsgroup-spam-marked))
      (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
      (push (cons article mark) gnus-newsgroup-reads)
      ;; Possibly remove from cache, if that is used.
***************
*** 9345,9350 ****
--- 9357,9363 ----
  	    (gnus-error 1 "Can't mark negative article numbers")
  	    nil)
  	(setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
+ 	(setq gnus-newsgroup-spam-marked (delq article gnus-newsgroup-spam-marked))
  	(setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
  	(setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))
  	(setq gnus-newsgroup-reads (delq article gnus-newsgroup-reads))
***************
*** 9352,9357 ****
--- 9365,9374 ----
  	       (setq gnus-newsgroup-marked
  		     (gnus-add-to-sorted-list gnus-newsgroup-marked
  					      article)))
+ 	      ((= mark gnus-spam-mark)
+ 	       (setq gnus-newsgroup-spam-marked
+ 		     (gnus-add-to-sorted-list gnus-newsgroup-spam-marked
+ 					      article)))
  	      ((= mark gnus-dormant-mark)
  	       (setq gnus-newsgroup-dormant
  		     (gnus-add-to-sorted-list gnus-newsgroup-dormant
***************
*** 9403,9408 ****
--- 9420,9426 ----
  	(error "No article on current line"))
        (if (not (if (or (= mark gnus-unread-mark)
  		       (= mark gnus-ticked-mark)
+ 		       (= mark gnus-spam-mark)
  		       (= mark gnus-dormant-mark))
  		   (gnus-mark-article-as-unread article mark)
  		 (gnus-mark-article-as-read article mark)))
***************
*** 9476,9481 ****
--- 9494,9500 ----
      ;; Remove from unread and marked lists.
      (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
      (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
+     (setq gnus-newsgroup-spam-marked (delq article gnus-newsgroup-spam-marked))
      (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
      (push (cons article mark) gnus-newsgroup-reads)
      ;; Possibly remove from cache, if that is used.
***************
*** 9491,9496 ****
--- 9510,9516 ----
  	  (gnus-error 1 "Can't mark negative article numbers")
  	  nil)
        (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)
+ 	    gnus-newsgroup-spam-marked (delq article gnus-newsgroup-spam-marked)
  	    gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)
  	    gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)
  	    gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
***************
*** 9502,9507 ****
--- 9522,9530 ----
        (cond ((= mark gnus-ticked-mark)
  	     (setq gnus-newsgroup-marked
  		   (gnus-add-to-sorted-list gnus-newsgroup-marked article)))
+ 	    ((= mark gnus-spam-mark)
+ 	     (setq gnus-newsgroup-spam-marked
+ 		   (gnus-add-to-sorted-list gnus-newsgroup-spam-marked article)))
  	    ((= mark gnus-dormant-mark)
  	     (setq gnus-newsgroup-dormant
  		   (gnus-add-to-sorted-list gnus-newsgroup-dormant article)))
***************
*** 9715,9720 ****
--- 9738,9744 ----
  	      (progn
  		(when all
  		  (setq gnus-newsgroup-marked nil
+ 			gnus-newsgroup-spam-marked nil
  			gnus-newsgroup-dormant nil))
  		(setq gnus-newsgroup-unreads gnus-newsgroup-downloadable))
  	    ;; We actually mark all articles as canceled, which we

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

* Re: spam-marked patch (need feedback)
  2002-07-11 14:04 spam-marked patch (need feedback) Ted Zlatanov
@ 2002-07-13 19:37 ` Kai Großjohann
  2002-07-13 23:44   ` Ted Zlatanov
  0 siblings, 1 reply; 4+ messages in thread
From: Kai Großjohann @ 2002-07-13 19:37 UTC (permalink / raw)


I'm applying the patch.  I haven't tested it, though.  (Or do you
have CVS access and just didn't want it committed?)

Do you mind to provide a ChangeLog entry next time?  I'm sooo lazy...

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)



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

* Re: spam-marked patch (need feedback)
  2002-07-13 19:37 ` Kai Großjohann
@ 2002-07-13 23:44   ` Ted Zlatanov
  2002-07-14 12:52     ` Kai Großjohann
  0 siblings, 1 reply; 4+ messages in thread
From: Ted Zlatanov @ 2002-07-13 23:44 UTC (permalink / raw)


On Sat, 13 Jul 2002, Kai.Grossjohann@CS.Uni-Dortmund.DE wrote:
> I'm applying the patch.  I haven't tested it, though.  (Or do you
> have CVS access and just didn't want it committed?)

I just need a sanity check, since it would be my first time committing
to CVS.  Does it work for you?  Can you mark a message as spam, and
then see it consistently in the gnus-newsgroup-spam-marked lis?  Does
the list get cleared when you exit the newsgroup? (spam message get
marked as 'O'ld now, but will probably be marked as expired when I
write the spam processing function).

> Do you mind to provide a ChangeLog entry next time?  I'm sooo
> lazy...

No problem, when I commit I'll add to the ChangeLog as well.

Thanks
Ted




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

* Re: spam-marked patch (need feedback)
  2002-07-13 23:44   ` Ted Zlatanov
@ 2002-07-14 12:52     ` Kai Großjohann
  0 siblings, 0 replies; 4+ messages in thread
From: Kai Großjohann @ 2002-07-14 12:52 UTC (permalink / raw)


Ted Zlatanov <teodor.zlatanov@divine.com> writes:

> I just need a sanity check, since it would be my first time committing
> to CVS.  Does it work for you?  Can you mark a message as spam, and
> then see it consistently in the gnus-newsgroup-spam-marked lis?  Does
> the list get cleared when you exit the newsgroup? (spam message get
> marked as 'O'ld now, but will probably be marked as expired when I
> write the spam processing function).

I did what you described and got the behavior you described.  So
everything appears to be cool :-)

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)



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

end of thread, other threads:[~2002-07-14 12:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-11 14:04 spam-marked patch (need feedback) Ted Zlatanov
2002-07-13 19:37 ` Kai Großjohann
2002-07-13 23:44   ` Ted Zlatanov
2002-07-14 12:52     ` 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).