comparison lisp/gnus/gnus-dup.el @ 31716:9968f55ad26e

Update to emacs-21-branch of the Gnus CVS repository.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 19 Sep 2000 13:37:09 +0000
parents 15fc6acbae7a
children 695cf19ef79e d7ddb3e565de
comparison
equal deleted inserted replaced
31715:7c896543d225 31716:9968f55ad26e
1 ;;; gnus-dup.el --- suppression of duplicate articles in Gnus 1 ;;; gnus-dup.el --- suppression of duplicate articles in Gnus
2 ;; Copyright (C) 1996,97,98 Free Software Foundation, Inc. 2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000
3 ;; Free Software Foundation, Inc.
3 4
4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> 5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
5 ;; Keywords: news 6 ;; Keywords: news
6 7
7 ;; This file is part of GNU Emacs. 8 ;; This file is part of GNU Emacs.
27 ;; user reads a copy. This is useful if the server doesn't support 28 ;; user reads a copy. This is useful if the server doesn't support
28 ;; Xref properly, or if the user reads the same group from several 29 ;; Xref properly, or if the user reads the same group from several
29 ;; servers. 30 ;; servers.
30 31
31 ;;; Code: 32 ;;; Code:
32
33 (eval-when-compile (require 'cl))
34 33
35 (eval-when-compile (require 'cl)) 34 (eval-when-compile (require 'cl))
36 35
37 (require 'gnus) 36 (require 'gnus)
38 (require 'gnus-art) 37 (require 'gnus-art)
98 97
99 (defun gnus-dup-save () 98 (defun gnus-dup-save ()
100 "Save the duplicate suppression list." 99 "Save the duplicate suppression list."
101 (when (and gnus-save-duplicate-list 100 (when (and gnus-save-duplicate-list
102 gnus-dup-list-dirty) 101 gnus-dup-list-dirty)
103 (nnheader-temp-write gnus-duplicate-file 102 (with-temp-file gnus-duplicate-file
104 (gnus-prin1 `(setq gnus-dup-list ',gnus-dup-list)))) 103 (gnus-prin1 `(setq gnus-dup-list ',gnus-dup-list))))
105 (setq gnus-dup-list-dirty nil)) 104 (setq gnus-dup-list-dirty nil))
106 105
107 ;;; 106 ;;;
108 ;;; Interface functions 107 ;;; Interface functions
136 "Mark duplicate articles as read." 135 "Mark duplicate articles as read."
137 (unless gnus-dup-list 136 (unless gnus-dup-list
138 (gnus-dup-open)) 137 (gnus-dup-open))
139 (gnus-message 6 "Suppressing duplicates...") 138 (gnus-message 6 "Suppressing duplicates...")
140 (let ((headers gnus-newsgroup-headers) 139 (let ((headers gnus-newsgroup-headers)
140 (auto (and gnus-newsgroup-auto-expire
141 (memq gnus-duplicate-mark gnus-auto-expirable-marks)))
141 number header) 142 number header)
142 (while (setq header (pop headers)) 143 (while (setq header (pop headers))
143 (when (and (intern-soft (mail-header-id header) gnus-dup-hashtb) 144 (when (and (intern-soft (mail-header-id header) gnus-dup-hashtb)
144 (gnus-summary-article-unread-p (mail-header-number header))) 145 (gnus-summary-article-unread-p (mail-header-number header)))
145 (setq gnus-newsgroup-unreads 146 (setq gnus-newsgroup-unreads
146 (delq (setq number (mail-header-number header)) 147 (delq (setq number (mail-header-number header))
147 gnus-newsgroup-unreads)) 148 gnus-newsgroup-unreads))
148 (push (cons number gnus-duplicate-mark) 149 (if (not auto)
149 gnus-newsgroup-reads)))) 150 (push (cons number gnus-duplicate-mark) gnus-newsgroup-reads)
151 (push number gnus-newsgroup-expirable)
152 (push (cons number gnus-expirable-mark) gnus-newsgroup-reads)))))
150 (gnus-message 6 "Suppressing duplicates...done")) 153 (gnus-message 6 "Suppressing duplicates...done"))
151 154
152 (defun gnus-dup-unsuppress-article (article) 155 (defun gnus-dup-unsuppress-article (article)
153 "Stop suppression of ARTICLE." 156 "Stop suppression of ARTICLE."
154 (let ((id (mail-header-id (gnus-data-header (gnus-data-find article))))) 157 (let ((id (mail-header-id (gnus-data-header (gnus-data-find article)))))