diff options
author | Gerd Moellmann <gerd@gnu.org> | 2000-09-19 13:37:09 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2000-09-19 13:37:09 +0000 |
commit | 16409b0bb832ae376894cbad5892bf7623caeaaf (patch) | |
tree | 7a795d31e621510c8720e8956f248cc758dc2058 /lisp/gnus/gnus-nocem.el | |
parent | ce9ded5de26ead5cc69bd9179662c2d6600f7500 (diff) | |
download | emacs-16409b0bb832ae376894cbad5892bf7623caeaaf.tar.gz |
Update to emacs-21-branch of the Gnus CVS repository.
Diffstat (limited to 'lisp/gnus/gnus-nocem.el')
-rw-r--r-- | lisp/gnus/gnus-nocem.el | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/lisp/gnus/gnus-nocem.el b/lisp/gnus/gnus-nocem.el index 1020c729880..597228d5f6f 100644 --- a/lisp/gnus/gnus-nocem.el +++ b/lisp/gnus/gnus-nocem.el @@ -1,5 +1,6 @@ ;;; gnus-nocem.el --- NoCeM pseudo-cancellation treatment -;; Copyright (C) 1995,96,97,98 Free Software Foundation, Inc. + +;; Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> ;; Keywords: news @@ -27,8 +28,6 @@ (eval-when-compile (require 'cl)) -(eval-when-compile (require 'cl)) - (require 'gnus) (require 'nnmail) (require 'gnus-art) @@ -52,8 +51,7 @@ "clewis@ferret.ocunix.on.ca" ; Chris Lewis "jem@xpat.com" ; Despammer from Korea "snowhare@xmission.com" ; Benjamin "Snowhare" Franz - "red@redpoll.mrfs.oh.us (Richard E. Depew)" ; ARMM! ARMM! - ) + "red@redpoll.mrfs.oh.us (Richard E. Depew)") ; ARMM! ARMM! "*List of NoCeM issuers to pay attention to. This can also be a list of `(ISSUER CONDITIONS)' elements." @@ -123,7 +121,7 @@ matches an previously scanned and verified nocem message." (interactive) (let ((groups gnus-nocem-groups) (gnus-inhibit-demon t) - group active gactive articles) + group active gactive articles check-headers) (gnus-make-directory gnus-nocem-directory) ;; Load any previous NoCeM headers. (gnus-nocem-load-cache) @@ -148,7 +146,7 @@ matches an previously scanned and verified nocem message." (save-excursion (let ((dependencies (make-vector 10 nil)) headers header) - (nnheader-temp-write nil + (with-temp-buffer (setq headers (if (eq 'nov (gnus-retrieve-headers @@ -175,7 +173,14 @@ matches an previously scanned and verified nocem message." (null (mail-header-references header))) (not (member (mail-header-message-id header) gnus-nocem-seen-message-ids)))) - (gnus-nocem-check-article group header))))))) + (push header check-headers))) + (let ((i 0) + (len (length check-headers))) + (dolist (h check-headers) + (gnus-message + 7 "Checking article %d in %s for NoCeM (%d of %d)..." + (mail-header-number h) group (incf i) len) + (gnus-nocem-check-article group h))))))) (setq gnus-nocem-active (cons (list group gactive) (delq (assoc group gnus-nocem-active) @@ -187,14 +192,12 @@ matches an previously scanned and verified nocem message." (defun gnus-nocem-check-article (group header) "Check whether the current article is an NCM article and that we want it." ;; Get the article. - (gnus-message 7 "Checking article %d in %s for NoCeM..." - (mail-header-number header) group) (let ((date (mail-header-date header)) issuer b e type) (when (or (not date) - (nnmail-time-less - (nnmail-time-since (nnmail-date-to-time date)) - (nnmail-days-to-time gnus-nocem-expiry-wait))) + (time-less-p + (time-since (date-to-time date)) + (days-to-time gnus-nocem-expiry-wait))) (gnus-request-article-this-buffer (mail-header-number header) group) (goto-char (point-min)) (when (re-search-forward "-----BEGIN PGP MESSAGE-----" nil t) @@ -273,7 +276,7 @@ matches an previously scanned and verified nocem message." gnus-nocem-real-group-hashtb) ;; Valid group. (beginning-of-line) - (while (= (following-char) ?\t) + (while (eq (char-after) ?\t) (forward-line -1)) (setq id (buffer-substring (point) (1- (search-forward "\t")))) (unless (gnus-gethash id gnus-nocem-hashtb) @@ -281,7 +284,7 @@ matches an previously scanned and verified nocem message." (gnus-sethash id t gnus-nocem-hashtb) (push id ncm)) (forward-line 1) - (while (= (following-char) ?\t) + (while (eq (char-after) ?\t) (forward-line 1)))))) (when ncm (setq gnus-nocem-touched-alist t) @@ -304,13 +307,13 @@ matches an previously scanned and verified nocem message." "Save the NoCeM cache." (when (and gnus-nocem-alist gnus-nocem-touched-alist) - (nnheader-temp-write (gnus-nocem-cache-file) + (with-temp-file (gnus-nocem-cache-file) (gnus-prin1 `(setq gnus-nocem-alist ',gnus-nocem-alist))) (setq gnus-nocem-touched-alist nil))) (defun gnus-nocem-save-active () "Save the NoCeM active file." - (nnheader-temp-write (gnus-nocem-active-file) + (with-temp-file (gnus-nocem-active-file) (gnus-prin1 `(setq gnus-nocem-active ',gnus-nocem-active)))) (defun gnus-nocem-alist-to-hashtb () @@ -318,11 +321,11 @@ matches an previously scanned and verified nocem message." (let* ((alist gnus-nocem-alist) (pprev (cons nil alist)) (prev pprev) - (expiry (nnmail-days-to-time gnus-nocem-expiry-wait)) + (expiry (days-to-time gnus-nocem-expiry-wait)) entry) (setq gnus-nocem-hashtb (gnus-make-hashtable (* (length alist) 51))) (while (setq entry (car alist)) - (if (not (nnmail-time-less (nnmail-time-since (car entry)) expiry)) + (if (not (time-less-p (time-since (car entry)) expiry)) ;; This entry has expired, so we remove it. (setcdr prev (cdr alist)) (setq prev alist) |