From: Ted Zlatanov <teodor.zlatanov@divine.com>
Subject: spam-marked patch (need feedback)
Date: Thu, 11 Jul 2002 10:04:19 -0400 [thread overview]
Message-ID: <m3wus2qs2k.fsf@onyx.nimbus.northernlight.com> (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
next reply other threads:[~2002-07-11 14:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-11 14:04 Ted Zlatanov [this message]
2002-07-13 19:37 ` Kai Großjohann
2002-07-13 23:44 ` Ted Zlatanov
2002-07-14 12:52 ` Kai Großjohann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3wus2qs2k.fsf@onyx.nimbus.northernlight.com \
--to=teodor.zlatanov@divine.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).