Mercurial > emacs
annotate lisp/gnus/gnus-dup.el @ 68129:6f5da26b0df1
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-690
Merge from gnus--rel--5.10
Patches applied:
* gnus--rel--5.10 (patch 174-181)
- Update from CVS
- Update from CVS: texi/gnus.texi (RSS): Addition.
2006-01-10 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/nnrss.el (nnrss-wash-html-in-text-plain-parts): New variable.
(nnrss-request-article): Render text/plain parts as HTML.
* lisp/gnus/gnus-art.el (gnus-article-wash-html-with-w3m): No need to narrow
the buffer.
2006-01-08 Reiner Steib <Reiner.Steib@gmx.de>
* lisp/gnus/gnus-cus.el (gnus-group-parameters): Sync posting-style with
custom definition of `gnus-posting-styles'.
* lisp/gnus/gnus-start.el (gnus-gnus-to-quick-newsrc-format): Bind
print-circle. Suggested by Kalle Olavi Niemitalo <kon@iki.fi>.
2006-01-05 Reiner Steib <Reiner.Steib@gmx.de>
* lisp/gnus/gnus-group.el (gnus-useful-groups): Use Gmane for ding. Use
nntp for bug archive.
2006-01-05 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/nnrss.el (nnrss-request-article): Fix the way to fill text/plain
parts.
(nnrss-normalize-date): New function converts ISO 8601 date into
RFC822 style. Suggested by Mark Plaksin <happy@mcplaksin.org>.
(nnrss-check-group): Use it.
2006-01-03 Rodrigo Ventura <yoda@isr.ist.utl.pt> (tiny change)
* lisp/gnus/gnus-xmas.el (gnus-xmas-group-startup-message): Typo
gnus-splash-face -> gnus-splash. Fixes starting from a TTY in
XEmacs.
2006-01-01 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/gnus-sum.el (gnus-summary-work-articles): Remove useless `min'.
* lisp/gnus/nnrss.el (nnrss-fetch): Make it fail gracefully when it can't
fetch a feed. Suggested by Mark Plaksin <happy@mcplaksin.org>.
(nnrss-insert-w3): Ditto.
2005-12-21 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/nnrss.el (nnrss-request-article): Fix last change; fill
text/plain parts.
2005-12-20 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/nnrss.el (nnrss-request-article): Replace <br />s with newlines
in text/plain part.
(nnrss-check-group): Don't add excessive newline to dc:subject.
2005-12-19 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/gnus/gnus-art.el (gnus-article-delete-text-of-type): Enable it to
remove MIME buttons associated with multipart/alternative parts.
(gnus-mime-display-alternative): Tag buttons using `article-type'
text property.
* lisp/gnus/gnus-msg.el (gnus-copy-article-buffer): Remove MIME buttons
associated with multipart/alternative parts.
2005-12-19 Mark Plaksin <happy@mcplaksin.org> (tiny change)
* lisp/gnus/nnrss.el (nnrss-check-group): Put the RSS dc:subject in the
article.
2005-12-18 Lars Magne Ingebrigtsen <larsi@gnus.org>
* lisp/gnus/dns.el (query-dns): Make sure we check the buffer size before
removing tcp headers.
2006-01-10 Katsumi Yamaoka <yamaoka@jpl.org>
* man/gnus.texi (RSS): Document nnrss-wash-html-in-text-plain-parts.
2006-01-06 Katsumi Yamaoka <yamaoka@jpl.org>
* man/gnus.texi (RSS): Addition.
2005-12-22 Katsumi Yamaoka <yamaoka@jpl.org>
* man/gnus.texi (Summary Post Commands): Fix function bound to `S O p'.
2005-12-19 Katsumi Yamaoka <yamaoka@jpl.org>
* man/emacs-mime.texi (Display Customization): Add setting example to
mm-discouraged-alternatives.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 11 Jan 2006 02:03:24 +0000 |
parents | fafd692d1e40 |
children | 1077b8039c32 2d92f5c9d6ae |
rev | line source |
---|---|
17493 | 1 ;;; gnus-dup.el --- suppression of duplicate articles in Gnus |
64754
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
2 |
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, |
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
4 ;; 2005 Free Software Foundation, Inc. |
17493 | 5 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19493
diff
changeset
|
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 7 ;; Keywords: news |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
64085 | 23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 ;; Boston, MA 02110-1301, USA. | |
17493 | 25 |
26 ;;; Commentary: | |
27 | |
28 ;; This package tries to mark articles as read the second time the | |
29 ;; user reads a copy. This is useful if the server doesn't support | |
30 ;; Xref properly, or if the user reads the same group from several | |
31 ;; servers. | |
32 | |
33 ;;; Code: | |
34 | |
19493
8d840c4548c0
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
35 (eval-when-compile (require 'cl)) |
8d840c4548c0
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
36 |
17493 | 37 (require 'gnus) |
38 (require 'gnus-art) | |
39 | |
40 (defgroup gnus-duplicate nil | |
41 "Suppression of duplicate articles." | |
42 :group 'gnus) | |
43 | |
44 (defcustom gnus-save-duplicate-list nil | |
45 "*If non-nil, save the duplicate list when shutting down Gnus. | |
46 If nil, duplicate suppression will only work on duplicates | |
47 seen in the same session." | |
48 :group 'gnus-duplicate | |
49 :type 'boolean) | |
50 | |
51 (defcustom gnus-duplicate-list-length 10000 | |
52 "*The number of Message-IDs to keep in the duplicate suppression list." | |
53 :group 'gnus-duplicate | |
54 :type 'integer) | |
55 | |
56 (defcustom gnus-duplicate-file (nnheader-concat gnus-directory "suppression") | |
57 "*The name of the file to store the duplicate suppression list." | |
58 :group 'gnus-duplicate | |
59 :type 'file) | |
60 | |
61 ;;; Internal variables | |
62 | |
63 (defvar gnus-dup-list nil) | |
64 (defvar gnus-dup-hashtb nil) | |
65 | |
66 (defvar gnus-dup-list-dirty nil) | |
67 | |
68 ;;; | |
69 ;;; Starting and stopping | |
70 ;;; | |
71 | |
72 (gnus-add-shutdown 'gnus-dup-close 'gnus) | |
73 | |
74 (defun gnus-dup-close () | |
75 "Possibly save the duplicate suppression list and shut down the subsystem." | |
76 (gnus-dup-save) | |
77 (setq gnus-dup-list nil | |
78 gnus-dup-hashtb nil | |
79 gnus-dup-list-dirty nil)) | |
80 | |
81 (defun gnus-dup-open () | |
82 "Possibly read the duplicate suppression list and start the subsystem." | |
83 (if gnus-save-duplicate-list | |
84 (gnus-dup-read) | |
85 (setq gnus-dup-list nil)) | |
86 (setq gnus-dup-hashtb (gnus-make-hashtable gnus-duplicate-list-length)) | |
87 ;; Enter all Message-IDs into the hash table. | |
88 (let ((list gnus-dup-list) | |
89 (obarray gnus-dup-hashtb)) | |
90 (while list | |
91 (intern (pop list))))) | |
92 | |
93 (defun gnus-dup-read () | |
94 "Read the duplicate suppression list." | |
95 (setq gnus-dup-list nil) | |
96 (when (file-exists-p gnus-duplicate-file) | |
97 (load gnus-duplicate-file t t t))) | |
98 | |
99 (defun gnus-dup-save () | |
100 "Save the duplicate suppression list." | |
101 (when (and gnus-save-duplicate-list | |
102 gnus-dup-list-dirty) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
103 (with-temp-file gnus-duplicate-file |
17493 | 104 (gnus-prin1 `(setq gnus-dup-list ',gnus-dup-list)))) |
105 (setq gnus-dup-list-dirty nil)) | |
106 | |
107 ;;; | |
108 ;;; Interface functions | |
109 ;;; | |
110 | |
111 (defun gnus-dup-enter-articles () | |
112 "Enter articles from the current group for future duplicate suppression." | |
113 (unless gnus-dup-list | |
114 (gnus-dup-open)) | |
115 (setq gnus-dup-list-dirty t) ; mark list for saving | |
116 (let ((data gnus-newsgroup-data) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
117 datum msgid) |
17493 | 118 ;; Enter the Message-IDs of all read articles into the list |
119 ;; and hash table. | |
120 (while (setq datum (pop data)) | |
121 (when (and (not (gnus-data-pseudo-p datum)) | |
122 (> (gnus-data-number datum) 0) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19493
diff
changeset
|
123 (not (memq (gnus-data-number datum) gnus-newsgroup-unreads)) |
17493 | 124 (not (= (gnus-data-mark datum) gnus-canceled-mark)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
125 (setq msgid (mail-header-id (gnus-data-header datum))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
126 (not (nnheader-fake-message-id-p msgid)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
127 (not (intern-soft msgid gnus-dup-hashtb))) |
17493 | 128 (push msgid gnus-dup-list) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
129 (intern msgid gnus-dup-hashtb)))) |
17493 | 130 ;; Chop off excess Message-IDs from the list. |
131 (let ((end (nthcdr gnus-duplicate-list-length gnus-dup-list))) | |
132 (when end | |
133 (setcdr end nil)))) | |
134 | |
135 (defun gnus-dup-suppress-articles () | |
136 "Mark duplicate articles as read." | |
137 (unless gnus-dup-list | |
138 (gnus-dup-open)) | |
139 (gnus-message 6 "Suppressing duplicates...") | |
140 (let ((headers gnus-newsgroup-headers) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
141 (auto (and gnus-newsgroup-auto-expire |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
142 (memq gnus-duplicate-mark gnus-auto-expirable-marks))) |
17493 | 143 number header) |
144 (while (setq header (pop headers)) | |
145 (when (and (intern-soft (mail-header-id header) gnus-dup-hashtb) | |
146 (gnus-summary-article-unread-p (mail-header-number header))) | |
147 (setq gnus-newsgroup-unreads | |
148 (delq (setq number (mail-header-number header)) | |
149 gnus-newsgroup-unreads)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
150 (if (not auto) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
151 (push (cons number gnus-duplicate-mark) gnus-newsgroup-reads) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
152 (push number gnus-newsgroup-expirable) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
153 (push (cons number gnus-expirable-mark) gnus-newsgroup-reads))))) |
17493 | 154 (gnus-message 6 "Suppressing duplicates...done")) |
155 | |
156 (defun gnus-dup-unsuppress-article (article) | |
157 "Stop suppression of ARTICLE." | |
158 (let ((id (mail-header-id (gnus-data-header (gnus-data-find article))))) | |
159 (when id | |
160 (setq gnus-dup-list-dirty t) | |
161 (setq gnus-dup-list (delete id gnus-dup-list)) | |
162 (unintern id gnus-dup-hashtb)))) | |
163 | |
164 (provide 'gnus-dup) | |
165 | |
52401 | 166 ;;; arch-tag: 903e94db-7b00-4d19-83ee-cf34a81fa5fb |
17493 | 167 ;;; gnus-dup.el ends here |