Mercurial > emacs
annotate lisp/gnus/gnus-dup.el @ 82975:590114f9753d gnus-5_10-pre-merge-josefsson
2004-08-31 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-agent.el (gnus-agent-restore-gcc): Use ^ and regexp-quote.
* gnus-sum.el (gnus-newsgroup-variables): Doc fix (tiny change).
From Helmut Waitzmann <Helmut.Waitzmann@web.de>.
* gnus-agent.el (gnus-agent-regenerate-group): Activate the group
when the group's active is not available.
* gnus-art.el (article-hide-headers): Refer to the values for
gnus-ignored-headers and gnus-visible-headers in the summary
buffer since a user may have set them as group parameters.
(gnus-article-next-page): Fix the way to find a real end-of-buffer
(tiny change). From YAGI Tatsuya <ynyaaa@ybb.ne.jp>.
(gnus-article-read-summary-keys): Restore new window-start and
hscroll to summary window.
(gnus-prev-page-map): Remove duplicated one.
* gnus-cite.el (gnus-cite-ignore-quoted-from): New user option.
(gnus-cite-parse): Ignore quoted envelope From_. Suggested by
Karl Chen <quarl@nospam.quarl.org> and Reiner Steib
<Reiner.Steib@gmx.de>.
* gnus-cus.el (gnus-agent-cat-prepare-category-field): Replace
pp-to-string with gnus-pp-to-string.
* gnus-eform.el (gnus-edit-form): Replace pp with gnus-pp.
* gnus-group.el (gnus-group-make-kiboze-group): Replace pp with
gnus-pp.
* gnus-msg.el (gnus-setup-message): Ignore an article copy while
parsing gnus-posting-styles when the message is not for replying.
(gnus-summary-resend-message-edit): Call mime-to-mml. Suggested
by Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp>.
(gnus-debug): Replace pp with gnus-pp.
* gnus-score.el (gnus-score-save): Replace pp with gnus-pp.
* gnus-spec.el (gnus-update-format): Replace pp-to-string with
gnus-pp-to-string.
* gnus-sum.el (gnus-read-header): Don't remove a header for the
parent article of a sparse article in the thread hashtb. From
Stefan Wiens <s.wi@gmx.net>.
* gnus-util.el (gnus-bind-print-variables): New macro.
(gnus-prin1): Use it.
(gnus-prin1-to-string): Use it.
(gnus-pp): New function.
(gnus-pp-to-string): New function.
* gnus.el: Don't make unnecessary *Group* buffer when loading.
* mail-source.el (mail-source-touch-pop): Doc fix.
* message.el (message-mode): Don't modify paragraph-separate there.
(message-setup-fill-variables): Add mml tags to paragraph-start
and paragraph-separate. Suggested by Andrew Korty <ajk@iu.edu>.
(message-smtpmail-send-it): Doc fix.
(message-exchange-point-and-mark): Don't activate region if it was
inactive. Suggested by Hiroshi Fujishima
<pooh@nature.tsukuba.ac.jp> and Jesper Harder <harder@ifa.au.dk>.
* mm-decode.el (mm-save-part): Bind enable-multibyte-characters to
t while entering a file name using the mm-with-multibyte macro.
Suggested by Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp>.
* mm-encode.el (mm-content-transfer-encoding-defaults): Use
qp-or-base64 for the application/* types.
(mm-safer-encoding): Consider 7bit is safe.
* mm-util.el (mm-with-multibyte-buffer): New macro.
(mm-with-multibyte): New macro.
* mm-view.el (mm-inline-render-with-function): Use multibyte
buffer; decode html source by charset.
* nndoc.el (nndoc-type-alist): Improve regexp for article-begin,
add generate-head-function and generate-article-function to the
rfc822-forward entry.
(nndoc-forward-type-p): Recognize envelope From_.
(nndoc-rfc822-forward-generate-article): New function.
(nndoc-rfc822-forward-generate-head): New function.
From David Hedbor <dhedbor@real.com>.
* nnmail.el (nnmail-split-lowercase-expanded): New user option.
(nnmail-expand-newtext): Lowercase expanded entries if
nnmail-split-lowercase-expanded is non-nil.
* score-mode.el (gnus-score-pretty-print): Replace pp with gnus-pp.
* webmail.el (webmail-debug): Replace pp with gnus-pp.
* gnus-art.el (gnus-article-wash-html-with-w3m): Bind
w3m-safe-url-regexp as the value for mm-w3m-safe-url-regexp; use
w3m-minor-mode-map instead of mm-w3m-local-map-property.
(gnus-mime-save-part-and-strip): Use mm-complicated-handles
instead of mm-multiple-handles.
(gnus-mime-delete-part): Ditto.
* mm-decode.el (mm-multiple-handles): Recognize a string as a mime
handle, as well as a list.
(mm-complicated-handles): Former definition of mm-multiple-handles.
* mm-view.el (mm-w3m-mode-map): Remove.
(mm-w3m-local-map-property): Remove.
(mm-w3m-cid-retrieve-1): Call itself recursively. Suggested by
ARISAWA Akihiro <ari@mbf.sphere.ne.jp>.
(mm-w3m-cid-retrieve): Simplify.
(mm-inline-text-html-render-with-w3m): Decode html source by
charset; check META tags only when charsets are not specified in
headers; specify charset to w3m-region; use w3m-minor-mode-map
instead of mm-w3m-local-map-property.
author | Reiner Steib <Reiner.Steib@gmx.de> |
---|---|
date | Tue, 31 Aug 2004 14:47:59 +0000 |
parents | 0fde48feb604 |
children | 18a818a2ee7c cce1c0ee76ee |
rev | line source |
---|---|
17493 | 1 ;;; gnus-dup.el --- suppression of duplicate articles in Gnus |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
3 ;; Free Software Foundation, Inc. |
17493 | 4 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19493
diff
changeset
|
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 6 ;; Keywords: news |
7 | |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
23 ;; Boston, MA 02111-1307, USA. | |
24 | |
25 ;;; Commentary: | |
26 | |
27 ;; This package tries to mark articles as read the second time the | |
28 ;; user reads a copy. This is useful if the server doesn't support | |
29 ;; Xref properly, or if the user reads the same group from several | |
30 ;; servers. | |
31 | |
32 ;;; Code: | |
33 | |
19493
8d840c4548c0
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
34 (eval-when-compile (require 'cl)) |
8d840c4548c0
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
35 |
17493 | 36 (require 'gnus) |
37 (require 'gnus-art) | |
38 | |
39 (defgroup gnus-duplicate nil | |
40 "Suppression of duplicate articles." | |
41 :group 'gnus) | |
42 | |
43 (defcustom gnus-save-duplicate-list nil | |
44 "*If non-nil, save the duplicate list when shutting down Gnus. | |
45 If nil, duplicate suppression will only work on duplicates | |
46 seen in the same session." | |
47 :group 'gnus-duplicate | |
48 :type 'boolean) | |
49 | |
50 (defcustom gnus-duplicate-list-length 10000 | |
51 "*The number of Message-IDs to keep in the duplicate suppression list." | |
52 :group 'gnus-duplicate | |
53 :type 'integer) | |
54 | |
55 (defcustom gnus-duplicate-file (nnheader-concat gnus-directory "suppression") | |
56 "*The name of the file to store the duplicate suppression list." | |
57 :group 'gnus-duplicate | |
58 :type 'file) | |
59 | |
60 ;;; Internal variables | |
61 | |
62 (defvar gnus-dup-list nil) | |
63 (defvar gnus-dup-hashtb nil) | |
64 | |
65 (defvar gnus-dup-list-dirty nil) | |
66 | |
67 ;;; | |
68 ;;; Starting and stopping | |
69 ;;; | |
70 | |
71 (gnus-add-shutdown 'gnus-dup-close 'gnus) | |
72 | |
73 (defun gnus-dup-close () | |
74 "Possibly save the duplicate suppression list and shut down the subsystem." | |
75 (gnus-dup-save) | |
76 (setq gnus-dup-list nil | |
77 gnus-dup-hashtb nil | |
78 gnus-dup-list-dirty nil)) | |
79 | |
80 (defun gnus-dup-open () | |
81 "Possibly read the duplicate suppression list and start the subsystem." | |
82 (if gnus-save-duplicate-list | |
83 (gnus-dup-read) | |
84 (setq gnus-dup-list nil)) | |
85 (setq gnus-dup-hashtb (gnus-make-hashtable gnus-duplicate-list-length)) | |
86 ;; Enter all Message-IDs into the hash table. | |
87 (let ((list gnus-dup-list) | |
88 (obarray gnus-dup-hashtb)) | |
89 (while list | |
90 (intern (pop list))))) | |
91 | |
92 (defun gnus-dup-read () | |
93 "Read the duplicate suppression list." | |
94 (setq gnus-dup-list nil) | |
95 (when (file-exists-p gnus-duplicate-file) | |
96 (load gnus-duplicate-file t t t))) | |
97 | |
98 (defun gnus-dup-save () | |
99 "Save the duplicate suppression list." | |
100 (when (and gnus-save-duplicate-list | |
101 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
|
102 (with-temp-file gnus-duplicate-file |
17493 | 103 (gnus-prin1 `(setq gnus-dup-list ',gnus-dup-list)))) |
104 (setq gnus-dup-list-dirty nil)) | |
105 | |
106 ;;; | |
107 ;;; Interface functions | |
108 ;;; | |
109 | |
110 (defun gnus-dup-enter-articles () | |
111 "Enter articles from the current group for future duplicate suppression." | |
112 (unless gnus-dup-list | |
113 (gnus-dup-open)) | |
114 (setq gnus-dup-list-dirty t) ; mark list for saving | |
115 (let ((data gnus-newsgroup-data) | |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
116 datum msgid) |
17493 | 117 ;; Enter the Message-IDs of all read articles into the list |
118 ;; and hash table. | |
119 (while (setq datum (pop data)) | |
120 (when (and (not (gnus-data-pseudo-p datum)) | |
121 (> (gnus-data-number datum) 0) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19493
diff
changeset
|
122 (not (memq (gnus-data-number datum) gnus-newsgroup-unreads)) |
17493 | 123 (not (= (gnus-data-mark datum) gnus-canceled-mark)) |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
124 (setq msgid (mail-header-id (gnus-data-header datum))) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
125 (not (nnheader-fake-message-id-p msgid)) |
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
126 (not (intern-soft msgid gnus-dup-hashtb))) |
17493 | 127 (push msgid gnus-dup-list) |
82951
0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
Andreas Schwab <schwab@suse.de>
parents:
52401
diff
changeset
|
128 (intern msgid gnus-dup-hashtb)))) |
17493 | 129 ;; Chop off excess Message-IDs from the list. |
130 (let ((end (nthcdr gnus-duplicate-list-length gnus-dup-list))) | |
131 (when end | |
132 (setcdr end nil)))) | |
133 | |
134 (defun gnus-dup-suppress-articles () | |
135 "Mark duplicate articles as read." | |
136 (unless gnus-dup-list | |
137 (gnus-dup-open)) | |
138 (gnus-message 6 "Suppressing duplicates...") | |
139 (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
|
140 (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
|
141 (memq gnus-duplicate-mark gnus-auto-expirable-marks))) |
17493 | 142 number header) |
143 (while (setq header (pop headers)) | |
144 (when (and (intern-soft (mail-header-id header) gnus-dup-hashtb) | |
145 (gnus-summary-article-unread-p (mail-header-number header))) | |
146 (setq gnus-newsgroup-unreads | |
147 (delq (setq number (mail-header-number header)) | |
148 gnus-newsgroup-unreads)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
149 (if (not auto) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
150 (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
|
151 (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
|
152 (push (cons number gnus-expirable-mark) gnus-newsgroup-reads))))) |
17493 | 153 (gnus-message 6 "Suppressing duplicates...done")) |
154 | |
155 (defun gnus-dup-unsuppress-article (article) | |
156 "Stop suppression of ARTICLE." | |
157 (let ((id (mail-header-id (gnus-data-header (gnus-data-find article))))) | |
158 (when id | |
159 (setq gnus-dup-list-dirty t) | |
160 (setq gnus-dup-list (delete id gnus-dup-list)) | |
161 (unintern id gnus-dup-hashtb)))) | |
162 | |
163 (provide 'gnus-dup) | |
164 | |
52401 | 165 ;;; arch-tag: 903e94db-7b00-4d19-83ee-cf34a81fa5fb |
17493 | 166 ;;; gnus-dup.el ends here |