Re: spam.el: copy/move of ham articles from unclassified groups
  Home FAQ Contact Sign in
gnu.emacs.gnus only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: spam.el: copy/move of ham articles from unclassified groups         

Group: gnu.emacs.gnus · Group Profile
Author: Tim Howe
Date: Apr 21, 2007 11:04

Tim Howe quadium.net> writes:
> I'm thinking what I will do is implement an interactive function which
> overrides the ! key in the raw groups. It will remove all marks and
> move the article into nnml:misc.

For the record here is what I came up with:

(defun gnus-summary-unread-and-hammify-article ()
(interactive)
(gnus-summary-clear-mark-forward 1)
(gnus-summary-move-article nil "nnml:misc"))

(defun gnus-summary-process-mark-all-extant ()
(interactive)
(save-excursion
(let ((beg (point-min))
(end (point-max)))
(goto-char beg)
(while (< (point) end)
(let ((article-number (gnus-summary-article-number)))
(unless (char= (gnus-summary-article-mark article-number) ?G)
(gnus-summary-set-process-mark article-number)))
(forward-line 1))))
(gnus-summary-position-point))

(defun gnus-summary-maybe-unread-and-hammify-article ()
(interactive)
(if (string-match "^nnml:raw\\(\\..*\\)?" gnus-newsgroup-name)
(gnus-summary-unread-and-hammify-article)
(gnus-summary-tick-article)))

(defun gnus-summary-mark-all-as-spam-and-exit ()
(interactive)
(when (gnus-y-or-n-p "Mark everything as spam? ")
(gnus-uu-unmark-buffer)
(gnus-summary-process-mark-all-extant)
(dolist (article (gnus-summary-work-articles nil))
(gnus-summary-goto-subject article)
(gnus-summary-mark-as-spam 1))
(gnus-uu-unmark-buffer)
(gnus-summary-exit)))

(define-key gnus-summary-mode-map
"!" 'gnus-summary-maybe-unread-and-hammify-article)
(define-key gnus-summary-mode-map
"$" 'gnus-summary-mark-all-as-spam-and-exit)

(remove-hook 'gnus-get-top-new-news-hook 'spam-maybe-spam-stat-load)

--
vsync
http://quadium.net/~vsync/

The beauty of Amendment II is that it protects the ability to deal
with both a tyrannical government and a zombie apocalypse.
no comments
diggit! del.icio.us! reddit!