info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Tim Howe
Subject: Re: spam.el: copy/move of ham articles from unclassified groups
Date: Sat, 21 Apr 2007 14:04:04 -0400
User-agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.20 (berkeley-unix)

Tim Howe <vsync@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.
        -- Eochada,
           http://forums.fark.com/cgi/fark/comments.pl?IDLink=2749371


reply via email to

[Prev in Thread] Current Thread [Next in Thread]