Mercurial > emacs
annotate lisp/gnus/gnus-sum.el @ 31785:51cea22fd2aa
Merge from Gnus trunk.
author | Dave Love <fx@gnu.org> |
---|---|
date | Wed, 20 Sep 2000 16:54:57 +0000 |
parents | 9968f55ad26e |
children | 5155c0078eb9 |
rev | line source |
---|---|
17493 | 1 ;;; gnus-sum.el --- summary mode commands for Gnus |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
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:
24552
diff
changeset
|
3 ;; Free Software Foundation, Inc. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
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 ;;; Code: | |
28 | |
19521
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
29 (eval-when-compile (require 'cl)) |
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
30 |
17493 | 31 (require 'gnus) |
32 (require 'gnus-group) | |
33 (require 'gnus-spec) | |
34 (require 'gnus-range) | |
35 (require 'gnus-int) | |
36 (require 'gnus-undo) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
37 (require 'gnus-util) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
38 (require 'mm-decode) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
39 (autoload 'gnus-summary-limit-include-cached "gnus-cache" nil t) |
17493 | 40 |
41 (defcustom gnus-kill-summary-on-exit t | |
42 "*If non-nil, kill the summary buffer when you exit from it. | |
43 If nil, the summary will become a \"*Dead Summary*\" buffer, and | |
44 it will be killed sometime later." | |
45 :group 'gnus-summary-exit | |
46 :type 'boolean) | |
47 | |
48 (defcustom gnus-fetch-old-headers nil | |
49 "*Non-nil means that Gnus will try to build threads by grabbing old headers. | |
50 If an unread article in the group refers to an older, already read (or | |
51 just marked as read) article, the old article will not normally be | |
52 displayed in the Summary buffer. If this variable is non-nil, Gnus | |
53 will attempt to grab the headers to the old articles, and thereby | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
54 build complete threads. If it has the value `some', only enough |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
55 headers to connect otherwise loose threads will be displayed. This |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
56 variable can also be a number. In that case, no more than that number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
57 of old headers will be fetched. If it has the value `invisible', all |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
58 old headers will be fetched, but none will be displayed. |
17493 | 59 |
60 The server has to support NOV for any of this to work." | |
61 :group 'gnus-thread | |
62 :type '(choice (const :tag "off" nil) | |
63 (const some) | |
64 number | |
65 (sexp :menu-tag "other" t))) | |
66 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
67 (defcustom gnus-refer-thread-limit 200 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
68 "*The number of old headers to fetch when doing \\<gnus-summary-mode-map>\\[gnus-summary-refer-thread]. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
69 If t, fetch all the available old headers." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
70 :group 'gnus-thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
71 :type '(choice number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
72 (sexp :menu-tag "other" t))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
73 |
17493 | 74 (defcustom gnus-summary-make-false-root 'adopt |
75 "*nil means that Gnus won't gather loose threads. | |
76 If the root of a thread has expired or been read in a previous | |
77 session, the information necessary to build a complete thread has been | |
78 lost. Instead of having many small sub-threads from this original thread | |
79 scattered all over the summary buffer, Gnus can gather them. | |
80 | |
81 If non-nil, Gnus will try to gather all loose sub-threads from an | |
82 original thread into one large thread. | |
83 | |
84 If this variable is non-nil, it should be one of `none', `adopt', | |
85 `dummy' or `empty'. | |
86 | |
87 If this variable is `none', Gnus will not make a false root, but just | |
88 present the sub-threads after another. | |
89 If this variable is `dummy', Gnus will create a dummy root that will | |
90 have all the sub-threads as children. | |
91 If this variable is `adopt', Gnus will make one of the \"children\" | |
92 the parent and mark all the step-children as such. | |
93 If this variable is `empty', the \"children\" are printed with empty | |
94 subject fields. (Or rather, they will be printed with a string | |
95 given by the `gnus-summary-same-subject' variable.)" | |
96 :group 'gnus-thread | |
97 :type '(choice (const :tag "off" nil) | |
98 (const none) | |
99 (const dummy) | |
100 (const adopt) | |
101 (const empty))) | |
102 | |
103 (defcustom gnus-summary-gather-exclude-subject "^ *$\\|^(none)$" | |
104 "*A regexp to match subjects to be excluded from loose thread gathering. | |
105 As loose thread gathering is done on subjects only, that means that | |
106 there can be many false gatherings performed. By rooting out certain | |
107 common subjects, gathering might become saner." | |
108 :group 'gnus-thread | |
109 :type 'regexp) | |
110 | |
111 (defcustom gnus-summary-gather-subject-limit nil | |
112 "*Maximum length of subject comparisons when gathering loose threads. | |
113 Use nil to compare full subjects. Setting this variable to a low | |
114 number will help gather threads that have been corrupted by | |
115 newsreaders chopping off subject lines, but it might also mean that | |
116 unrelated articles that have subject that happen to begin with the | |
117 same few characters will be incorrectly gathered. | |
118 | |
119 If this variable is `fuzzy', Gnus will use a fuzzy algorithm when | |
120 comparing subjects." | |
121 :group 'gnus-thread | |
122 :type '(choice (const :tag "off" nil) | |
123 (const fuzzy) | |
124 (sexp :menu-tag "on" t))) | |
125 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
126 (defcustom gnus-simplify-subject-functions nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
127 "List of functions taking a string argument that simplify subjects. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
128 The functions are applied recursively. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
129 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
130 Useful functions to put in this list include: `gnus-simplify-subject-re', |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
131 `gnus-simplify-subject-fuzzy' and `gnus-simplify-whitespace'." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
132 :group 'gnus-thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
133 :type '(repeat function)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
134 |
17493 | 135 (defcustom gnus-simplify-ignored-prefixes nil |
136 "*Regexp, matches for which are removed from subject lines when simplifying fuzzily." | |
137 :group 'gnus-thread | |
138 :type '(choice (const :tag "off" nil) | |
139 regexp)) | |
140 | |
141 (defcustom gnus-build-sparse-threads nil | |
142 "*If non-nil, fill in the gaps in threads. | |
143 If `some', only fill in the gaps that are needed to tie loose threads | |
144 together. If `more', fill in all leaf nodes that Gnus can find. If | |
145 non-nil and non-`some', fill in all gaps that Gnus manages to guess." | |
146 :group 'gnus-thread | |
147 :type '(choice (const :tag "off" nil) | |
148 (const some) | |
149 (const more) | |
150 (sexp :menu-tag "all" t))) | |
151 | |
152 (defcustom gnus-summary-thread-gathering-function | |
153 'gnus-gather-threads-by-subject | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
154 "*Function used for gathering loose threads. |
17493 | 155 There are two pre-defined functions: `gnus-gather-threads-by-subject', |
156 which only takes Subjects into consideration; and | |
157 `gnus-gather-threads-by-references', which compared the References | |
158 headers of the articles to find matches." | |
159 :group 'gnus-thread | |
19912
4355457d9749
(gnus-summary-thread-gathering-function): Fix customize type.
Richard M. Stallman <rms@gnu.org>
parents:
19594
diff
changeset
|
160 :type '(radio (function-item gnus-gather-threads-by-subject) |
4355457d9749
(gnus-summary-thread-gathering-function): Fix customize type.
Richard M. Stallman <rms@gnu.org>
parents:
19594
diff
changeset
|
161 (function-item gnus-gather-threads-by-references) |
4355457d9749
(gnus-summary-thread-gathering-function): Fix customize type.
Richard M. Stallman <rms@gnu.org>
parents:
19594
diff
changeset
|
162 (function :tag "other"))) |
17493 | 163 |
164 (defcustom gnus-summary-same-subject "" | |
165 "*String indicating that the current article has the same subject as the previous. | |
166 This variable will only be used if the value of | |
167 `gnus-summary-make-false-root' is `empty'." | |
168 :group 'gnus-summary-format | |
169 :type 'string) | |
170 | |
171 (defcustom gnus-summary-goto-unread t | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
172 "*If t, many commands will go to the next unread article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
173 This applies to marking commands as well as other commands that |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
174 \"naturally\" select the next article, like, for instance, `SPC' at |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
175 the end of an article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
176 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
177 If nil, the marking commands do NOT go to the next unread article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
178 (they go to the next article instead). If `never', commands that |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
179 usually go to the next unread article, will go to the next article, |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
180 whether it is read or not." |
17493 | 181 :group 'gnus-summary-marks |
182 :link '(custom-manual "(gnus)Setting Marks") | |
183 :type '(choice (const :tag "off" nil) | |
184 (const never) | |
185 (sexp :menu-tag "on" t))) | |
186 | |
187 (defcustom gnus-summary-default-score 0 | |
188 "*Default article score level. | |
189 All scores generated by the score files will be added to this score. | |
190 If this variable is nil, scoring will be disabled." | |
191 :group 'gnus-score-default | |
192 :type '(choice (const :tag "disable") | |
193 integer)) | |
194 | |
195 (defcustom gnus-summary-zcore-fuzz 0 | |
196 "*Fuzziness factor for the zcore in the summary buffer. | |
197 Articles with scores closer than this to `gnus-summary-default-score' | |
198 will not be marked." | |
199 :group 'gnus-summary-format | |
200 :type 'integer) | |
201 | |
202 (defcustom gnus-simplify-subject-fuzzy-regexp nil | |
203 "*Strings to be removed when doing fuzzy matches. | |
204 This can either be a regular expression or list of regular expressions | |
205 that will be removed from subject strings if fuzzy subject | |
206 simplification is selected." | |
207 :group 'gnus-thread | |
208 :type '(repeat regexp)) | |
209 | |
210 (defcustom gnus-show-threads t | |
211 "*If non-nil, display threads in summary mode." | |
212 :group 'gnus-thread | |
213 :type 'boolean) | |
214 | |
215 (defcustom gnus-thread-hide-subtree nil | |
216 "*If non-nil, hide all threads initially. | |
217 If threads are hidden, you have to run the command | |
218 `gnus-summary-show-thread' by hand or use `gnus-select-article-hook' | |
219 to expose hidden threads." | |
220 :group 'gnus-thread | |
221 :type 'boolean) | |
222 | |
223 (defcustom gnus-thread-hide-killed t | |
224 "*If non-nil, hide killed threads automatically." | |
225 :group 'gnus-thread | |
226 :type 'boolean) | |
227 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
228 (defcustom gnus-thread-ignore-subject t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
229 "*If non-nil, which is the default, ignore subjects and do all threading based on the Reference header. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
230 If nil, articles that have different subjects from their parents will |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
231 start separate threads." |
17493 | 232 :group 'gnus-thread |
233 :type 'boolean) | |
234 | |
235 (defcustom gnus-thread-operation-ignore-subject t | |
236 "*If non-nil, subjects will be ignored when doing thread commands. | |
237 This affects commands like `gnus-summary-kill-thread' and | |
238 `gnus-summary-lower-thread'. | |
239 | |
240 If this variable is nil, articles in the same thread with different | |
241 subjects will not be included in the operation in question. If this | |
242 variable is `fuzzy', only articles that have subjects that are fuzzily | |
243 equal will be included." | |
244 :group 'gnus-thread | |
245 :type '(choice (const :tag "off" nil) | |
246 (const fuzzy) | |
247 (sexp :tag "on" t))) | |
248 | |
249 (defcustom gnus-thread-indent-level 4 | |
250 "*Number that says how much each sub-thread should be indented." | |
251 :group 'gnus-thread | |
252 :type 'integer) | |
253 | |
254 (defcustom gnus-auto-extend-newsgroup t | |
255 "*If non-nil, extend newsgroup forward and backward when requested." | |
256 :group 'gnus-summary-choose | |
257 :type 'boolean) | |
258 | |
259 (defcustom gnus-auto-select-first t | |
260 "*If nil, don't select the first unread article when entering a group. | |
261 If this variable is `best', select the highest-scored unread article | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
262 in the group. If t, select the first unread article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
263 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
264 This variable can also be a function to place point on a likely |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
265 subject line. Useful values include `gnus-summary-first-unread-subject', |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
266 `gnus-summary-first-unread-article' and |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
267 `gnus-summary-best-unread-article'. |
17493 | 268 |
269 If you want to prevent automatic selection of the first unread article | |
270 in some newsgroups, set the variable to nil in | |
271 `gnus-select-group-hook'." | |
272 :group 'gnus-group-select | |
273 :type '(choice (const :tag "none" nil) | |
274 (const best) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
275 (sexp :menu-tag "first" t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
276 (function-item gnus-summary-first-unread-subject) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
277 (function-item gnus-summary-first-unread-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
278 (function-item gnus-summary-best-unread-article))) |
17493 | 279 |
280 (defcustom gnus-auto-select-next t | |
281 "*If non-nil, offer to go to the next group from the end of the previous. | |
282 If the value is t and the next newsgroup is empty, Gnus will exit | |
283 summary mode and go back to group mode. If the value is neither nil | |
284 nor t, Gnus will select the following unread newsgroup. In | |
285 particular, if the value is the symbol `quietly', the next unread | |
286 newsgroup will be selected without any confirmation, and if it is | |
287 `almost-quietly', the next group will be selected without any | |
288 confirmation if you are located on the last article in the group. | |
289 Finally, if this variable is `slightly-quietly', the `Z n' command | |
290 will go to the next group without confirmation." | |
291 :group 'gnus-summary-maneuvering | |
292 :type '(choice (const :tag "off" nil) | |
293 (const quietly) | |
294 (const almost-quietly) | |
295 (const slightly-quietly) | |
296 (sexp :menu-tag "on" t))) | |
297 | |
298 (defcustom gnus-auto-select-same nil | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
299 "*If non-nil, select the next article with the same subject. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
300 If there are no more articles with the same subject, go to |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
301 the first unread article." |
17493 | 302 :group 'gnus-summary-maneuvering |
303 :type 'boolean) | |
304 | |
305 (defcustom gnus-summary-check-current nil | |
306 "*If non-nil, consider the current article when moving. | |
307 The \"unread\" movement commands will stay on the same line if the | |
308 current article is unread." | |
309 :group 'gnus-summary-maneuvering | |
310 :type 'boolean) | |
311 | |
312 (defcustom gnus-auto-center-summary t | |
313 "*If non-nil, always center the current summary buffer. | |
314 In particular, if `vertical' do only vertical recentering. If non-nil | |
315 and non-`vertical', do both horizontal and vertical recentering." | |
316 :group 'gnus-summary-maneuvering | |
317 :type '(choice (const :tag "none" nil) | |
318 (const vertical) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
319 (integer :tag "height") |
17493 | 320 (sexp :menu-tag "both" t))) |
321 | |
322 (defcustom gnus-show-all-headers nil | |
323 "*If non-nil, don't hide any headers." | |
324 :group 'gnus-article-hiding | |
325 :group 'gnus-article-headers | |
326 :type 'boolean) | |
327 | |
328 (defcustom gnus-summary-ignore-duplicates nil | |
329 "*If non-nil, ignore articles with identical Message-ID headers." | |
330 :group 'gnus-summary | |
331 :type 'boolean) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
332 |
17493 | 333 (defcustom gnus-single-article-buffer t |
334 "*If non-nil, display all articles in the same buffer. | |
335 If nil, each group will get its own article buffer." | |
336 :group 'gnus-article-various | |
337 :type 'boolean) | |
338 | |
339 (defcustom gnus-break-pages t | |
340 "*If non-nil, do page breaking on articles. | |
341 The page delimiter is specified by the `gnus-page-delimiter' | |
342 variable." | |
343 :group 'gnus-article-various | |
344 :type 'boolean) | |
345 | |
346 (defcustom gnus-move-split-methods nil | |
347 "*Variable used to suggest where articles are to be moved to. | |
348 It uses the same syntax as the `gnus-split-methods' variable." | |
349 :group 'gnus-summary-mail | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
350 :type '(repeat (choice (list :value (fun) function) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
351 (cons :value ("" "") regexp (repeat string)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
352 (sexp :value nil)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
353 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
354 (defcustom gnus-unread-mark ? ;Whitespace |
17493 | 355 "*Mark used for unread articles." |
356 :group 'gnus-summary-marks | |
357 :type 'character) | |
358 | |
359 (defcustom gnus-ticked-mark ?! | |
360 "*Mark used for ticked articles." | |
361 :group 'gnus-summary-marks | |
362 :type 'character) | |
363 | |
364 (defcustom gnus-dormant-mark ?? | |
365 "*Mark used for dormant articles." | |
366 :group 'gnus-summary-marks | |
367 :type 'character) | |
368 | |
369 (defcustom gnus-del-mark ?r | |
370 "*Mark used for del'd articles." | |
371 :group 'gnus-summary-marks | |
372 :type 'character) | |
373 | |
374 (defcustom gnus-read-mark ?R | |
375 "*Mark used for read articles." | |
376 :group 'gnus-summary-marks | |
377 :type 'character) | |
378 | |
379 (defcustom gnus-expirable-mark ?E | |
380 "*Mark used for expirable articles." | |
381 :group 'gnus-summary-marks | |
382 :type 'character) | |
383 | |
384 (defcustom gnus-killed-mark ?K | |
385 "*Mark used for killed articles." | |
386 :group 'gnus-summary-marks | |
387 :type 'character) | |
388 | |
389 (defcustom gnus-souped-mark ?F | |
390 "*Mark used for killed articles." | |
391 :group 'gnus-summary-marks | |
392 :type 'character) | |
393 | |
394 (defcustom gnus-kill-file-mark ?X | |
395 "*Mark used for articles killed by kill files." | |
396 :group 'gnus-summary-marks | |
397 :type 'character) | |
398 | |
399 (defcustom gnus-low-score-mark ?Y | |
400 "*Mark used for articles with a low score." | |
401 :group 'gnus-summary-marks | |
402 :type 'character) | |
403 | |
404 (defcustom gnus-catchup-mark ?C | |
405 "*Mark used for articles that are caught up." | |
406 :group 'gnus-summary-marks | |
407 :type 'character) | |
408 | |
409 (defcustom gnus-replied-mark ?A | |
410 "*Mark used for articles that have been replied to." | |
411 :group 'gnus-summary-marks | |
412 :type 'character) | |
413 | |
414 (defcustom gnus-cached-mark ?* | |
415 "*Mark used for articles that are in the cache." | |
416 :group 'gnus-summary-marks | |
417 :type 'character) | |
418 | |
419 (defcustom gnus-saved-mark ?S | |
420 "*Mark used for articles that have been saved to." | |
421 :group 'gnus-summary-marks | |
422 :type 'character) | |
423 | |
424 (defcustom gnus-ancient-mark ?O | |
425 "*Mark used for ancient articles." | |
426 :group 'gnus-summary-marks | |
427 :type 'character) | |
428 | |
429 (defcustom gnus-sparse-mark ?Q | |
430 "*Mark used for sparsely reffed articles." | |
431 :group 'gnus-summary-marks | |
432 :type 'character) | |
433 | |
434 (defcustom gnus-canceled-mark ?G | |
435 "*Mark used for canceled articles." | |
436 :group 'gnus-summary-marks | |
437 :type 'character) | |
438 | |
439 (defcustom gnus-duplicate-mark ?M | |
440 "*Mark used for duplicate articles." | |
441 :group 'gnus-summary-marks | |
442 :type 'character) | |
443 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
444 (defcustom gnus-undownloaded-mark ?@ |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
445 "*Mark used for articles that weren't downloaded." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
446 :group 'gnus-summary-marks |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
447 :type 'character) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
448 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
449 (defcustom gnus-downloadable-mark ?% |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
450 "*Mark used for articles that are to be downloaded." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
451 :group 'gnus-summary-marks |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
452 :type 'character) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
453 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
454 (defcustom gnus-unsendable-mark ?= |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
455 "*Mark used for articles that won't be sent." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
456 :group 'gnus-summary-marks |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
457 :type 'character) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
458 |
17493 | 459 (defcustom gnus-score-over-mark ?+ |
460 "*Score mark used for articles with high scores." | |
461 :group 'gnus-summary-marks | |
462 :type 'character) | |
463 | |
464 (defcustom gnus-score-below-mark ?- | |
465 "*Score mark used for articles with low scores." | |
466 :group 'gnus-summary-marks | |
467 :type 'character) | |
468 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
469 (defcustom gnus-empty-thread-mark ? ;Whitespace |
17493 | 470 "*There is no thread under the article." |
471 :group 'gnus-summary-marks | |
472 :type 'character) | |
473 | |
474 (defcustom gnus-not-empty-thread-mark ?= | |
475 "*There is a thread under the article." | |
476 :group 'gnus-summary-marks | |
477 :type 'character) | |
478 | |
479 (defcustom gnus-view-pseudo-asynchronously nil | |
480 "*If non-nil, Gnus will view pseudo-articles asynchronously." | |
481 :group 'gnus-extract-view | |
482 :type 'boolean) | |
483 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
484 (defcustom gnus-auto-expirable-marks |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
485 (list gnus-killed-mark gnus-del-mark gnus-catchup-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
486 gnus-low-score-mark gnus-ancient-mark gnus-read-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
487 gnus-souped-mark gnus-duplicate-mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
488 "*The list of marks converted into expiration if a group is auto-expirable." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
489 :group 'gnus-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
490 :type '(repeat character)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
491 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
492 (defcustom gnus-inhibit-user-auto-expire t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
493 "*If non-nil, user marking commands will not mark an article as expirable, even if the group has auto-expire turned on." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
494 :group 'gnus-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
495 :type 'boolean) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
496 |
17493 | 497 (defcustom gnus-view-pseudos nil |
498 "*If `automatic', pseudo-articles will be viewed automatically. | |
499 If `not-confirm', pseudos will be viewed automatically, and the user | |
500 will not be asked to confirm the command." | |
501 :group 'gnus-extract-view | |
502 :type '(choice (const :tag "off" nil) | |
503 (const automatic) | |
504 (const not-confirm))) | |
505 | |
506 (defcustom gnus-view-pseudos-separately t | |
507 "*If non-nil, one pseudo-article will be created for each file to be viewed. | |
508 If nil, all files that use the same viewing command will be given as a | |
509 list of parameters to that command." | |
510 :group 'gnus-extract-view | |
511 :type 'boolean) | |
512 | |
513 (defcustom gnus-insert-pseudo-articles t | |
514 "*If non-nil, insert pseudo-articles when decoding articles." | |
515 :group 'gnus-extract-view | |
516 :type 'boolean) | |
517 | |
518 (defcustom gnus-summary-dummy-line-format | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
519 " %(: :%) %S\n" |
17493 | 520 "*The format specification for the dummy roots in the summary buffer. |
521 It works along the same lines as a normal formatting string, | |
522 with some simple extensions. | |
523 | |
524 %S The subject" | |
525 :group 'gnus-threading | |
526 :type 'string) | |
527 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
528 (defcustom gnus-summary-mode-line-format "Gnus: %g [%A] %Z" |
17493 | 529 "*The format specification for the summary mode line. |
530 It works along the same lines as a normal formatting string, | |
531 with some simple extensions: | |
532 | |
533 %G Group name | |
534 %p Unprefixed group name | |
535 %A Current article number | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
536 %z Current article score |
17493 | 537 %V Gnus version |
538 %U Number of unread articles in the group | |
539 %e Number of unselected articles in the group | |
540 %Z A string with unread/unselected article counts | |
541 %g Shortish group name | |
542 %S Subject of the current article | |
543 %u User-defined spec | |
544 %s Current score file name | |
545 %d Number of dormant articles | |
546 %r Number of articles that have been marked as read in this session | |
547 %E Number of articles expunged by the score files" | |
548 :group 'gnus-summary-format | |
549 :type 'string) | |
550 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
551 (defcustom gnus-list-identifiers nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
552 "Regexp that matches list identifiers to be removed from subject. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
553 This can also be a list of regexps." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
554 :group 'gnus-summary-format |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
555 :group 'gnus-article-hiding |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
556 :type '(choice (const :tag "none" nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
557 (regexp :value ".*") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
558 (repeat :value (".*") regexp))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
559 |
17493 | 560 (defcustom gnus-summary-mark-below 0 |
561 "*Mark all articles with a score below this variable as read. | |
562 This variable is local to each summary buffer and usually set by the | |
563 score file." | |
564 :group 'gnus-score-default | |
565 :type 'integer) | |
566 | |
567 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number) | |
568 "*List of functions used for sorting articles in the summary buffer. | |
569 This variable is only used when not using a threaded display." | |
570 :group 'gnus-summary-sort | |
571 :type '(repeat (choice (function-item gnus-article-sort-by-number) | |
572 (function-item gnus-article-sort-by-author) | |
573 (function-item gnus-article-sort-by-subject) | |
574 (function-item gnus-article-sort-by-date) | |
575 (function-item gnus-article-sort-by-score) | |
576 (function :tag "other")))) | |
577 | |
578 (defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number) | |
579 "*List of functions used for sorting threads in the summary buffer. | |
580 By default, threads are sorted by article number. | |
581 | |
582 Each function takes two threads and return non-nil if the first thread | |
583 should be sorted before the other. If you use more than one function, | |
584 the primary sort function should be the last. You should probably | |
585 always include `gnus-thread-sort-by-number' in the list of sorting | |
586 functions -- preferably first. | |
587 | |
588 Ready-made functions include `gnus-thread-sort-by-number', | |
589 `gnus-thread-sort-by-author', `gnus-thread-sort-by-subject', | |
590 `gnus-thread-sort-by-date', `gnus-thread-sort-by-score' and | |
591 `gnus-thread-sort-by-total-score' (see `gnus-thread-score-function')." | |
592 :group 'gnus-summary-sort | |
593 :type '(repeat (choice (function-item gnus-thread-sort-by-number) | |
594 (function-item gnus-thread-sort-by-author) | |
595 (function-item gnus-thread-sort-by-subject) | |
596 (function-item gnus-thread-sort-by-date) | |
597 (function-item gnus-thread-sort-by-score) | |
598 (function-item gnus-thread-sort-by-total-score) | |
599 (function :tag "other")))) | |
600 | |
601 (defcustom gnus-thread-score-function '+ | |
602 "*Function used for calculating the total score of a thread. | |
603 | |
604 The function is called with the scores of the article and each | |
605 subthread and should then return the score of the thread. | |
606 | |
607 Some functions you can use are `+', `max', or `min'." | |
608 :group 'gnus-summary-sort | |
609 :type 'function) | |
610 | |
611 (defcustom gnus-summary-expunge-below nil | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
612 "All articles that have a score less than this variable will be expunged. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
613 This variable is local to the summary buffers." |
17493 | 614 :group 'gnus-score-default |
615 :type '(choice (const :tag "off" nil) | |
616 integer)) | |
617 | |
618 (defcustom gnus-thread-expunge-below nil | |
619 "All threads that have a total score less than this variable will be expunged. | |
620 See `gnus-thread-score-function' for en explanation of what a | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
621 \"thread score\" is. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
622 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
623 This variable is local to the summary buffers." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
624 :group 'gnus-threading |
17493 | 625 :group 'gnus-score-default |
626 :type '(choice (const :tag "off" nil) | |
627 integer)) | |
628 | |
629 (defcustom gnus-summary-mode-hook nil | |
630 "*A hook for Gnus summary mode. | |
631 This hook is run before any variables are set in the summary buffer." | |
632 :group 'gnus-summary-various | |
633 :type 'hook) | |
634 | |
635 (defcustom gnus-summary-menu-hook nil | |
636 "*Hook run after the creation of the summary mode menu." | |
637 :group 'gnus-summary-visual | |
638 :type 'hook) | |
639 | |
640 (defcustom gnus-summary-exit-hook nil | |
641 "*A hook called on exit from the summary buffer. | |
642 It will be called with point in the group buffer." | |
643 :group 'gnus-summary-exit | |
644 :type 'hook) | |
645 | |
646 (defcustom gnus-summary-prepare-hook nil | |
647 "*A hook called after the summary buffer has been generated. | |
648 If you want to modify the summary buffer, you can use this hook." | |
649 :group 'gnus-summary-various | |
650 :type 'hook) | |
651 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
652 (defcustom gnus-summary-prepared-hook nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
653 "*A hook called as the last thing after the summary buffer has been generated." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
654 :group 'gnus-summary-various |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
655 :type 'hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
656 |
17493 | 657 (defcustom gnus-summary-generate-hook nil |
658 "*A hook run just before generating the summary buffer. | |
659 This hook is commonly used to customize threading variables and the | |
660 like." | |
661 :group 'gnus-summary-various | |
662 :type 'hook) | |
663 | |
664 (defcustom gnus-select-group-hook nil | |
665 "*A hook called when a newsgroup is selected. | |
666 | |
667 If you'd like to simplify subjects like the | |
668 `gnus-summary-next-same-subject' command does, you can use the | |
669 following hook: | |
670 | |
671 (setq gnus-select-group-hook | |
672 (list | |
673 (lambda () | |
674 (mapcar (lambda (header) | |
675 (mail-header-set-subject | |
676 header | |
677 (gnus-simplify-subject | |
678 (mail-header-subject header) 're-only))) | |
679 gnus-newsgroup-headers))))" | |
680 :group 'gnus-group-select | |
681 :type 'hook) | |
682 | |
683 (defcustom gnus-select-article-hook nil | |
684 "*A hook called when an article is selected." | |
685 :group 'gnus-summary-choose | |
686 :type 'hook) | |
687 | |
688 (defcustom gnus-visual-mark-article-hook | |
689 (list 'gnus-highlight-selected-summary) | |
690 "*Hook run after selecting an article in the summary buffer. | |
691 It is meant to be used for highlighting the article in some way. It | |
692 is not run if `gnus-visual' is nil." | |
693 :group 'gnus-summary-visual | |
694 :type 'hook) | |
695 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
696 (defcustom gnus-parse-headers-hook nil |
17493 | 697 "*A hook called before parsing the headers." |
698 :group 'gnus-various | |
699 :type 'hook) | |
700 | |
701 (defcustom gnus-exit-group-hook nil | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
702 "*A hook called when exiting summary mode. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
703 This hook is not called from the non-updating exit commands like `Q'." |
17493 | 704 :group 'gnus-various |
705 :type 'hook) | |
706 | |
707 (defcustom gnus-summary-update-hook | |
708 (list 'gnus-summary-highlight-line) | |
709 "*A hook called when a summary line is changed. | |
710 The hook will not be called if `gnus-visual' is nil. | |
711 | |
712 The default function `gnus-summary-highlight-line' will | |
713 highlight the line according to the `gnus-summary-highlight' | |
714 variable." | |
715 :group 'gnus-summary-visual | |
716 :type 'hook) | |
717 | |
718 (defcustom gnus-mark-article-hook '(gnus-summary-mark-read-and-unread-as-read) | |
719 "*A hook called when an article is selected for the first time. | |
720 The hook is intended to mark an article as read (or unread) | |
721 automatically when it is selected." | |
722 :group 'gnus-summary-choose | |
723 :type 'hook) | |
724 | |
725 (defcustom gnus-group-no-more-groups-hook nil | |
726 "*A hook run when returning to group mode having no more (unread) groups." | |
727 :group 'gnus-group-select | |
728 :type 'hook) | |
729 | |
730 (defcustom gnus-ps-print-hook nil | |
731 "*A hook run before ps-printing something from Gnus." | |
732 :group 'gnus-summary | |
733 :type 'hook) | |
734 | |
735 (defcustom gnus-summary-selected-face 'gnus-summary-selected-face | |
736 "Face used for highlighting the current article in the summary buffer." | |
737 :group 'gnus-summary-visual | |
738 :type 'face) | |
739 | |
740 (defcustom gnus-summary-highlight | |
741 '(((= mark gnus-canceled-mark) | |
742 . gnus-summary-cancelled-face) | |
743 ((and (> score default) | |
744 (or (= mark gnus-dormant-mark) | |
745 (= mark gnus-ticked-mark))) | |
746 . gnus-summary-high-ticked-face) | |
747 ((and (< score default) | |
748 (or (= mark gnus-dormant-mark) | |
749 (= mark gnus-ticked-mark))) | |
750 . gnus-summary-low-ticked-face) | |
751 ((or (= mark gnus-dormant-mark) | |
752 (= mark gnus-ticked-mark)) | |
753 . gnus-summary-normal-ticked-face) | |
754 ((and (> score default) (= mark gnus-ancient-mark)) | |
755 . gnus-summary-high-ancient-face) | |
756 ((and (< score default) (= mark gnus-ancient-mark)) | |
757 . gnus-summary-low-ancient-face) | |
758 ((= mark gnus-ancient-mark) | |
759 . gnus-summary-normal-ancient-face) | |
760 ((and (> score default) (= mark gnus-unread-mark)) | |
761 . gnus-summary-high-unread-face) | |
762 ((and (< score default) (= mark gnus-unread-mark)) | |
763 . gnus-summary-low-unread-face) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
764 ((= mark gnus-unread-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
765 . gnus-summary-normal-unread-face) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
766 ((and (> score default) (memq mark (list gnus-downloadable-mark |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
767 gnus-undownloaded-mark))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
768 . gnus-summary-high-unread-face) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
769 ((and (< score default) (memq mark (list gnus-downloadable-mark |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
770 gnus-undownloaded-mark))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
771 . gnus-summary-low-unread-face) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
772 ((memq mark (list gnus-downloadable-mark gnus-undownloaded-mark)) |
17493 | 773 . gnus-summary-normal-unread-face) |
774 ((> score default) | |
775 . gnus-summary-high-read-face) | |
776 ((< score default) | |
777 . gnus-summary-low-read-face) | |
778 (t | |
779 . gnus-summary-normal-read-face)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
780 "*Controls the highlighting of summary buffer lines. |
17493 | 781 |
782 A list of (FORM . FACE) pairs. When deciding how a a particular | |
783 summary line should be displayed, each form is evaluated. The content | |
784 of the face field after the first true form is used. You can change | |
785 how those summary lines are displayed, by editing the face field. | |
786 | |
787 You can use the following variables in the FORM field. | |
788 | |
789 score: The articles score | |
790 default: The default article score. | |
791 below: The score below which articles are automatically marked as read. | |
792 mark: The articles mark." | |
793 :group 'gnus-summary-visual | |
794 :type '(repeat (cons (sexp :tag "Form" nil) | |
795 face))) | |
796 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
797 (defcustom gnus-alter-header-function nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
798 "Function called to allow alteration of article header structures. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
799 The function is called with one parameter, the article header vector, |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
800 which it may alter in any way.") |
17493 | 801 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
802 (defvar gnus-decode-encoded-word-function 'mail-decode-encoded-word-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
803 "Variable that says which function should be used to decode a string with encoded words.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
804 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
805 (defcustom gnus-extra-headers nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
806 "*Extra headers to parse." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
807 :group 'gnus-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
808 :type '(repeat symbol)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
809 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
810 (defcustom gnus-ignored-from-addresses |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
811 (and user-mail-address (regexp-quote user-mail-address)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
812 "*Regexp of From headers that may be suppressed in favor of To headers." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
813 :group 'gnus-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
814 :type 'regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
815 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
816 (defcustom gnus-group-charset-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
817 '(("^hk\\>\\|^tw\\>\\|\\<big5\\>" cn-big5) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
818 ("^cn\\>\\|\\<chinese\\>" cn-gb-2312) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
819 ("^fj\\>\\|^japan\\>" iso-2022-jp-2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
820 ("^tnn\\>\\|^pin\\>\\|^sci.lang.japan" iso-2022-7bit) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
821 ("^relcom\\>" koi8-r) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
822 ("^fido7\\>" koi8-r) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
823 ("^\\(cz\\|hun\\|pl\\|sk\\|hr\\)\\>" iso-8859-2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
824 ("^israel\\>" iso-8859-1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
825 ("^han\\>" euc-kr) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
826 ("^alt.chinese.text.big5\\>" chinese-big5) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
827 ("^soc.culture.vietnamese\\>" vietnamese-viqr) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
828 ("^\\(comp\\|rec\\|alt\\|sci\\|soc\\|news\\|gnu\\|bofh\\)\\>" iso-8859-1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
829 (".*" iso-8859-1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
830 "Alist of regexps (to match group names) and default charsets to be used when reading." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
831 :type '(repeat (list (regexp :tag "Group") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
832 (symbol :tag "Charset"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
833 :group 'gnus-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
834 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
835 (defcustom gnus-newsgroup-ignored-charsets '(unknown-8bit x-unknown) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
836 "List of charsets that should be ignored. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
837 When these charsets are used in the \"charset\" parameter, the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
838 default charset will be used instead." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
839 :type '(repeat symbol) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
840 :group 'gnus-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
841 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
842 (defcustom gnus-group-ignored-charsets-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
843 '(("alt\\.chinese\\.text" iso-8859-1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
844 "Alist of regexps (to match group names) and charsets that should be ignored. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
845 When these charsets are used in the \"charset\" parameter, the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
846 default charset will be used instead." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
847 :type '(repeat (cons (regexp :tag "Group") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
848 (repeat symbol))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
849 :group 'gnus-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
850 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
851 (defcustom gnus-group-highlight-words-alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
852 "Alist of group regexps and highlight regexps. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
853 This variable uses the same syntax as `gnus-emphasis-alist'." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
854 :type '(repeat (cons (regexp :tag "Group") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
855 (repeat (list (regexp :tag "Highlight regexp") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
856 (number :tag "Group for entire word" 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
857 (number :tag "Group for displayed part" 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
858 (symbol :tag "Face" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
859 gnus-emphasis-highlight-words))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
860 :group 'gnus-summary-visual) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
861 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
862 (defcustom gnus-summary-show-article-charset-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
863 nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
864 "Alist of number and charset. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
865 The article will be shown with the charset corresponding to the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
866 numbered argument. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
867 For example: ((1 . cn-gb-2312) (2 . big5))." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
868 :type '(repeat (cons (number :tag "Argument" 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
869 (symbol :tag "Charset"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
870 :group 'gnus-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
871 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
872 (defcustom gnus-preserve-marks t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
873 "Whether marks are preserved when moving, copying and respooling messages." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
874 :type 'boolean |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
875 :group 'gnus-summary-marks) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
876 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
877 (defcustom gnus-alter-articles-to-read-function nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
878 "Function to be called to alter the list of articles to be selected." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
879 :type 'function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
880 :group 'gnus-summary) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
881 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
882 (defcustom gnus-orphan-score nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
883 "*All orphans get this score added. Set in the score file." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
884 :group 'gnus-score-default |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
885 :type '(choice (const nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
886 integer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
887 |
31785 | 888 (defcustom gnus-summary-save-parts-default-mime "image/.*" |
889 "*A regexp to match MIME parts when saving multiple parts of a message | |
890 with gnus-summary-save-parts (X m). This regexp will be used by default | |
891 when prompting the user for which type of files to save." | |
892 :group 'gnus-summary | |
893 :type 'regexp) | |
894 | |
895 | |
17493 | 896 ;;; Internal variables |
897 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
898 (defvar gnus-article-mime-handles nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
899 (defvar gnus-article-decoded-p nil) |
17493 | 900 (defvar gnus-scores-exclude-files nil) |
901 (defvar gnus-page-broken nil) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
902 (defvar gnus-inhibit-mime-unbuttonizing nil) |
17493 | 903 |
904 (defvar gnus-original-article nil) | |
905 (defvar gnus-article-internal-prepare-hook nil) | |
906 (defvar gnus-newsgroup-process-stack nil) | |
907 | |
908 (defvar gnus-thread-indent-array nil) | |
909 (defvar gnus-thread-indent-array-level gnus-thread-indent-level) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
910 (defvar gnus-sort-gathered-threads-function 'gnus-thread-sort-by-number |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
911 "Function called to sort the articles within a thread after it has been gathered together.") |
17493 | 912 |
31785 | 913 (defvar gnus-summary-save-parts-type-history nil) |
914 (defvar gnus-summary-save-parts-last-directory nil) | |
915 | |
17493 | 916 ;; Avoid highlighting in kill files. |
917 (defvar gnus-summary-inhibit-highlight nil) | |
918 (defvar gnus-newsgroup-selected-overlay nil) | |
919 (defvar gnus-inhibit-limiting nil) | |
920 (defvar gnus-newsgroup-adaptive-score-file nil) | |
921 (defvar gnus-current-score-file nil) | |
922 (defvar gnus-current-move-group nil) | |
923 (defvar gnus-current-copy-group nil) | |
924 (defvar gnus-current-crosspost-group nil) | |
925 | |
926 (defvar gnus-newsgroup-dependencies nil) | |
927 (defvar gnus-newsgroup-adaptive nil) | |
928 (defvar gnus-summary-display-article-function nil) | |
929 (defvar gnus-summary-highlight-line-function nil | |
930 "Function called after highlighting a summary line.") | |
931 | |
932 (defvar gnus-summary-line-format-alist | |
933 `((?N ,(macroexpand '(mail-header-number gnus-tmp-header)) ?d) | |
934 (?S ,(macroexpand '(mail-header-subject gnus-tmp-header)) ?s) | |
935 (?s gnus-tmp-subject-or-nil ?s) | |
936 (?n gnus-tmp-name ?s) | |
937 (?A (car (cdr (funcall gnus-extract-address-components gnus-tmp-from))) | |
938 ?s) | |
939 (?a (or (car (funcall gnus-extract-address-components gnus-tmp-from)) | |
940 gnus-tmp-from) ?s) | |
941 (?F gnus-tmp-from ?s) | |
942 (?x ,(macroexpand '(mail-header-xref gnus-tmp-header)) ?s) | |
943 (?D ,(macroexpand '(mail-header-date gnus-tmp-header)) ?s) | |
944 (?d (gnus-dd-mmm (mail-header-date gnus-tmp-header)) ?s) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
945 (?o (gnus-date-iso8601 (mail-header-date gnus-tmp-header)) ?s) |
17493 | 946 (?M ,(macroexpand '(mail-header-id gnus-tmp-header)) ?s) |
947 (?r ,(macroexpand '(mail-header-references gnus-tmp-header)) ?s) | |
948 (?c (or (mail-header-chars gnus-tmp-header) 0) ?d) | |
949 (?L gnus-tmp-lines ?d) | |
950 (?I gnus-tmp-indentation ?s) | |
951 (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s) | |
952 (?R gnus-tmp-replied ?c) | |
953 (?\[ gnus-tmp-opening-bracket ?c) | |
954 (?\] gnus-tmp-closing-bracket ?c) | |
955 (?\> (make-string gnus-tmp-level ? ) ?s) | |
956 (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s) | |
957 (?i gnus-tmp-score ?d) | |
958 (?z gnus-tmp-score-char ?c) | |
959 (?l (bbb-grouplens-score gnus-tmp-header) ?s) | |
960 (?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d) | |
961 (?U gnus-tmp-unread ?c) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
962 (?f (gnus-summary-from-or-to-or-newsgroups gnus-tmp-header) ?s) |
17493 | 963 (?t (gnus-summary-number-of-articles-in-thread |
964 (and (boundp 'thread) (car thread)) gnus-tmp-level) | |
965 ?d) | |
966 (?e (gnus-summary-number-of-articles-in-thread | |
967 (and (boundp 'thread) (car thread)) gnus-tmp-level t) | |
968 ?c) | |
969 (?u gnus-tmp-user-defined ?s) | |
970 (?P (gnus-pick-line-number) ?d)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
971 "An alist of format specifications that can appear in summary lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
972 These are paired with what variables they correspond with, along with |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
973 the type of the variable (string, integer, character, etc).") |
17493 | 974 |
975 (defvar gnus-summary-dummy-line-format-alist | |
976 `((?S gnus-tmp-subject ?s) | |
977 (?N gnus-tmp-number ?d) | |
978 (?u gnus-tmp-user-defined ?s))) | |
979 | |
980 (defvar gnus-summary-mode-line-format-alist | |
981 `((?G gnus-tmp-group-name ?s) | |
982 (?g (gnus-short-group-name gnus-tmp-group-name) ?s) | |
983 (?p (gnus-group-real-name gnus-tmp-group-name) ?s) | |
984 (?A gnus-tmp-article-number ?d) | |
985 (?Z gnus-tmp-unread-and-unselected ?s) | |
986 (?V gnus-version ?s) | |
987 (?U gnus-tmp-unread-and-unticked ?d) | |
988 (?S gnus-tmp-subject ?s) | |
989 (?e gnus-tmp-unselected ?d) | |
990 (?u gnus-tmp-user-defined ?s) | |
991 (?d (length gnus-newsgroup-dormant) ?d) | |
992 (?t (length gnus-newsgroup-marked) ?d) | |
993 (?r (length gnus-newsgroup-reads) ?d) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
994 (?z (gnus-summary-article-score gnus-tmp-article-number) ?d) |
17493 | 995 (?E gnus-newsgroup-expunged-tally ?d) |
996 (?s (gnus-current-score-file-nondirectory) ?s))) | |
997 | |
998 (defvar gnus-last-search-regexp nil | |
999 "Default regexp for article search command.") | |
1000 | |
1001 (defvar gnus-last-shell-command nil | |
1002 "Default shell command on article.") | |
1003 | |
1004 (defvar gnus-newsgroup-begin nil) | |
1005 (defvar gnus-newsgroup-end nil) | |
1006 (defvar gnus-newsgroup-last-rmail nil) | |
1007 (defvar gnus-newsgroup-last-mail nil) | |
1008 (defvar gnus-newsgroup-last-folder nil) | |
1009 (defvar gnus-newsgroup-last-file nil) | |
1010 (defvar gnus-newsgroup-auto-expire nil) | |
1011 (defvar gnus-newsgroup-active nil) | |
1012 | |
1013 (defvar gnus-newsgroup-data nil) | |
1014 (defvar gnus-newsgroup-data-reverse nil) | |
1015 (defvar gnus-newsgroup-limit nil) | |
1016 (defvar gnus-newsgroup-limits nil) | |
1017 | |
1018 (defvar gnus-newsgroup-unreads nil | |
1019 "List of unread articles in the current newsgroup.") | |
1020 | |
1021 (defvar gnus-newsgroup-unselected nil | |
1022 "List of unselected unread articles in the current newsgroup.") | |
1023 | |
1024 (defvar gnus-newsgroup-reads nil | |
1025 "Alist of read articles and article marks in the current newsgroup.") | |
1026 | |
1027 (defvar gnus-newsgroup-expunged-tally nil) | |
1028 | |
1029 (defvar gnus-newsgroup-marked nil | |
1030 "List of ticked articles in the current newsgroup (a subset of unread art).") | |
1031 | |
1032 (defvar gnus-newsgroup-killed nil | |
1033 "List of ranges of articles that have been through the scoring process.") | |
1034 | |
1035 (defvar gnus-newsgroup-cached nil | |
1036 "List of articles that come from the article cache.") | |
1037 | |
1038 (defvar gnus-newsgroup-saved nil | |
1039 "List of articles that have been saved.") | |
1040 | |
1041 (defvar gnus-newsgroup-kill-headers nil) | |
1042 | |
1043 (defvar gnus-newsgroup-replied nil | |
1044 "List of articles that have been replied to in the current newsgroup.") | |
1045 | |
1046 (defvar gnus-newsgroup-expirable nil | |
1047 "List of articles in the current newsgroup that can be expired.") | |
1048 | |
1049 (defvar gnus-newsgroup-processable nil | |
1050 "List of articles in the current newsgroup that can be processed.") | |
1051 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1052 (defvar gnus-newsgroup-downloadable nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1053 "List of articles in the current newsgroup that can be processed.") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1054 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1055 (defvar gnus-newsgroup-undownloaded nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1056 "List of articles in the current newsgroup that haven't been downloaded..") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1057 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1058 (defvar gnus-newsgroup-unsendable nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1059 "List of articles in the current newsgroup that won't be sent.") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1060 |
17493 | 1061 (defvar gnus-newsgroup-bookmarks nil |
1062 "List of articles in the current newsgroup that have bookmarks.") | |
1063 | |
1064 (defvar gnus-newsgroup-dormant nil | |
1065 "List of dormant articles in the current newsgroup.") | |
1066 | |
1067 (defvar gnus-newsgroup-scored nil | |
1068 "List of scored articles in the current newsgroup.") | |
1069 | |
1070 (defvar gnus-newsgroup-headers nil | |
1071 "List of article headers in the current newsgroup.") | |
1072 | |
1073 (defvar gnus-newsgroup-threads nil) | |
1074 | |
1075 (defvar gnus-newsgroup-prepared nil | |
1076 "Whether the current group has been prepared properly.") | |
1077 | |
1078 (defvar gnus-newsgroup-ancient nil | |
1079 "List of `gnus-fetch-old-headers' articles in the current newsgroup.") | |
1080 | |
1081 (defvar gnus-newsgroup-sparse nil) | |
1082 | |
1083 (defvar gnus-current-article nil) | |
1084 (defvar gnus-article-current nil) | |
1085 (defvar gnus-current-headers nil) | |
1086 (defvar gnus-have-all-headers nil) | |
1087 (defvar gnus-last-article nil) | |
1088 (defvar gnus-newsgroup-history nil) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1089 (defvar gnus-newsgroup-charset nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1090 (defvar gnus-newsgroup-ephemeral-charset nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1091 (defvar gnus-newsgroup-ephemeral-ignored-charsets nil) |
17493 | 1092 |
1093 (defconst gnus-summary-local-variables | |
1094 '(gnus-newsgroup-name | |
1095 gnus-newsgroup-begin gnus-newsgroup-end | |
1096 gnus-newsgroup-last-rmail gnus-newsgroup-last-mail | |
1097 gnus-newsgroup-last-folder gnus-newsgroup-last-file | |
1098 gnus-newsgroup-auto-expire gnus-newsgroup-unreads | |
1099 gnus-newsgroup-unselected gnus-newsgroup-marked | |
1100 gnus-newsgroup-reads gnus-newsgroup-saved | |
1101 gnus-newsgroup-replied gnus-newsgroup-expirable | |
1102 gnus-newsgroup-processable gnus-newsgroup-killed | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1103 gnus-newsgroup-downloadable gnus-newsgroup-undownloaded |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1104 gnus-newsgroup-unsendable |
17493 | 1105 gnus-newsgroup-bookmarks gnus-newsgroup-dormant |
1106 gnus-newsgroup-headers gnus-newsgroup-threads | |
1107 gnus-newsgroup-prepared gnus-summary-highlight-line-function | |
1108 gnus-current-article gnus-current-headers gnus-have-all-headers | |
1109 gnus-last-article gnus-article-internal-prepare-hook | |
1110 gnus-newsgroup-dependencies gnus-newsgroup-selected-overlay | |
1111 gnus-newsgroup-scored gnus-newsgroup-kill-headers | |
1112 gnus-thread-expunge-below | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1113 gnus-score-alist gnus-current-score-file |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1114 (gnus-summary-expunge-below . global) |
17493 | 1115 (gnus-summary-mark-below . global) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1116 (gnus-orphan-score . global) |
17493 | 1117 gnus-newsgroup-active gnus-scores-exclude-files |
1118 gnus-newsgroup-history gnus-newsgroup-ancient | |
1119 gnus-newsgroup-sparse gnus-newsgroup-process-stack | |
1120 (gnus-newsgroup-adaptive . gnus-use-adaptive-scoring) | |
1121 gnus-newsgroup-adaptive-score-file (gnus-reffed-article-number . -1) | |
1122 (gnus-newsgroup-expunged-tally . 0) | |
1123 gnus-cache-removable-articles gnus-newsgroup-cached | |
1124 gnus-newsgroup-data gnus-newsgroup-data-reverse | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1125 gnus-newsgroup-limit gnus-newsgroup-limits |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1126 gnus-newsgroup-charset) |
17493 | 1127 "Variables that are buffer-local to the summary buffers.") |
1128 | |
1129 ;; Byte-compiler warning. | |
1130 (defvar gnus-article-mode-map) | |
1131 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1132 ;; MIME stuff. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1133 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1134 (defvar gnus-decode-encoded-word-methods |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1135 '(mail-decode-encoded-word-string) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1136 "List of methods used to decode encoded words. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1137 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1138 This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item is |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1139 FUNCTION, FUNCTION will be apply to all newsgroups. If item is a |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1140 (REGEXP . FUNCTION), FUNCTION will be only apply to thes newsgroups |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1141 whose names match REGEXP. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1142 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1143 For example: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1144 ((\"chinese\" . gnus-decode-encoded-word-string-by-guess) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1145 mail-decode-encoded-word-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1146 (\"chinese\" . rfc1843-decode-string))") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1147 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1148 (defvar gnus-decode-encoded-word-methods-cache nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1149 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1150 (defun gnus-multi-decode-encoded-word-string (string) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1151 "Apply the functions from `gnus-encoded-word-methods' that match." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1152 (unless (and gnus-decode-encoded-word-methods-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1153 (eq gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1154 (car gnus-decode-encoded-word-methods-cache))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1155 (setq gnus-decode-encoded-word-methods-cache (list gnus-newsgroup-name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1156 (mapcar (lambda (x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1157 (if (symbolp x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1158 (nconc gnus-decode-encoded-word-methods-cache (list x)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1159 (if (and gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1160 (string-match (car x) gnus-newsgroup-name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1161 (nconc gnus-decode-encoded-word-methods-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1162 (list (cdr x)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1163 gnus-decode-encoded-word-methods)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1164 (let ((xlist gnus-decode-encoded-word-methods-cache)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1165 (pop xlist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1166 (while xlist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1167 (setq string (funcall (pop xlist) string)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1168 string) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1169 |
17493 | 1170 ;; Subject simplification. |
1171 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1172 (defun gnus-simplify-whitespace (str) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1173 "Remove excessive whitespace from STR." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1174 (let ((mystr str)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1175 ;; Multiple spaces. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1176 (while (string-match "[ \t][ \t]+" mystr) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1177 (setq mystr (concat (substring mystr 0 (match-beginning 0)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1178 " " |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1179 (substring mystr (match-end 0))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1180 ;; Leading spaces. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1181 (when (string-match "^[ \t]+" mystr) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1182 (setq mystr (substring mystr (match-end 0)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1183 ;; Trailing spaces. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1184 (when (string-match "[ \t]+$" mystr) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1185 (setq mystr (substring mystr 0 (match-beginning 0)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1186 mystr)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1187 |
17493 | 1188 (defsubst gnus-simplify-subject-re (subject) |
1189 "Remove \"Re:\" from subject lines." | |
1190 (if (string-match "^[Rr][Ee]: *" subject) | |
1191 (substring subject (match-end 0)) | |
1192 subject)) | |
1193 | |
1194 (defun gnus-simplify-subject (subject &optional re-only) | |
1195 "Remove `Re:' and words in parentheses. | |
1196 If RE-ONLY is non-nil, strip leading `Re:'s only." | |
1197 (let ((case-fold-search t)) ;Ignore case. | |
1198 ;; Remove `Re:', `Re^N:', `Re(n)', and `Re[n]:'. | |
1199 (when (string-match "\\`\\(re\\([[(^][0-9]+[])]?\\)?:[ \t]*\\)+" subject) | |
1200 (setq subject (substring subject (match-end 0)))) | |
1201 ;; Remove uninteresting prefixes. | |
1202 (when (and (not re-only) | |
1203 gnus-simplify-ignored-prefixes | |
1204 (string-match gnus-simplify-ignored-prefixes subject)) | |
1205 (setq subject (substring subject (match-end 0)))) | |
1206 ;; Remove words in parentheses from end. | |
1207 (unless re-only | |
1208 (while (string-match "[ \t\n]*([^()]*)[ \t\n]*\\'" subject) | |
1209 (setq subject (substring subject 0 (match-beginning 0))))) | |
1210 ;; Return subject string. | |
1211 subject)) | |
1212 | |
1213 ;; Remove any leading "re:"s, any trailing paren phrases, and simplify | |
1214 ;; all whitespace. | |
1215 (defsubst gnus-simplify-buffer-fuzzy-step (regexp &optional newtext) | |
1216 (goto-char (point-min)) | |
1217 (while (re-search-forward regexp nil t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1218 (replace-match (or newtext "")))) |
17493 | 1219 |
1220 (defun gnus-simplify-buffer-fuzzy () | |
1221 "Simplify string in the buffer fuzzily. | |
1222 The string in the accessible portion of the current buffer is simplified. | |
1223 It is assumed to be a single-line subject. | |
1224 Whitespace is generally cleaned up, and miscellaneous leading/trailing | |
1225 matter is removed. Additional things can be deleted by setting | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1226 `gnus-simplify-subject-fuzzy-regexp'." |
17493 | 1227 (let ((case-fold-search t) |
1228 (modified-tick)) | |
1229 (gnus-simplify-buffer-fuzzy-step "\t" " ") | |
1230 | |
1231 (while (not (eq modified-tick (buffer-modified-tick))) | |
1232 (setq modified-tick (buffer-modified-tick)) | |
1233 (cond | |
1234 ((listp gnus-simplify-subject-fuzzy-regexp) | |
1235 (mapcar 'gnus-simplify-buffer-fuzzy-step | |
1236 gnus-simplify-subject-fuzzy-regexp)) | |
1237 (gnus-simplify-subject-fuzzy-regexp | |
1238 (gnus-simplify-buffer-fuzzy-step gnus-simplify-subject-fuzzy-regexp))) | |
1239 (gnus-simplify-buffer-fuzzy-step "^ *\\[[-+?*!][-+?*!]\\] *") | |
1240 (gnus-simplify-buffer-fuzzy-step | |
1241 "^ *\\(re\\|fw\\|fwd\\)[[{(^0-9]*[])}]?[:;] *") | |
1242 (gnus-simplify-buffer-fuzzy-step "^[[].*:\\( .*\\)[]]$" "\\1")) | |
1243 | |
1244 (gnus-simplify-buffer-fuzzy-step " *[[{(][^()\n]*[]})] *$") | |
1245 (gnus-simplify-buffer-fuzzy-step " +" " ") | |
1246 (gnus-simplify-buffer-fuzzy-step " $") | |
1247 (gnus-simplify-buffer-fuzzy-step "^ +"))) | |
1248 | |
1249 (defun gnus-simplify-subject-fuzzy (subject) | |
1250 "Simplify a subject string fuzzily. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1251 See `gnus-simplify-buffer-fuzzy' for details." |
17493 | 1252 (save-excursion |
1253 (gnus-set-work-buffer) | |
1254 (let ((case-fold-search t)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1255 ;; Remove uninteresting prefixes. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1256 (when (and gnus-simplify-ignored-prefixes |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1257 (string-match gnus-simplify-ignored-prefixes subject)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1258 (setq subject (substring subject (match-end 0)))) |
17493 | 1259 (insert subject) |
1260 (inline (gnus-simplify-buffer-fuzzy)) | |
1261 (buffer-string)))) | |
1262 | |
1263 (defsubst gnus-simplify-subject-fully (subject) | |
1264 "Simplify a subject string according to gnus-summary-gather-subject-limit." | |
1265 (cond | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1266 (gnus-simplify-subject-functions |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1267 (gnus-map-function gnus-simplify-subject-functions subject)) |
17493 | 1268 ((null gnus-summary-gather-subject-limit) |
1269 (gnus-simplify-subject-re subject)) | |
1270 ((eq gnus-summary-gather-subject-limit 'fuzzy) | |
1271 (gnus-simplify-subject-fuzzy subject)) | |
1272 ((numberp gnus-summary-gather-subject-limit) | |
1273 (gnus-limit-string (gnus-simplify-subject-re subject) | |
1274 gnus-summary-gather-subject-limit)) | |
1275 (t | |
1276 subject))) | |
1277 | |
1278 (defsubst gnus-subject-equal (s1 s2 &optional simple-first) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1279 "Check whether two subjects are equal. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1280 If optional argument simple-first is t, first argument is already |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1281 simplified." |
17493 | 1282 (cond |
1283 ((null simple-first) | |
1284 (equal (gnus-simplify-subject-fully s1) | |
1285 (gnus-simplify-subject-fully s2))) | |
1286 (t | |
1287 (equal s1 | |
1288 (gnus-simplify-subject-fully s2))))) | |
1289 | |
1290 (defun gnus-summary-bubble-group () | |
1291 "Increase the score of the current group. | |
1292 This is a handy function to add to `gnus-summary-exit-hook' to | |
1293 increase the score of each group you read." | |
1294 (gnus-group-add-score gnus-newsgroup-name)) | |
1295 | |
1296 | |
1297 ;;; | |
1298 ;;; Gnus summary mode | |
1299 ;;; | |
1300 | |
1301 (put 'gnus-summary-mode 'mode-class 'special) | |
1302 | |
1303 (when t | |
1304 ;; Non-orthogonal keys | |
1305 | |
1306 (gnus-define-keys gnus-summary-mode-map | |
1307 " " gnus-summary-next-page | |
1308 "\177" gnus-summary-prev-page | |
1309 [delete] gnus-summary-prev-page | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1310 [backspace] gnus-summary-prev-page |
17493 | 1311 "\r" gnus-summary-scroll-up |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1312 "\M-\r" gnus-summary-scroll-down |
17493 | 1313 "n" gnus-summary-next-unread-article |
1314 "p" gnus-summary-prev-unread-article | |
1315 "N" gnus-summary-next-article | |
1316 "P" gnus-summary-prev-article | |
1317 "\M-\C-n" gnus-summary-next-same-subject | |
1318 "\M-\C-p" gnus-summary-prev-same-subject | |
1319 "\M-n" gnus-summary-next-unread-subject | |
1320 "\M-p" gnus-summary-prev-unread-subject | |
1321 "." gnus-summary-first-unread-article | |
1322 "," gnus-summary-best-unread-article | |
1323 "\M-s" gnus-summary-search-article-forward | |
1324 "\M-r" gnus-summary-search-article-backward | |
1325 "<" gnus-summary-beginning-of-article | |
1326 ">" gnus-summary-end-of-article | |
1327 "j" gnus-summary-goto-article | |
1328 "^" gnus-summary-refer-parent-article | |
1329 "\M-^" gnus-summary-refer-article | |
1330 "u" gnus-summary-tick-article-forward | |
1331 "!" gnus-summary-tick-article-forward | |
1332 "U" gnus-summary-tick-article-backward | |
1333 "d" gnus-summary-mark-as-read-forward | |
1334 "D" gnus-summary-mark-as-read-backward | |
1335 "E" gnus-summary-mark-as-expirable | |
1336 "\M-u" gnus-summary-clear-mark-forward | |
1337 "\M-U" gnus-summary-clear-mark-backward | |
1338 "k" gnus-summary-kill-same-subject-and-select | |
1339 "\C-k" gnus-summary-kill-same-subject | |
1340 "\M-\C-k" gnus-summary-kill-thread | |
1341 "\M-\C-l" gnus-summary-lower-thread | |
1342 "e" gnus-summary-edit-article | |
1343 "#" gnus-summary-mark-as-processable | |
1344 "\M-#" gnus-summary-unmark-as-processable | |
1345 "\M-\C-t" gnus-summary-toggle-threads | |
1346 "\M-\C-s" gnus-summary-show-thread | |
1347 "\M-\C-h" gnus-summary-hide-thread | |
1348 "\M-\C-f" gnus-summary-next-thread | |
1349 "\M-\C-b" gnus-summary-prev-thread | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1350 [(meta down)] gnus-summary-next-thread |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1351 [(meta up)] gnus-summary-prev-thread |
17493 | 1352 "\M-\C-u" gnus-summary-up-thread |
1353 "\M-\C-d" gnus-summary-down-thread | |
1354 "&" gnus-summary-execute-command | |
1355 "c" gnus-summary-catchup-and-exit | |
1356 "\C-w" gnus-summary-mark-region-as-read | |
1357 "\C-t" gnus-summary-toggle-truncation | |
1358 "?" gnus-summary-mark-as-dormant | |
1359 "\C-c\M-\C-s" gnus-summary-limit-include-expunged | |
1360 "\C-c\C-s\C-n" gnus-summary-sort-by-number | |
1361 "\C-c\C-s\C-l" gnus-summary-sort-by-lines | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1362 "\C-c\C-s\C-c" gnus-summary-sort-by-chars |
17493 | 1363 "\C-c\C-s\C-a" gnus-summary-sort-by-author |
1364 "\C-c\C-s\C-s" gnus-summary-sort-by-subject | |
1365 "\C-c\C-s\C-d" gnus-summary-sort-by-date | |
1366 "\C-c\C-s\C-i" gnus-summary-sort-by-score | |
1367 "=" gnus-summary-expand-window | |
1368 "\C-x\C-s" gnus-summary-reselect-current-group | |
1369 "\M-g" gnus-summary-rescan-group | |
1370 "w" gnus-summary-stop-page-breaking | |
1371 "\C-c\C-r" gnus-summary-caesar-message | |
1372 "f" gnus-summary-followup | |
1373 "F" gnus-summary-followup-with-original | |
1374 "C" gnus-summary-cancel-article | |
1375 "r" gnus-summary-reply | |
1376 "R" gnus-summary-reply-with-original | |
1377 "\C-c\C-f" gnus-summary-mail-forward | |
1378 "o" gnus-summary-save-article | |
1379 "\C-o" gnus-summary-save-article-mail | |
1380 "|" gnus-summary-pipe-output | |
1381 "\M-k" gnus-summary-edit-local-kill | |
1382 "\M-K" gnus-summary-edit-global-kill | |
1383 ;; "V" gnus-version | |
1384 "\C-c\C-d" gnus-summary-describe-group | |
1385 "q" gnus-summary-exit | |
1386 "Q" gnus-summary-exit-no-update | |
1387 "\C-c\C-i" gnus-info-find-node | |
1388 gnus-mouse-2 gnus-mouse-pick-article | |
1389 "m" gnus-summary-mail-other-window | |
1390 "a" gnus-summary-post-news | |
1391 "x" gnus-summary-limit-to-unread | |
1392 "s" gnus-summary-isearch-article | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1393 "t" gnus-summary-toggle-header |
17493 | 1394 "g" gnus-summary-show-article |
1395 "l" gnus-summary-goto-last-article | |
1396 "\C-c\C-v\C-v" gnus-uu-decode-uu-view | |
1397 "\C-d" gnus-summary-enter-digest-group | |
1398 "\M-\C-d" gnus-summary-read-document | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1399 "\M-\C-e" gnus-summary-edit-parameters |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1400 "\M-\C-a" gnus-summary-customize-parameters |
17493 | 1401 "\C-c\C-b" gnus-bug |
1402 "*" gnus-cache-enter-article | |
1403 "\M-*" gnus-cache-remove-article | |
1404 "\M-&" gnus-summary-universal-argument | |
1405 "\C-l" gnus-recenter | |
1406 "I" gnus-summary-increase-score | |
1407 "L" gnus-summary-lower-score | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1408 "\M-i" gnus-symbolic-argument |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1409 "h" gnus-summary-select-article-buffer |
17493 | 1410 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1411 "b" gnus-article-view-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1412 "\M-t" gnus-summary-toggle-display-buttonized |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1413 |
17493 | 1414 "V" gnus-summary-score-map |
1415 "X" gnus-uu-extract-map | |
1416 "S" gnus-summary-send-map) | |
1417 | |
1418 ;; Sort of orthogonal keymap | |
1419 (gnus-define-keys (gnus-summary-mark-map "M" gnus-summary-mode-map) | |
1420 "t" gnus-summary-tick-article-forward | |
1421 "!" gnus-summary-tick-article-forward | |
1422 "d" gnus-summary-mark-as-read-forward | |
1423 "r" gnus-summary-mark-as-read-forward | |
1424 "c" gnus-summary-clear-mark-forward | |
1425 " " gnus-summary-clear-mark-forward | |
1426 "e" gnus-summary-mark-as-expirable | |
1427 "x" gnus-summary-mark-as-expirable | |
1428 "?" gnus-summary-mark-as-dormant | |
1429 "b" gnus-summary-set-bookmark | |
1430 "B" gnus-summary-remove-bookmark | |
1431 "#" gnus-summary-mark-as-processable | |
1432 "\M-#" gnus-summary-unmark-as-processable | |
1433 "S" gnus-summary-limit-include-expunged | |
1434 "C" gnus-summary-catchup | |
1435 "H" gnus-summary-catchup-to-here | |
1436 "\C-c" gnus-summary-catchup-all | |
1437 "k" gnus-summary-kill-same-subject-and-select | |
1438 "K" gnus-summary-kill-same-subject | |
1439 "P" gnus-uu-mark-map) | |
1440 | |
1441 (gnus-define-keys (gnus-summary-mscore-map "V" gnus-summary-mark-map) | |
1442 "c" gnus-summary-clear-above | |
1443 "u" gnus-summary-tick-above | |
1444 "m" gnus-summary-mark-above | |
1445 "k" gnus-summary-kill-below) | |
1446 | |
1447 (gnus-define-keys (gnus-summary-limit-map "/" gnus-summary-mode-map) | |
1448 "/" gnus-summary-limit-to-subject | |
1449 "n" gnus-summary-limit-to-articles | |
1450 "w" gnus-summary-pop-limit | |
1451 "s" gnus-summary-limit-to-subject | |
1452 "a" gnus-summary-limit-to-author | |
1453 "u" gnus-summary-limit-to-unread | |
1454 "m" gnus-summary-limit-to-marks | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1455 "M" gnus-summary-limit-exclude-marks |
17493 | 1456 "v" gnus-summary-limit-to-score |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1457 "*" gnus-summary-limit-include-cached |
17493 | 1458 "D" gnus-summary-limit-include-dormant |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1459 "T" gnus-summary-limit-include-thread |
17493 | 1460 "d" gnus-summary-limit-exclude-dormant |
1461 "t" gnus-summary-limit-to-age | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1462 "x" gnus-summary-limit-to-extra |
17493 | 1463 "E" gnus-summary-limit-include-expunged |
1464 "c" gnus-summary-limit-exclude-childless-dormant | |
1465 "C" gnus-summary-limit-mark-excluded-as-read) | |
1466 | |
1467 (gnus-define-keys (gnus-summary-goto-map "G" gnus-summary-mode-map) | |
1468 "n" gnus-summary-next-unread-article | |
1469 "p" gnus-summary-prev-unread-article | |
1470 "N" gnus-summary-next-article | |
1471 "P" gnus-summary-prev-article | |
1472 "\C-n" gnus-summary-next-same-subject | |
1473 "\C-p" gnus-summary-prev-same-subject | |
1474 "\M-n" gnus-summary-next-unread-subject | |
1475 "\M-p" gnus-summary-prev-unread-subject | |
1476 "f" gnus-summary-first-unread-article | |
1477 "b" gnus-summary-best-unread-article | |
1478 "j" gnus-summary-goto-article | |
1479 "g" gnus-summary-goto-subject | |
1480 "l" gnus-summary-goto-last-article | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
1481 "o" gnus-summary-pop-article) |
17493 | 1482 |
1483 (gnus-define-keys (gnus-summary-thread-map "T" gnus-summary-mode-map) | |
1484 "k" gnus-summary-kill-thread | |
1485 "l" gnus-summary-lower-thread | |
1486 "i" gnus-summary-raise-thread | |
1487 "T" gnus-summary-toggle-threads | |
1488 "t" gnus-summary-rethread-current | |
1489 "^" gnus-summary-reparent-thread | |
1490 "s" gnus-summary-show-thread | |
1491 "S" gnus-summary-show-all-threads | |
1492 "h" gnus-summary-hide-thread | |
1493 "H" gnus-summary-hide-all-threads | |
1494 "n" gnus-summary-next-thread | |
1495 "p" gnus-summary-prev-thread | |
1496 "u" gnus-summary-up-thread | |
1497 "o" gnus-summary-top-thread | |
1498 "d" gnus-summary-down-thread | |
1499 "#" gnus-uu-mark-thread | |
1500 "\M-#" gnus-uu-unmark-thread) | |
1501 | |
1502 (gnus-define-keys (gnus-summary-buffer-map "Y" gnus-summary-mode-map) | |
1503 "g" gnus-summary-prepare | |
1504 "c" gnus-summary-insert-cached-articles) | |
1505 | |
1506 (gnus-define-keys (gnus-summary-exit-map "Z" gnus-summary-mode-map) | |
1507 "c" gnus-summary-catchup-and-exit | |
1508 "C" gnus-summary-catchup-all-and-exit | |
1509 "E" gnus-summary-exit-no-update | |
1510 "Q" gnus-summary-exit | |
1511 "Z" gnus-summary-exit | |
1512 "n" gnus-summary-catchup-and-goto-next-group | |
1513 "R" gnus-summary-reselect-current-group | |
1514 "G" gnus-summary-rescan-group | |
1515 "N" gnus-summary-next-group | |
1516 "s" gnus-summary-save-newsrc | |
1517 "P" gnus-summary-prev-group) | |
1518 | |
1519 (gnus-define-keys (gnus-summary-article-map "A" gnus-summary-mode-map) | |
1520 " " gnus-summary-next-page | |
1521 "n" gnus-summary-next-page | |
1522 "\177" gnus-summary-prev-page | |
1523 [delete] gnus-summary-prev-page | |
1524 "p" gnus-summary-prev-page | |
1525 "\r" gnus-summary-scroll-up | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1526 "\M-\r" gnus-summary-scroll-down |
17493 | 1527 "<" gnus-summary-beginning-of-article |
1528 ">" gnus-summary-end-of-article | |
1529 "b" gnus-summary-beginning-of-article | |
1530 "e" gnus-summary-end-of-article | |
1531 "^" gnus-summary-refer-parent-article | |
1532 "r" gnus-summary-refer-parent-article | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1533 "D" gnus-summary-enter-digest-group |
17493 | 1534 "R" gnus-summary-refer-references |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1535 "T" gnus-summary-refer-thread |
17493 | 1536 "g" gnus-summary-show-article |
1537 "s" gnus-summary-isearch-article | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1538 "P" gnus-summary-print-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1539 "t" gnus-article-babel) |
17493 | 1540 |
1541 (gnus-define-keys (gnus-summary-wash-map "W" gnus-summary-mode-map) | |
1542 "b" gnus-article-add-buttons | |
1543 "B" gnus-article-add-buttons-to-head | |
1544 "o" gnus-article-treat-overstrike | |
1545 "e" gnus-article-emphasize | |
1546 "w" gnus-article-fill-cited-article | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1547 "Q" gnus-article-fill-long-lines |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1548 "C" gnus-article-capitalize-sentences |
17493 | 1549 "c" gnus-article-remove-cr |
1550 "q" gnus-article-de-quoted-unreadable | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1551 "6" gnus-article-de-base64-unreadable |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1552 "Z" gnus-article-decode-HZ |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1553 "h" gnus-article-wash-html |
17493 | 1554 "f" gnus-article-display-x-face |
1555 "l" gnus-summary-stop-page-breaking | |
1556 "r" gnus-summary-caesar-message | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1557 "t" gnus-summary-toggle-header |
17493 | 1558 "v" gnus-summary-verbose-headers |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1559 "H" gnus-article-strip-headers-in-body |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1560 "d" gnus-article-treat-dumbquotes) |
17493 | 1561 |
1562 (gnus-define-keys (gnus-summary-wash-hide-map "W" gnus-summary-wash-map) | |
1563 "a" gnus-article-hide | |
1564 "h" gnus-article-hide-headers | |
1565 "b" gnus-article-hide-boring-headers | |
1566 "s" gnus-article-hide-signature | |
1567 "c" gnus-article-hide-citation | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1568 "C" gnus-article-hide-citation-in-followups |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1569 "l" gnus-article-hide-list-identifiers |
17493 | 1570 "p" gnus-article-hide-pgp |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1571 "B" gnus-article-strip-banner |
17493 | 1572 "P" gnus-article-hide-pem |
1573 "\C-c" gnus-article-hide-citation-maybe) | |
1574 | |
1575 (gnus-define-keys (gnus-summary-wash-highlight-map "H" gnus-summary-wash-map) | |
1576 "a" gnus-article-highlight | |
1577 "h" gnus-article-highlight-headers | |
1578 "c" gnus-article-highlight-citation | |
1579 "s" gnus-article-highlight-signature) | |
1580 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1581 (gnus-define-keys (gnus-summary-wash-mime-map "M" gnus-summary-wash-map) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1582 "w" gnus-article-decode-mime-words |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1583 "c" gnus-article-decode-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1584 "v" gnus-mime-view-all-parts |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1585 "b" gnus-article-view-part) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1586 |
17493 | 1587 (gnus-define-keys (gnus-summary-wash-time-map "T" gnus-summary-wash-map) |
1588 "z" gnus-article-date-ut | |
1589 "u" gnus-article-date-ut | |
1590 "l" gnus-article-date-local | |
1591 "e" gnus-article-date-lapsed | |
1592 "o" gnus-article-date-original | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1593 "i" gnus-article-date-iso8601 |
17493 | 1594 "s" gnus-article-date-user) |
1595 | |
1596 (gnus-define-keys (gnus-summary-wash-empty-map "E" gnus-summary-wash-map) | |
1597 "t" gnus-article-remove-trailing-blank-lines | |
1598 "l" gnus-article-strip-leading-blank-lines | |
1599 "m" gnus-article-strip-multiple-blank-lines | |
1600 "a" gnus-article-strip-blank-lines | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1601 "A" gnus-article-strip-all-blank-lines |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1602 "s" gnus-article-strip-leading-space |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1603 "e" gnus-article-strip-trailing-space) |
17493 | 1604 |
1605 (gnus-define-keys (gnus-summary-help-map "H" gnus-summary-mode-map) | |
1606 "v" gnus-version | |
1607 "f" gnus-summary-fetch-faq | |
1608 "d" gnus-summary-describe-group | |
1609 "h" gnus-summary-describe-briefly | |
1610 "i" gnus-info-find-node) | |
1611 | |
1612 (gnus-define-keys (gnus-summary-backend-map "B" gnus-summary-mode-map) | |
1613 "e" gnus-summary-expire-articles | |
1614 "\M-\C-e" gnus-summary-expire-articles-now | |
1615 "\177" gnus-summary-delete-article | |
1616 [delete] gnus-summary-delete-article | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1617 [backspace] gnus-summary-delete-article |
17493 | 1618 "m" gnus-summary-move-article |
1619 "r" gnus-summary-respool-article | |
1620 "w" gnus-summary-edit-article | |
1621 "c" gnus-summary-copy-article | |
1622 "B" gnus-summary-crosspost-article | |
1623 "q" gnus-summary-respool-query | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1624 "t" gnus-summary-respool-trace |
17493 | 1625 "i" gnus-summary-import-article |
1626 "p" gnus-summary-article-posted-p) | |
1627 | |
1628 (gnus-define-keys (gnus-summary-save-map "O" gnus-summary-mode-map) | |
1629 "o" gnus-summary-save-article | |
1630 "m" gnus-summary-save-article-mail | |
1631 "F" gnus-summary-write-article-file | |
1632 "r" gnus-summary-save-article-rmail | |
1633 "f" gnus-summary-save-article-file | |
1634 "b" gnus-summary-save-article-body-file | |
1635 "h" gnus-summary-save-article-folder | |
1636 "v" gnus-summary-save-article-vm | |
1637 "p" gnus-summary-pipe-output | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1638 "s" gnus-soup-add-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1639 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1640 (gnus-define-keys (gnus-summary-mime-map "K" gnus-summary-mode-map) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1641 "b" gnus-summary-display-buttonized |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1642 "m" gnus-summary-repair-multipart |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1643 "v" gnus-article-view-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1644 "o" gnus-article-save-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1645 "c" gnus-article-copy-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1646 "e" gnus-article-externalize-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1647 "i" gnus-article-inline-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1648 "|" gnus-article-pipe-part)) |
17493 | 1649 |
1650 (defun gnus-summary-make-menu-bar () | |
1651 (gnus-turn-off-edit-menu 'summary) | |
1652 | |
1653 (unless (boundp 'gnus-summary-misc-menu) | |
1654 | |
1655 (easy-menu-define | |
1656 gnus-summary-kill-menu gnus-summary-mode-map "" | |
1657 (cons | |
1658 "Score" | |
1659 (nconc | |
1660 (list | |
1661 ["Enter score..." gnus-summary-score-entry t] | |
1662 ["Customize" gnus-score-customize t]) | |
1663 (gnus-make-score-map 'increase) | |
1664 (gnus-make-score-map 'lower) | |
1665 '(("Mark" | |
1666 ["Kill below" gnus-summary-kill-below t] | |
1667 ["Mark above" gnus-summary-mark-above t] | |
1668 ["Tick above" gnus-summary-tick-above t] | |
1669 ["Clear above" gnus-summary-clear-above t]) | |
1670 ["Current score" gnus-summary-current-score t] | |
1671 ["Set score" gnus-summary-set-score t] | |
1672 ["Switch current score file..." gnus-score-change-score-file t] | |
1673 ["Set mark below..." gnus-score-set-mark-below t] | |
1674 ["Set expunge below..." gnus-score-set-expunge-below t] | |
1675 ["Edit current score file" gnus-score-edit-current-scores t] | |
1676 ["Edit score file" gnus-score-edit-file t] | |
1677 ["Trace score" gnus-score-find-trace t] | |
1678 ["Find words" gnus-score-find-favourite-words t] | |
1679 ["Rescore buffer" gnus-summary-rescore t] | |
1680 ["Increase score..." gnus-summary-increase-score t] | |
1681 ["Lower score..." gnus-summary-lower-score t])))) | |
1682 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1683 ;; Define both the Article menu in the summary buffer and the equivalent |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1684 ;; Commands menu in the article buffer here for consistency. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1685 (let ((innards |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1686 '(("Hide" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1687 ["All" gnus-article-hide t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1688 ["Headers" gnus-article-hide-headers t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1689 ["Signature" gnus-article-hide-signature t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1690 ["Citation" gnus-article-hide-citation t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1691 ["List identifiers" gnus-article-hide-list-identifiers t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1692 ["PGP" gnus-article-hide-pgp t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1693 ["Banner" gnus-article-strip-banner t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1694 ["Boring headers" gnus-article-hide-boring-headers t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1695 ("Highlight" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1696 ["All" gnus-article-highlight t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1697 ["Headers" gnus-article-highlight-headers t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1698 ["Signature" gnus-article-highlight-signature t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1699 ["Citation" gnus-article-highlight-citation t]) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1700 ("MIME" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1701 ["Words" gnus-article-decode-mime-words t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1702 ["Charset" gnus-article-decode-charset t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1703 ["QP" gnus-article-de-quoted-unreadable t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1704 ["Base64" gnus-article-de-base64-unreadable t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1705 ["View all" gnus-mime-view-all-parts t]) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1706 ("Date" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1707 ["Local" gnus-article-date-local t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1708 ["ISO8601" gnus-article-date-iso8601 t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1709 ["UT" gnus-article-date-ut t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1710 ["Original" gnus-article-date-original t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1711 ["Lapsed" gnus-article-date-lapsed t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1712 ["User-defined" gnus-article-date-user t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1713 ("Washing" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1714 ("Remove Blanks" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1715 ["Leading" gnus-article-strip-leading-blank-lines t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1716 ["Multiple" gnus-article-strip-multiple-blank-lines t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1717 ["Trailing" gnus-article-remove-trailing-blank-lines t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1718 ["All of the above" gnus-article-strip-blank-lines t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1719 ["All" gnus-article-strip-all-blank-lines t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1720 ["Leading space" gnus-article-strip-leading-space t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1721 ["Trailing space" gnus-article-strip-trailing-space t]) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1722 ["Overstrike" gnus-article-treat-overstrike t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1723 ["Dumb quotes" gnus-article-treat-dumbquotes t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1724 ["Emphasis" gnus-article-emphasize t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1725 ["Word wrap" gnus-article-fill-cited-article t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1726 ["Fill long lines" gnus-article-fill-long-lines t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1727 ["Capitalize sentences" gnus-article-capitalize-sentences t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1728 ["CR" gnus-article-remove-cr t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1729 ["Show X-Face" gnus-article-display-x-face t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1730 ["Quoted-Printable" gnus-article-de-quoted-unreadable t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1731 ["Base64" gnus-article-de-base64-unreadable t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1732 ["Rot 13" gnus-summary-caesar-message t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1733 ["Unix pipe" gnus-summary-pipe-message t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1734 ["Add buttons" gnus-article-add-buttons t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1735 ["Add buttons to head" gnus-article-add-buttons-to-head t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1736 ["Stop page breaking" gnus-summary-stop-page-breaking t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1737 ["Verbose header" gnus-summary-verbose-headers t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1738 ["Toggle header" gnus-summary-toggle-header t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1739 ["Html" gnus-article-wash-html t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1740 ["HZ" gnus-article-decode-HZ t]) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1741 ("Output" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1742 ["Save in default format" gnus-summary-save-article t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1743 ["Save in file" gnus-summary-save-article-file t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1744 ["Save in Unix mail format" gnus-summary-save-article-mail t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1745 ["Save in MH folder" gnus-summary-save-article-folder t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1746 ["Save in VM folder" gnus-summary-save-article-vm t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1747 ["Save in RMAIL mbox" gnus-summary-save-article-rmail t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1748 ["Save body in file" gnus-summary-save-article-body-file t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1749 ["Pipe through a filter" gnus-summary-pipe-output t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1750 ["Add to SOUP packet" gnus-soup-add-article t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1751 ["Print" gnus-summary-print-article t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1752 ("Backend" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1753 ["Respool article..." gnus-summary-respool-article t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1754 ["Move article..." gnus-summary-move-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1755 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1756 'request-move-article gnus-newsgroup-name)] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1757 ["Copy article..." gnus-summary-copy-article t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1758 ["Crosspost article..." gnus-summary-crosspost-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1759 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1760 'request-replace-article gnus-newsgroup-name)] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1761 ["Import file..." gnus-summary-import-article t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1762 ["Check if posted" gnus-summary-article-posted-p t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1763 ["Edit article" gnus-summary-edit-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1764 (not (gnus-group-read-only-p))] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1765 ["Delete article" gnus-summary-delete-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1766 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1767 'request-expire-articles gnus-newsgroup-name)] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1768 ["Query respool" gnus-summary-respool-query t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1769 ["Trace respool" gnus-summary-respool-trace t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1770 ["Delete expirable articles" gnus-summary-expire-articles-now |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1771 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1772 'request-expire-articles gnus-newsgroup-name)]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1773 ("Extract" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1774 ["Uudecode" gnus-uu-decode-uu t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1775 ["Uudecode and save" gnus-uu-decode-uu-and-save t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1776 ["Unshar" gnus-uu-decode-unshar t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1777 ["Unshar and save" gnus-uu-decode-unshar-and-save t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1778 ["Save" gnus-uu-decode-save t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1779 ["Binhex" gnus-uu-decode-binhex t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1780 ["Postscript" gnus-uu-decode-postscript t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1781 ("Cache" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1782 ["Enter article" gnus-cache-enter-article t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1783 ["Remove article" gnus-cache-remove-article t]) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1784 ["Translate" gnus-article-babel t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1785 ["Select article buffer" gnus-summary-select-article-buffer t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1786 ["Enter digest buffer" gnus-summary-enter-digest-group t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1787 ["Isearch article..." gnus-summary-isearch-article t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1788 ["Beginning of the article" gnus-summary-beginning-of-article t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1789 ["End of the article" gnus-summary-end-of-article t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1790 ["Fetch parent of article" gnus-summary-refer-parent-article t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1791 ["Fetch referenced articles" gnus-summary-refer-references t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1792 ["Fetch current thread" gnus-summary-refer-thread t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1793 ["Fetch article with id..." gnus-summary-refer-article t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1794 ["Redisplay" gnus-summary-show-article t]))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1795 (easy-menu-define |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1796 gnus-summary-article-menu gnus-summary-mode-map "" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1797 (cons "Article" innards)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1798 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1799 (easy-menu-define |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1800 gnus-article-commands-menu gnus-article-mode-map "" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1801 (cons "Commands" innards))) |
17493 | 1802 |
1803 (easy-menu-define | |
1804 gnus-summary-thread-menu gnus-summary-mode-map "" | |
1805 '("Threads" | |
1806 ["Toggle threading" gnus-summary-toggle-threads t] | |
1807 ["Hide threads" gnus-summary-hide-all-threads t] | |
1808 ["Show threads" gnus-summary-show-all-threads t] | |
1809 ["Hide thread" gnus-summary-hide-thread t] | |
1810 ["Show thread" gnus-summary-show-thread t] | |
1811 ["Go to next thread" gnus-summary-next-thread t] | |
1812 ["Go to previous thread" gnus-summary-prev-thread t] | |
1813 ["Go down thread" gnus-summary-down-thread t] | |
1814 ["Go up thread" gnus-summary-up-thread t] | |
1815 ["Top of thread" gnus-summary-top-thread t] | |
1816 ["Mark thread as read" gnus-summary-kill-thread t] | |
1817 ["Lower thread score" gnus-summary-lower-thread t] | |
1818 ["Raise thread score" gnus-summary-raise-thread t] | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1819 ["Rethread current" gnus-summary-rethread-current t])) |
17493 | 1820 |
1821 (easy-menu-define | |
1822 gnus-summary-post-menu gnus-summary-mode-map "" | |
1823 '("Post" | |
1824 ["Post an article" gnus-summary-post-news t] | |
1825 ["Followup" gnus-summary-followup t] | |
1826 ["Followup and yank" gnus-summary-followup-with-original t] | |
1827 ["Supersede article" gnus-summary-supersede-article t] | |
1828 ["Cancel article" gnus-summary-cancel-article t] | |
1829 ["Reply" gnus-summary-reply t] | |
1830 ["Reply and yank" gnus-summary-reply-with-original t] | |
1831 ["Wide reply" gnus-summary-wide-reply t] | |
1832 ["Wide reply and yank" gnus-summary-wide-reply-with-original t] | |
1833 ["Mail forward" gnus-summary-mail-forward t] | |
1834 ["Post forward" gnus-summary-post-forward t] | |
1835 ["Digest and mail" gnus-uu-digest-mail-forward t] | |
1836 ["Digest and post" gnus-uu-digest-post-forward t] | |
1837 ["Resend message" gnus-summary-resend-message t] | |
1838 ["Send bounced mail" gnus-summary-resend-bounced-mail t] | |
1839 ["Send a mail" gnus-summary-mail-other-window t] | |
1840 ["Uuencode and post" gnus-uu-post-news t] | |
1841 ["Followup via news" gnus-summary-followup-to-mail t] | |
1842 ["Followup via news and yank" | |
1843 gnus-summary-followup-to-mail-with-original t] | |
1844 ;;("Draft" | |
1845 ;;["Send" gnus-summary-send-draft t] | |
1846 ;;["Send bounced" gnus-resend-bounced-mail t]) | |
1847 )) | |
1848 | |
1849 (easy-menu-define | |
1850 gnus-summary-misc-menu gnus-summary-mode-map "" | |
1851 '("Misc" | |
1852 ("Mark Read" | |
1853 ["Mark as read" gnus-summary-mark-as-read-forward t] | |
1854 ["Mark same subject and select" | |
1855 gnus-summary-kill-same-subject-and-select t] | |
1856 ["Mark same subject" gnus-summary-kill-same-subject t] | |
1857 ["Catchup" gnus-summary-catchup t] | |
1858 ["Catchup all" gnus-summary-catchup-all t] | |
1859 ["Catchup to here" gnus-summary-catchup-to-here t] | |
1860 ["Catchup region" gnus-summary-mark-region-as-read t] | |
1861 ["Mark excluded" gnus-summary-limit-mark-excluded-as-read t]) | |
1862 ("Mark Various" | |
1863 ["Tick" gnus-summary-tick-article-forward t] | |
1864 ["Mark as dormant" gnus-summary-mark-as-dormant t] | |
1865 ["Remove marks" gnus-summary-clear-mark-forward t] | |
1866 ["Set expirable mark" gnus-summary-mark-as-expirable t] | |
1867 ["Set bookmark" gnus-summary-set-bookmark t] | |
1868 ["Remove bookmark" gnus-summary-remove-bookmark t]) | |
1869 ("Mark Limit" | |
1870 ["Marks..." gnus-summary-limit-to-marks t] | |
1871 ["Subject..." gnus-summary-limit-to-subject t] | |
1872 ["Author..." gnus-summary-limit-to-author t] | |
1873 ["Age..." gnus-summary-limit-to-age t] | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1874 ["Extra..." gnus-summary-limit-to-extra t] |
17493 | 1875 ["Score" gnus-summary-limit-to-score t] |
1876 ["Unread" gnus-summary-limit-to-unread t] | |
1877 ["Non-dormant" gnus-summary-limit-exclude-dormant t] | |
1878 ["Articles" gnus-summary-limit-to-articles t] | |
1879 ["Pop limit" gnus-summary-pop-limit t] | |
1880 ["Show dormant" gnus-summary-limit-include-dormant t] | |
1881 ["Hide childless dormant" | |
1882 gnus-summary-limit-exclude-childless-dormant t] | |
1883 ;;["Hide thread" gnus-summary-limit-exclude-thread t] | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1884 ["Hide marked" gnus-summary-limit-exclude-marks t] |
17493 | 1885 ["Show expunged" gnus-summary-show-all-expunged t]) |
1886 ("Process Mark" | |
1887 ["Set mark" gnus-summary-mark-as-processable t] | |
1888 ["Remove mark" gnus-summary-unmark-as-processable t] | |
1889 ["Remove all marks" gnus-summary-unmark-all-processable t] | |
1890 ["Mark above" gnus-uu-mark-over t] | |
1891 ["Mark series" gnus-uu-mark-series t] | |
1892 ["Mark region" gnus-uu-mark-region t] | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1893 ["Unmark region" gnus-uu-unmark-region t] |
17493 | 1894 ["Mark by regexp..." gnus-uu-mark-by-regexp t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1895 ["Unmark by regexp..." gnus-uu-unmark-by-regexp t] |
17493 | 1896 ["Mark all" gnus-uu-mark-all t] |
1897 ["Mark buffer" gnus-uu-mark-buffer t] | |
1898 ["Mark sparse" gnus-uu-mark-sparse t] | |
1899 ["Mark thread" gnus-uu-mark-thread t] | |
1900 ["Unmark thread" gnus-uu-unmark-thread t] | |
1901 ("Process Mark Sets" | |
1902 ["Kill" gnus-summary-kill-process-mark t] | |
1903 ["Yank" gnus-summary-yank-process-mark | |
1904 gnus-newsgroup-process-stack] | |
1905 ["Save" gnus-summary-save-process-mark t])) | |
1906 ("Scroll article" | |
1907 ["Page forward" gnus-summary-next-page t] | |
1908 ["Page backward" gnus-summary-prev-page t] | |
1909 ["Line forward" gnus-summary-scroll-up t]) | |
1910 ("Move" | |
1911 ["Next unread article" gnus-summary-next-unread-article t] | |
1912 ["Previous unread article" gnus-summary-prev-unread-article t] | |
1913 ["Next article" gnus-summary-next-article t] | |
1914 ["Previous article" gnus-summary-prev-article t] | |
1915 ["Next unread subject" gnus-summary-next-unread-subject t] | |
1916 ["Previous unread subject" gnus-summary-prev-unread-subject t] | |
1917 ["Next article same subject" gnus-summary-next-same-subject t] | |
1918 ["Previous article same subject" gnus-summary-prev-same-subject t] | |
1919 ["First unread article" gnus-summary-first-unread-article t] | |
1920 ["Best unread article" gnus-summary-best-unread-article t] | |
1921 ["Go to subject number..." gnus-summary-goto-subject t] | |
1922 ["Go to article number..." gnus-summary-goto-article t] | |
1923 ["Go to the last article" gnus-summary-goto-last-article t] | |
1924 ["Pop article off history" gnus-summary-pop-article t]) | |
1925 ("Sort" | |
1926 ["Sort by number" gnus-summary-sort-by-number t] | |
1927 ["Sort by author" gnus-summary-sort-by-author t] | |
1928 ["Sort by subject" gnus-summary-sort-by-subject t] | |
1929 ["Sort by date" gnus-summary-sort-by-date t] | |
1930 ["Sort by score" gnus-summary-sort-by-score t] | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1931 ["Sort by lines" gnus-summary-sort-by-lines t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1932 ["Sort by characters" gnus-summary-sort-by-chars t]) |
17493 | 1933 ("Help" |
1934 ["Fetch group FAQ" gnus-summary-fetch-faq t] | |
1935 ["Describe group" gnus-summary-describe-group t] | |
1936 ["Read manual" gnus-info-find-node t]) | |
1937 ("Modes" | |
1938 ["Pick and read" gnus-pick-mode t] | |
1939 ["Binary" gnus-binary-mode t]) | |
1940 ("Regeneration" | |
1941 ["Regenerate" gnus-summary-prepare t] | |
1942 ["Insert cached articles" gnus-summary-insert-cached-articles t] | |
1943 ["Toggle threading" gnus-summary-toggle-threads t]) | |
1944 ["Filter articles..." gnus-summary-execute-command t] | |
1945 ["Run command on subjects..." gnus-summary-universal-argument t] | |
1946 ["Search articles forward..." gnus-summary-search-article-forward t] | |
1947 ["Search articles backward..." gnus-summary-search-article-backward t] | |
1948 ["Toggle line truncation" gnus-summary-toggle-truncation t] | |
1949 ["Expand window" gnus-summary-expand-window t] | |
1950 ["Expire expirable articles" gnus-summary-expire-articles | |
1951 (gnus-check-backend-function | |
1952 'request-expire-articles gnus-newsgroup-name)] | |
1953 ["Edit local kill file" gnus-summary-edit-local-kill t] | |
1954 ["Edit main kill file" gnus-summary-edit-global-kill t] | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1955 ["Edit group parameters" gnus-summary-edit-parameters t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1956 ["Customize group parameters" gnus-summary-customize-parameters t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1957 ["Send a bug report" gnus-bug t] |
17493 | 1958 ("Exit" |
1959 ["Catchup and exit" gnus-summary-catchup-and-exit t] | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1960 ["Catchup all and exit" gnus-summary-catchup-all-and-exit t] |
17493 | 1961 ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t] |
1962 ["Exit group" gnus-summary-exit t] | |
1963 ["Exit group without updating" gnus-summary-exit-no-update t] | |
1964 ["Exit and goto next group" gnus-summary-next-group t] | |
1965 ["Exit and goto prev group" gnus-summary-prev-group t] | |
1966 ["Reselect group" gnus-summary-reselect-current-group t] | |
1967 ["Rescan group" gnus-summary-rescan-group t] | |
1968 ["Update dribble" gnus-summary-save-newsrc t]))) | |
1969 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1970 (gnus-run-hooks 'gnus-summary-menu-hook))) |
17493 | 1971 |
1972 (defun gnus-score-set-default (var value) | |
1973 "A version of set that updates the GNU Emacs menu-bar." | |
1974 (set var value) | |
1975 ;; It is the message that forces the active status to be updated. | |
1976 (message "")) | |
1977 | |
1978 (defun gnus-make-score-map (type) | |
1979 "Make a summary score map of type TYPE." | |
1980 (if t | |
1981 nil | |
1982 (let ((headers '(("author" "from" string) | |
1983 ("subject" "subject" string) | |
1984 ("article body" "body" string) | |
1985 ("article head" "head" string) | |
1986 ("xref" "xref" string) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1987 ("extra header" "extra" string) |
17493 | 1988 ("lines" "lines" number) |
1989 ("followups to author" "followup" string))) | |
1990 (types '((number ("less than" <) | |
1991 ("greater than" >) | |
1992 ("equal" =)) | |
1993 (string ("substring" s) | |
1994 ("exact string" e) | |
1995 ("fuzzy string" f) | |
1996 ("regexp" r)))) | |
1997 (perms '(("temporary" (current-time-string)) | |
1998 ("permanent" nil) | |
1999 ("immediate" now))) | |
2000 header) | |
2001 (list | |
2002 (apply | |
2003 'nconc | |
2004 (list | |
2005 (if (eq type 'lower) | |
2006 "Lower score" | |
2007 "Increase score")) | |
2008 (let (outh) | |
2009 (while headers | |
2010 (setq header (car headers)) | |
2011 (setq outh | |
2012 (cons | |
2013 (apply | |
2014 'nconc | |
2015 (list (car header)) | |
2016 (let ((ts (cdr (assoc (nth 2 header) types))) | |
2017 outt) | |
2018 (while ts | |
2019 (setq outt | |
2020 (cons | |
2021 (apply | |
2022 'nconc | |
2023 (list (caar ts)) | |
2024 (let ((ps perms) | |
2025 outp) | |
2026 (while ps | |
2027 (setq outp | |
2028 (cons | |
2029 (vector | |
2030 (caar ps) | |
2031 (list | |
2032 'gnus-summary-score-entry | |
2033 (nth 1 header) | |
2034 (if (or (string= (nth 1 header) | |
2035 "head") | |
2036 (string= (nth 1 header) | |
2037 "body")) | |
2038 "" | |
2039 (list 'gnus-summary-header | |
2040 (nth 1 header))) | |
2041 (list 'quote (nth 1 (car ts))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2042 (list 'gnus-score-delta-default |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2043 nil) |
17493 | 2044 (nth 1 (car ps)) |
2045 t) | |
2046 t) | |
2047 outp)) | |
2048 (setq ps (cdr ps))) | |
2049 (list (nreverse outp)))) | |
2050 outt)) | |
2051 (setq ts (cdr ts))) | |
2052 (list (nreverse outt)))) | |
2053 outh)) | |
2054 (setq headers (cdr headers))) | |
2055 (list (nreverse outh)))))))) | |
2056 | |
2057 | |
2058 | |
2059 (defun gnus-summary-mode (&optional group) | |
2060 "Major mode for reading articles. | |
2061 | |
2062 All normal editing commands are switched off. | |
2063 \\<gnus-summary-mode-map> | |
2064 Each line in this buffer represents one article. To read an | |
2065 article, you can, for instance, type `\\[gnus-summary-next-page]'. To move forwards | |
2066 and backwards while displaying articles, type `\\[gnus-summary-next-unread-article]' and `\\[gnus-summary-prev-unread-article]', | |
2067 respectively. | |
2068 | |
2069 You can also post articles and send mail from this buffer. To | |
2070 follow up an article, type `\\[gnus-summary-followup]'. To mail a reply to the author | |
2071 of an article, type `\\[gnus-summary-reply]'. | |
2072 | |
2073 There are approx. one gazillion commands you can execute in this | |
2074 buffer; read the info pages for more information (`\\[gnus-info-find-node]'). | |
2075 | |
2076 The following commands are available: | |
2077 | |
2078 \\{gnus-summary-mode-map}" | |
2079 (interactive) | |
2080 (when (gnus-visual-p 'summary-menu 'menu) | |
2081 (gnus-summary-make-menu-bar)) | |
2082 (kill-all-local-variables) | |
2083 (gnus-summary-make-local-variables) | |
2084 (gnus-make-thread-indent-array) | |
2085 (gnus-simplify-mode-line) | |
2086 (setq major-mode 'gnus-summary-mode) | |
2087 (setq mode-name "Summary") | |
2088 (make-local-variable 'minor-mode-alist) | |
2089 (use-local-map gnus-summary-mode-map) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2090 (buffer-disable-undo) |
17493 | 2091 (setq buffer-read-only t) ;Disable modification |
2092 (setq truncate-lines t) | |
2093 (setq selective-display t) | |
2094 (setq selective-display-ellipses t) ;Display `...' | |
2095 (gnus-summary-set-display-table) | |
2096 (gnus-set-default-directory) | |
2097 (setq gnus-newsgroup-name group) | |
2098 (make-local-variable 'gnus-summary-line-format) | |
2099 (make-local-variable 'gnus-summary-line-format-spec) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2100 (make-local-variable 'gnus-summary-dummy-line-format) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2101 (make-local-variable 'gnus-summary-dummy-line-format-spec) |
17493 | 2102 (make-local-variable 'gnus-summary-mark-positions) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2103 (make-local-hook 'pre-command-hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2104 (add-hook 'pre-command-hook 'gnus-set-global-variables nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2105 (gnus-run-hooks 'gnus-summary-mode-hook) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2106 (mm-enable-multibyte) |
17493 | 2107 (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy) |
2108 (gnus-update-summary-mark-positions)) | |
2109 | |
2110 (defun gnus-summary-make-local-variables () | |
2111 "Make all the local summary buffer variables." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2112 (let (global) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2113 (dolist (local gnus-summary-local-variables) |
17493 | 2114 (if (consp local) |
2115 (progn | |
2116 (if (eq (cdr local) 'global) | |
2117 ;; Copy the global value of the variable. | |
2118 (setq global (symbol-value (car local))) | |
2119 ;; Use the value from the list. | |
2120 (setq global (eval (cdr local)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2121 (set (make-local-variable (car local)) global)) |
17493 | 2122 ;; Simple nil-valued local variable. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2123 (set (make-local-variable local) nil))))) |
17493 | 2124 |
2125 (defun gnus-summary-clear-local-variables () | |
2126 (let ((locals gnus-summary-local-variables)) | |
2127 (while locals | |
2128 (if (consp (car locals)) | |
2129 (and (vectorp (caar locals)) | |
2130 (set (caar locals) nil)) | |
2131 (and (vectorp (car locals)) | |
2132 (set (car locals) nil))) | |
2133 (setq locals (cdr locals))))) | |
2134 | |
2135 ;; Summary data functions. | |
2136 | |
2137 (defmacro gnus-data-number (data) | |
2138 `(car ,data)) | |
2139 | |
2140 (defmacro gnus-data-set-number (data number) | |
2141 `(setcar ,data ,number)) | |
2142 | |
2143 (defmacro gnus-data-mark (data) | |
2144 `(nth 1 ,data)) | |
2145 | |
2146 (defmacro gnus-data-set-mark (data mark) | |
2147 `(setcar (nthcdr 1 ,data) ,mark)) | |
2148 | |
2149 (defmacro gnus-data-pos (data) | |
2150 `(nth 2 ,data)) | |
2151 | |
2152 (defmacro gnus-data-set-pos (data pos) | |
2153 `(setcar (nthcdr 2 ,data) ,pos)) | |
2154 | |
2155 (defmacro gnus-data-header (data) | |
2156 `(nth 3 ,data)) | |
2157 | |
2158 (defmacro gnus-data-set-header (data header) | |
2159 `(setf (nth 3 ,data) ,header)) | |
2160 | |
2161 (defmacro gnus-data-level (data) | |
2162 `(nth 4 ,data)) | |
2163 | |
2164 (defmacro gnus-data-unread-p (data) | |
2165 `(= (nth 1 ,data) gnus-unread-mark)) | |
2166 | |
2167 (defmacro gnus-data-read-p (data) | |
2168 `(/= (nth 1 ,data) gnus-unread-mark)) | |
2169 | |
2170 (defmacro gnus-data-pseudo-p (data) | |
2171 `(consp (nth 3 ,data))) | |
2172 | |
2173 (defmacro gnus-data-find (number) | |
2174 `(assq ,number gnus-newsgroup-data)) | |
2175 | |
2176 (defmacro gnus-data-find-list (number &optional data) | |
2177 `(let ((bdata ,(or data 'gnus-newsgroup-data))) | |
2178 (memq (assq ,number bdata) | |
2179 bdata))) | |
2180 | |
2181 (defmacro gnus-data-make (number mark pos header level) | |
2182 `(list ,number ,mark ,pos ,header ,level)) | |
2183 | |
2184 (defun gnus-data-enter (after-article number mark pos header level offset) | |
2185 (let ((data (gnus-data-find-list after-article))) | |
2186 (unless data | |
2187 (error "No such article: %d" after-article)) | |
2188 (setcdr data (cons (gnus-data-make number mark pos header level) | |
2189 (cdr data))) | |
2190 (setq gnus-newsgroup-data-reverse nil) | |
2191 (gnus-data-update-list (cddr data) offset))) | |
2192 | |
2193 (defun gnus-data-enter-list (after-article list &optional offset) | |
2194 (when list | |
2195 (let ((data (and after-article (gnus-data-find-list after-article))) | |
2196 (ilist list)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2197 (if (not (or data |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2198 after-article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2199 (let ((odata gnus-newsgroup-data)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2200 (setq gnus-newsgroup-data (nconc list gnus-newsgroup-data)) |
17493 | 2201 (when offset |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2202 (gnus-data-update-list odata offset))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2203 ;; Find the last element in the list to be spliced into the main |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2204 ;; list. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2205 (while (cdr list) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2206 (setq list (cdr list))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2207 (if (not data) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2208 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2209 (setcdr list gnus-newsgroup-data) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2210 (setq gnus-newsgroup-data ilist) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2211 (when offset |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2212 (gnus-data-update-list (cdr list) offset))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2213 (setcdr list (cdr data)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2214 (setcdr data ilist) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2215 (when offset |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2216 (gnus-data-update-list (cdr list) offset)))) |
17493 | 2217 (setq gnus-newsgroup-data-reverse nil)))) |
2218 | |
2219 (defun gnus-data-remove (article &optional offset) | |
2220 (let ((data gnus-newsgroup-data)) | |
2221 (if (= (gnus-data-number (car data)) article) | |
2222 (progn | |
2223 (setq gnus-newsgroup-data (cdr gnus-newsgroup-data) | |
2224 gnus-newsgroup-data-reverse nil) | |
2225 (when offset | |
2226 (gnus-data-update-list gnus-newsgroup-data offset))) | |
2227 (while (cdr data) | |
2228 (when (= (gnus-data-number (cadr data)) article) | |
2229 (setcdr data (cddr data)) | |
2230 (when offset | |
2231 (gnus-data-update-list (cdr data) offset)) | |
2232 (setq data nil | |
2233 gnus-newsgroup-data-reverse nil)) | |
2234 (setq data (cdr data)))))) | |
2235 | |
2236 (defmacro gnus-data-list (backward) | |
2237 `(if ,backward | |
2238 (or gnus-newsgroup-data-reverse | |
2239 (setq gnus-newsgroup-data-reverse | |
2240 (reverse gnus-newsgroup-data))) | |
2241 gnus-newsgroup-data)) | |
2242 | |
2243 (defun gnus-data-update-list (data offset) | |
2244 "Add OFFSET to the POS of all data entries in DATA." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2245 (setq gnus-newsgroup-data-reverse nil) |
17493 | 2246 (while data |
2247 (setcar (nthcdr 2 (car data)) (+ offset (nth 2 (car data)))) | |
2248 (setq data (cdr data)))) | |
2249 | |
2250 (defun gnus-summary-article-pseudo-p (article) | |
2251 "Say whether this article is a pseudo article or not." | |
2252 (not (vectorp (gnus-data-header (gnus-data-find article))))) | |
2253 | |
2254 (defmacro gnus-summary-article-sparse-p (article) | |
2255 "Say whether this article is a sparse article or not." | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
2256 `(memq ,article gnus-newsgroup-sparse)) |
17493 | 2257 |
2258 (defmacro gnus-summary-article-ancient-p (article) | |
2259 "Say whether this article is a sparse article or not." | |
2260 `(memq ,article gnus-newsgroup-ancient)) | |
2261 | |
2262 (defun gnus-article-parent-p (number) | |
2263 "Say whether this article is a parent or not." | |
2264 (let ((data (gnus-data-find-list number))) | |
2265 (and (cdr data) ; There has to be an article after... | |
2266 (< (gnus-data-level (car data)) ; And it has to have a higher level. | |
2267 (gnus-data-level (nth 1 data)))))) | |
2268 | |
2269 (defun gnus-article-children (number) | |
2270 "Return a list of all children to NUMBER." | |
2271 (let* ((data (gnus-data-find-list number)) | |
2272 (level (gnus-data-level (car data))) | |
2273 children) | |
2274 (setq data (cdr data)) | |
2275 (while (and data | |
2276 (= (gnus-data-level (car data)) (1+ level))) | |
2277 (push (gnus-data-number (car data)) children) | |
2278 (setq data (cdr data))) | |
2279 children)) | |
2280 | |
2281 (defmacro gnus-summary-skip-intangible () | |
2282 "If the current article is intangible, then jump to a different article." | |
2283 '(let ((to (get-text-property (point) 'gnus-intangible))) | |
2284 (and to (gnus-summary-goto-subject to)))) | |
2285 | |
2286 (defmacro gnus-summary-article-intangible-p () | |
2287 "Say whether this article is intangible or not." | |
2288 '(get-text-property (point) 'gnus-intangible)) | |
2289 | |
2290 (defun gnus-article-read-p (article) | |
2291 "Say whether ARTICLE is read or not." | |
2292 (not (or (memq article gnus-newsgroup-marked) | |
2293 (memq article gnus-newsgroup-unreads) | |
2294 (memq article gnus-newsgroup-unselected) | |
2295 (memq article gnus-newsgroup-dormant)))) | |
2296 | |
2297 ;; Some summary mode macros. | |
2298 | |
2299 (defmacro gnus-summary-article-number () | |
2300 "The article number of the article on the current line. | |
2301 If there isn's an article number here, then we return the current | |
2302 article number." | |
2303 '(progn | |
2304 (gnus-summary-skip-intangible) | |
2305 (or (get-text-property (point) 'gnus-number) | |
2306 (gnus-summary-last-subject)))) | |
2307 | |
2308 (defmacro gnus-summary-article-header (&optional number) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2309 "Return the header of article NUMBER." |
17493 | 2310 `(gnus-data-header (gnus-data-find |
2311 ,(or number '(gnus-summary-article-number))))) | |
2312 | |
2313 (defmacro gnus-summary-thread-level (&optional number) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2314 "Return the level of thread that starts with article NUMBER." |
17493 | 2315 `(if (and (eq gnus-summary-make-false-root 'dummy) |
2316 (get-text-property (point) 'gnus-intangible)) | |
2317 0 | |
2318 (gnus-data-level (gnus-data-find | |
2319 ,(or number '(gnus-summary-article-number)))))) | |
2320 | |
2321 (defmacro gnus-summary-article-mark (&optional number) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2322 "Return the mark of article NUMBER." |
17493 | 2323 `(gnus-data-mark (gnus-data-find |
2324 ,(or number '(gnus-summary-article-number))))) | |
2325 | |
2326 (defmacro gnus-summary-article-pos (&optional number) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2327 "Return the position of the line of article NUMBER." |
17493 | 2328 `(gnus-data-pos (gnus-data-find |
2329 ,(or number '(gnus-summary-article-number))))) | |
2330 | |
2331 (defalias 'gnus-summary-subject-string 'gnus-summary-article-subject) | |
2332 (defmacro gnus-summary-article-subject (&optional number) | |
2333 "Return current subject string or nil if nothing." | |
2334 `(let ((headers | |
2335 ,(if number | |
2336 `(gnus-data-header (assq ,number gnus-newsgroup-data)) | |
2337 '(gnus-data-header (assq (gnus-summary-article-number) | |
2338 gnus-newsgroup-data))))) | |
2339 (and headers | |
2340 (vectorp headers) | |
2341 (mail-header-subject headers)))) | |
2342 | |
2343 (defmacro gnus-summary-article-score (&optional number) | |
2344 "Return current article score." | |
2345 `(or (cdr (assq ,(or number '(gnus-summary-article-number)) | |
2346 gnus-newsgroup-scored)) | |
2347 gnus-summary-default-score 0)) | |
2348 | |
2349 (defun gnus-summary-article-children (&optional number) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2350 "Return a list of article numbers that are children of article NUMBER." |
17493 | 2351 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number)))) |
2352 (level (gnus-data-level (car data))) | |
2353 l children) | |
2354 (while (and (setq data (cdr data)) | |
2355 (> (setq l (gnus-data-level (car data))) level)) | |
2356 (and (= (1+ level) l) | |
2357 (push (gnus-data-number (car data)) | |
2358 children))) | |
2359 (nreverse children))) | |
2360 | |
2361 (defun gnus-summary-article-parent (&optional number) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2362 "Return the article number of the parent of article NUMBER." |
17493 | 2363 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number)) |
2364 (gnus-data-list t))) | |
2365 (level (gnus-data-level (car data)))) | |
2366 (if (zerop level) | |
2367 () ; This is a root. | |
2368 ;; We search until we find an article with a level less than | |
2369 ;; this one. That function has to be the parent. | |
2370 (while (and (setq data (cdr data)) | |
2371 (not (< (gnus-data-level (car data)) level)))) | |
2372 (and data (gnus-data-number (car data)))))) | |
2373 | |
2374 (defun gnus-unread-mark-p (mark) | |
2375 "Say whether MARK is the unread mark." | |
2376 (= mark gnus-unread-mark)) | |
2377 | |
2378 (defun gnus-read-mark-p (mark) | |
2379 "Say whether MARK is one of the marks that mark as read. | |
2380 This is all marks except unread, ticked, dormant, and expirable." | |
2381 (not (or (= mark gnus-unread-mark) | |
2382 (= mark gnus-ticked-mark) | |
2383 (= mark gnus-dormant-mark) | |
2384 (= mark gnus-expirable-mark)))) | |
2385 | |
2386 (defmacro gnus-article-mark (number) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2387 "Return the MARK of article NUMBER. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2388 This macro should only be used when computing the mark the \"first\" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2389 time; i.e., when generating the summary lines. After that, |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2390 `gnus-summary-article-mark' should be used to examine the |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2391 marks of articles." |
17493 | 2392 `(cond |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2393 ((memq ,number gnus-newsgroup-unsendable) gnus-unsendable-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2394 ((memq ,number gnus-newsgroup-undownloaded) gnus-undownloaded-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2395 ((memq ,number gnus-newsgroup-downloadable) gnus-downloadable-mark) |
17493 | 2396 ((memq ,number gnus-newsgroup-unreads) gnus-unread-mark) |
2397 ((memq ,number gnus-newsgroup-marked) gnus-ticked-mark) | |
2398 ((memq ,number gnus-newsgroup-dormant) gnus-dormant-mark) | |
2399 ((memq ,number gnus-newsgroup-expirable) gnus-expirable-mark) | |
2400 (t (or (cdr (assq ,number gnus-newsgroup-reads)) | |
2401 gnus-ancient-mark)))) | |
2402 | |
2403 ;; Saving hidden threads. | |
2404 | |
2405 (put 'gnus-save-hidden-threads 'lisp-indent-function 0) | |
2406 (put 'gnus-save-hidden-threads 'edebug-form-spec '(body)) | |
2407 | |
2408 (defmacro gnus-save-hidden-threads (&rest forms) | |
2409 "Save hidden threads, eval FORMS, and restore the hidden threads." | |
2410 (let ((config (make-symbol "config"))) | |
2411 `(let ((,config (gnus-hidden-threads-configuration))) | |
2412 (unwind-protect | |
2413 (save-excursion | |
2414 ,@forms) | |
2415 (gnus-restore-hidden-threads-configuration ,config))))) | |
2416 | |
24552
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2417 (defun gnus-data-compute-positions () |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2418 "Compute the positions of all articles." |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2419 (setq gnus-newsgroup-data-reverse nil) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2420 (let ((data gnus-newsgroup-data)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2421 (save-excursion |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2422 (gnus-save-hidden-threads |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2423 (gnus-summary-show-all-threads) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2424 (goto-char (point-min)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2425 (while data |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2426 (while (get-text-property (point) 'gnus-intangible) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2427 (forward-line 1)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2428 (gnus-data-set-pos (car data) (+ (point) 3)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2429 (setq data (cdr data)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2430 (forward-line 1)))))) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2431 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2432 (defun gnus-hidden-threads-configuration () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2433 "Return the current hidden threads configuration." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2434 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2435 (let (config) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2436 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2437 (while (search-forward "\r" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2438 (push (1- (point)) config)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2439 config))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2440 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2441 (defun gnus-restore-hidden-threads-configuration (config) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2442 "Restore hidden threads configuration from CONFIG." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2443 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2444 (let (point buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2445 (while (setq point (pop config)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2446 (when (and (< point (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2447 (goto-char point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2448 (eq (char-after) ?\n)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2449 (subst-char-in-region point (1+ point) ?\n ?\r)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2450 |
17493 | 2451 ;; Various summary mode internalish functions. |
2452 | |
2453 (defun gnus-mouse-pick-article (e) | |
2454 (interactive "e") | |
2455 (mouse-set-point e) | |
2456 (gnus-summary-next-page nil t)) | |
2457 | |
2458 (defun gnus-summary-set-display-table () | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2459 "Change the display table. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2460 Odd characters have a tendency to mess |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2461 up nicely formatted displays - we make all possible glyphs |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2462 display only a single character." |
17493 | 2463 |
2464 ;; We start from the standard display table, if any. | |
2465 (let ((table (or (copy-sequence standard-display-table) | |
2466 (make-display-table))) | |
2467 (i 32)) | |
2468 ;; Nix out all the control chars... | |
2469 (while (>= (setq i (1- i)) 0) | |
2470 (aset table i [??])) | |
2471 ;; ... but not newline and cr, of course. (cr is necessary for the | |
2472 ;; selective display). | |
2473 (aset table ?\n nil) | |
2474 (aset table ?\r nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2475 ;; We keep TAB as well. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2476 (aset table ?\t nil) |
17493 | 2477 ;; We nix out any glyphs over 126 that are not set already. |
2478 (let ((i 256)) | |
2479 (while (>= (setq i (1- i)) 127) | |
2480 ;; Only modify if the entry is nil. | |
2481 (unless (aref table i) | |
2482 (aset table i [??])))) | |
2483 (setq buffer-display-table table))) | |
2484 | |
2485 (defun gnus-summary-setup-buffer (group) | |
2486 "Initialize summary buffer." | |
2487 (let ((buffer (concat "*Summary " group "*"))) | |
2488 (if (get-buffer buffer) | |
2489 (progn | |
2490 (set-buffer buffer) | |
2491 (setq gnus-summary-buffer (current-buffer)) | |
2492 (not gnus-newsgroup-prepared)) | |
2493 ;; Fix by Sudish Joseph <joseph@cis.ohio-state.edu> | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2494 (setq gnus-summary-buffer (set-buffer (gnus-get-buffer-create buffer))) |
17493 | 2495 (gnus-summary-mode group) |
2496 (when gnus-carpal | |
2497 (gnus-carpal-setup-buffer 'summary)) | |
2498 (unless gnus-single-article-buffer | |
2499 (make-local-variable 'gnus-article-buffer) | |
2500 (make-local-variable 'gnus-article-current) | |
2501 (make-local-variable 'gnus-original-article-buffer)) | |
2502 (setq gnus-newsgroup-name group) | |
2503 t))) | |
2504 | |
2505 (defun gnus-set-global-variables () | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2506 "Set the global equivalents of the buffer-local variables. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2507 They are set to the latest values they had. These reflect the summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2508 buffer that was in action when the last article was fetched." |
17493 | 2509 (when (eq major-mode 'gnus-summary-mode) |
2510 (setq gnus-summary-buffer (current-buffer)) | |
2511 (let ((name gnus-newsgroup-name) | |
2512 (marked gnus-newsgroup-marked) | |
2513 (unread gnus-newsgroup-unreads) | |
2514 (headers gnus-current-headers) | |
2515 (data gnus-newsgroup-data) | |
2516 (summary gnus-summary-buffer) | |
2517 (article-buffer gnus-article-buffer) | |
2518 (original gnus-original-article-buffer) | |
2519 (gac gnus-article-current) | |
2520 (reffed gnus-reffed-article-number) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2521 (score-file gnus-current-score-file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2522 (default-charset gnus-newsgroup-charset)) |
17493 | 2523 (save-excursion |
2524 (set-buffer gnus-group-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2525 (setq gnus-newsgroup-name name |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2526 gnus-newsgroup-marked marked |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2527 gnus-newsgroup-unreads unread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2528 gnus-current-headers headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2529 gnus-newsgroup-data data |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2530 gnus-article-current gac |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2531 gnus-summary-buffer summary |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2532 gnus-article-buffer article-buffer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2533 gnus-original-article-buffer original |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2534 gnus-reffed-article-number reffed |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2535 gnus-current-score-file score-file |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2536 gnus-newsgroup-charset default-charset) |
17493 | 2537 ;; The article buffer also has local variables. |
2538 (when (gnus-buffer-live-p gnus-article-buffer) | |
2539 (set-buffer gnus-article-buffer) | |
2540 (setq gnus-summary-buffer summary)))))) | |
2541 | |
2542 (defun gnus-summary-article-unread-p (article) | |
2543 "Say whether ARTICLE is unread or not." | |
2544 (memq article gnus-newsgroup-unreads)) | |
2545 | |
2546 (defun gnus-summary-first-article-p (&optional article) | |
2547 "Return whether ARTICLE is the first article in the buffer." | |
2548 (if (not (setq article (or article (gnus-summary-article-number)))) | |
2549 nil | |
2550 (eq article (caar gnus-newsgroup-data)))) | |
2551 | |
2552 (defun gnus-summary-last-article-p (&optional article) | |
2553 "Return whether ARTICLE is the last article in the buffer." | |
2554 (if (not (setq article (or article (gnus-summary-article-number)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2555 ;; All non-existent numbers are the last article. :-) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2556 t |
17493 | 2557 (not (cdr (gnus-data-find-list article))))) |
2558 | |
2559 (defun gnus-make-thread-indent-array () | |
2560 (let ((n 200)) | |
2561 (unless (and gnus-thread-indent-array | |
2562 (= gnus-thread-indent-level gnus-thread-indent-array-level)) | |
2563 (setq gnus-thread-indent-array (make-vector 201 "") | |
2564 gnus-thread-indent-array-level gnus-thread-indent-level) | |
2565 (while (>= n 0) | |
2566 (aset gnus-thread-indent-array n | |
2567 (make-string (* n gnus-thread-indent-level) ? )) | |
2568 (setq n (1- n)))))) | |
2569 | |
2570 (defun gnus-update-summary-mark-positions () | |
2571 "Compute where the summary marks are to go." | |
2572 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2573 (when (gnus-buffer-exists-p gnus-summary-buffer) |
17493 | 2574 (set-buffer gnus-summary-buffer)) |
2575 (let ((gnus-replied-mark 129) | |
2576 (gnus-score-below-mark 130) | |
2577 (gnus-score-over-mark 130) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2578 (gnus-download-mark 131) |
17493 | 2579 (spec gnus-summary-line-format-spec) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2580 gnus-visual pos) |
17493 | 2581 (save-excursion |
2582 (gnus-set-work-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2583 (let ((gnus-summary-line-format-spec spec) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2584 (gnus-newsgroup-downloadable '((0 . t)))) |
17493 | 2585 (gnus-summary-insert-line |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2586 [0 "" "" "" "" "" 0 0 "" nil] 0 nil 128 t nil "" nil 1) |
17493 | 2587 (goto-char (point-min)) |
2588 (setq pos (list (cons 'unread (and (search-forward "\200" nil t) | |
2589 (- (point) 2))))) | |
2590 (goto-char (point-min)) | |
2591 (push (cons 'replied (and (search-forward "\201" nil t) | |
2592 (- (point) 2))) | |
2593 pos) | |
2594 (goto-char (point-min)) | |
2595 (push (cons 'score (and (search-forward "\202" nil t) (- (point) 2))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2596 pos) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2597 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2598 (push (cons 'download |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2599 (and (search-forward "\203" nil t) (- (point) 2))) |
17493 | 2600 pos))) |
2601 (setq gnus-summary-mark-positions pos)))) | |
2602 | |
2603 (defun gnus-summary-insert-dummy-line (gnus-tmp-subject gnus-tmp-number) | |
2604 "Insert a dummy root in the summary buffer." | |
2605 (beginning-of-line) | |
2606 (gnus-add-text-properties | |
2607 (point) (progn (eval gnus-summary-dummy-line-format-spec) (point)) | |
2608 (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number))) | |
2609 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2610 (defun gnus-summary-from-or-to-or-newsgroups (header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2611 (let ((to (cdr (assq 'To (mail-header-extra header)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2612 (newsgroups (cdr (assq 'Newsgroups (mail-header-extra header)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2613 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2614 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2615 (save-excursion (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2616 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2617 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2618 ((and to |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2619 gnus-ignored-from-addresses |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2620 (string-match gnus-ignored-from-addresses |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2621 (mail-header-from header))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2622 (concat "-> " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2623 (or (car (funcall gnus-extract-address-components |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2624 (funcall |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2625 gnus-decode-encoded-word-function to))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2626 (funcall gnus-decode-encoded-word-function to)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2627 ((and newsgroups |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2628 gnus-ignored-from-addresses |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2629 (string-match gnus-ignored-from-addresses |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2630 (mail-header-from header))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2631 (concat "=> " newsgroups)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2632 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2633 (or (car (funcall gnus-extract-address-components |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2634 (mail-header-from header))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2635 (mail-header-from header)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2636 |
17493 | 2637 (defun gnus-summary-insert-line (gnus-tmp-header |
2638 gnus-tmp-level gnus-tmp-current | |
2639 gnus-tmp-unread gnus-tmp-replied | |
2640 gnus-tmp-expirable gnus-tmp-subject-or-nil | |
2641 &optional gnus-tmp-dummy gnus-tmp-score | |
2642 gnus-tmp-process) | |
2643 (let* ((gnus-tmp-indentation (aref gnus-thread-indent-array gnus-tmp-level)) | |
2644 (gnus-tmp-lines (mail-header-lines gnus-tmp-header)) | |
2645 (gnus-tmp-score (or gnus-tmp-score gnus-summary-default-score 0)) | |
2646 (gnus-tmp-score-char | |
2647 (if (or (null gnus-summary-default-score) | |
2648 (<= (abs (- gnus-tmp-score gnus-summary-default-score)) | |
2649 gnus-summary-zcore-fuzz)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2650 ? ;Whitespace |
17493 | 2651 (if (< gnus-tmp-score gnus-summary-default-score) |
2652 gnus-score-below-mark gnus-score-over-mark))) | |
2653 (gnus-tmp-replied | |
2654 (cond (gnus-tmp-process gnus-process-mark) | |
2655 ((memq gnus-tmp-current gnus-newsgroup-cached) | |
2656 gnus-cached-mark) | |
2657 (gnus-tmp-replied gnus-replied-mark) | |
2658 ((memq gnus-tmp-current gnus-newsgroup-saved) | |
2659 gnus-saved-mark) | |
2660 (t gnus-unread-mark))) | |
2661 (gnus-tmp-from (mail-header-from gnus-tmp-header)) | |
2662 (gnus-tmp-name | |
2663 (cond | |
2664 ((string-match "<[^>]+> *$" gnus-tmp-from) | |
2665 (let ((beg (match-beginning 0))) | |
2666 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from) | |
2667 (substring gnus-tmp-from (1+ (match-beginning 0)) | |
2668 (1- (match-end 0)))) | |
2669 (substring gnus-tmp-from 0 beg)))) | |
2670 ((string-match "(.+)" gnus-tmp-from) | |
2671 (substring gnus-tmp-from | |
2672 (1+ (match-beginning 0)) (1- (match-end 0)))) | |
2673 (t gnus-tmp-from))) | |
2674 (gnus-tmp-subject (mail-header-subject gnus-tmp-header)) | |
2675 (gnus-tmp-number (mail-header-number gnus-tmp-header)) | |
2676 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[)) | |
2677 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\])) | |
2678 (buffer-read-only nil)) | |
2679 (when (string= gnus-tmp-name "") | |
2680 (setq gnus-tmp-name gnus-tmp-from)) | |
2681 (unless (numberp gnus-tmp-lines) | |
2682 (setq gnus-tmp-lines 0)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2683 (gnus-put-text-property |
17493 | 2684 (point) |
2685 (progn (eval gnus-summary-line-format-spec) (point)) | |
2686 'gnus-number gnus-tmp-number) | |
2687 (when (gnus-visual-p 'summary-highlight 'highlight) | |
2688 (forward-line -1) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2689 (gnus-run-hooks 'gnus-summary-update-hook) |
17493 | 2690 (forward-line 1)))) |
2691 | |
2692 (defun gnus-summary-update-line (&optional dont-update) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2693 "Update summary line after change." |
17493 | 2694 (when (and gnus-summary-default-score |
2695 (not gnus-summary-inhibit-highlight)) | |
2696 (let* ((gnus-summary-inhibit-highlight t) ; Prevent recursion. | |
2697 (article (gnus-summary-article-number)) | |
2698 (score (gnus-summary-article-score article))) | |
2699 (unless dont-update | |
2700 (if (and gnus-summary-mark-below | |
2701 (< (gnus-summary-article-score) | |
2702 gnus-summary-mark-below)) | |
2703 ;; This article has a low score, so we mark it as read. | |
2704 (when (memq article gnus-newsgroup-unreads) | |
2705 (gnus-summary-mark-article-as-read gnus-low-score-mark)) | |
2706 (when (eq (gnus-summary-article-mark) gnus-low-score-mark) | |
2707 ;; This article was previously marked as read on account | |
2708 ;; of a low score, but now it has risen, so we mark it as | |
2709 ;; unread. | |
2710 (gnus-summary-mark-article-as-unread gnus-unread-mark))) | |
2711 (gnus-summary-update-mark | |
2712 (if (or (null gnus-summary-default-score) | |
2713 (<= (abs (- score gnus-summary-default-score)) | |
2714 gnus-summary-zcore-fuzz)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2715 ? ;Whitespace |
17493 | 2716 (if (< score gnus-summary-default-score) |
2717 gnus-score-below-mark gnus-score-over-mark)) | |
2718 'score)) | |
2719 ;; Do visual highlighting. | |
2720 (when (gnus-visual-p 'summary-highlight 'highlight) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2721 (gnus-run-hooks 'gnus-summary-update-hook))))) |
17493 | 2722 |
2723 (defvar gnus-tmp-new-adopts nil) | |
2724 | |
2725 (defun gnus-summary-number-of-articles-in-thread (thread &optional level char) | |
2726 "Return the number of articles in THREAD. | |
2727 This may be 0 in some cases -- if none of the articles in | |
2728 the thread are to be displayed." | |
2729 (let* ((number | |
2730 ;; Fix by Luc Van Eycken <Luc.VanEycken@esat.kuleuven.ac.be>. | |
2731 (cond | |
2732 ((not (listp thread)) | |
2733 1) | |
2734 ((and (consp thread) (cdr thread)) | |
2735 (apply | |
2736 '+ 1 (mapcar | |
2737 'gnus-summary-number-of-articles-in-thread (cdr thread)))) | |
2738 ((null thread) | |
2739 1) | |
2740 ((memq (mail-header-number (car thread)) gnus-newsgroup-limit) | |
2741 1) | |
2742 (t 0)))) | |
2743 (when (and level (zerop level) gnus-tmp-new-adopts) | |
2744 (incf number | |
2745 (apply '+ (mapcar | |
2746 'gnus-summary-number-of-articles-in-thread | |
2747 gnus-tmp-new-adopts)))) | |
2748 (if char | |
2749 (if (> number 1) gnus-not-empty-thread-mark | |
2750 gnus-empty-thread-mark) | |
2751 number))) | |
2752 | |
2753 (defun gnus-summary-set-local-parameters (group) | |
2754 "Go through the local params of GROUP and set all variable specs in that list." | |
2755 (let ((params (gnus-group-find-parameter group)) | |
2756 elem) | |
2757 (while params | |
2758 (setq elem (car params) | |
2759 params (cdr params)) | |
2760 (and (consp elem) ; Has to be a cons. | |
2761 (consp (cdr elem)) ; The cdr has to be a list. | |
2762 (symbolp (car elem)) ; Has to be a symbol in there. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2763 (not (memq (car elem) '(quit-config))) ; Ignore quit-config. |
17493 | 2764 (ignore-errors ; So we set it. |
2765 (make-local-variable (car elem)) | |
2766 (set (car elem) (eval (nth 1 elem)))))))) | |
2767 | |
2768 (defun gnus-summary-read-group (group &optional show-all no-article | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2769 kill-buffer no-display backward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2770 select-articles) |
17493 | 2771 "Start reading news in newsgroup GROUP. |
2772 If SHOW-ALL is non-nil, already read articles are also listed. | |
2773 If NO-ARTICLE is non-nil, no article is selected initially. | |
2774 If NO-DISPLAY, don't generate a summary buffer." | |
2775 (let (result) | |
2776 (while (and group | |
2777 (null (setq result | |
2778 (let ((gnus-auto-select-next nil)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2779 (or (gnus-summary-read-group-1 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2780 group show-all no-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2781 kill-buffer no-display |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2782 select-articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2783 (setq show-all nil |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2784 select-articles nil))))) |
17493 | 2785 (eq gnus-auto-select-next 'quietly)) |
2786 (set-buffer gnus-group-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2787 ;; The entry function called above goes to the next |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2788 ;; group automatically, so we go two groups back |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2789 ;; if we are searching for the previous group. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2790 (when backward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2791 (gnus-group-prev-unread-group 2)) |
17493 | 2792 (if (not (equal group (gnus-group-group-name))) |
2793 (setq group (gnus-group-group-name)) | |
2794 (setq group nil))) | |
2795 result)) | |
2796 | |
2797 (defun gnus-summary-read-group-1 (group show-all no-article | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2798 kill-buffer no-display |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2799 &optional select-articles) |
17493 | 2800 ;; Killed foreign groups can't be entered. |
2801 (when (and (not (gnus-group-native-p group)) | |
2802 (not (gnus-gethash group gnus-newsrc-hashtb))) | |
2803 (error "Dead non-native groups can't be entered")) | |
2804 (gnus-message 5 "Retrieving newsgroup: %s..." group) | |
2805 (let* ((new-group (gnus-summary-setup-buffer group)) | |
2806 (quit-config (gnus-group-quit-config group)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2807 (did-select (and new-group (gnus-select-newsgroup |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2808 group show-all select-articles)))) |
17493 | 2809 (cond |
2810 ;; This summary buffer exists already, so we just select it. | |
2811 ((not new-group) | |
2812 (gnus-set-global-variables) | |
2813 (when kill-buffer | |
2814 (gnus-kill-or-deaden-summary kill-buffer)) | |
2815 (gnus-configure-windows 'summary 'force) | |
2816 (gnus-set-mode-line 'summary) | |
2817 (gnus-summary-position-point) | |
2818 (message "") | |
2819 t) | |
2820 ;; We couldn't select this group. | |
2821 ((null did-select) | |
2822 (when (and (eq major-mode 'gnus-summary-mode) | |
2823 (not (equal (current-buffer) kill-buffer))) | |
2824 (kill-buffer (current-buffer)) | |
2825 (if (not quit-config) | |
2826 (progn | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2827 ;; Update the info -- marks might need to be removed, |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2828 ;; for instance. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2829 (gnus-summary-update-info) |
17493 | 2830 (set-buffer gnus-group-buffer) |
2831 (gnus-group-jump-to-group group) | |
2832 (gnus-group-next-unread-group 1)) | |
2833 (gnus-handle-ephemeral-exit quit-config))) | |
2834 (gnus-message 3 "Can't select group") | |
2835 nil) | |
2836 ;; The user did a `C-g' while prompting for number of articles, | |
2837 ;; so we exit this group. | |
2838 ((eq did-select 'quit) | |
2839 (and (eq major-mode 'gnus-summary-mode) | |
2840 (not (equal (current-buffer) kill-buffer)) | |
2841 (kill-buffer (current-buffer))) | |
2842 (when kill-buffer | |
2843 (gnus-kill-or-deaden-summary kill-buffer)) | |
2844 (if (not quit-config) | |
2845 (progn | |
2846 (set-buffer gnus-group-buffer) | |
2847 (gnus-group-jump-to-group group) | |
2848 (gnus-group-next-unread-group 1) | |
2849 (gnus-configure-windows 'group 'force)) | |
2850 (gnus-handle-ephemeral-exit quit-config)) | |
2851 ;; Finally signal the quit. | |
2852 (signal 'quit nil)) | |
2853 ;; The group was successfully selected. | |
2854 (t | |
2855 (gnus-set-global-variables) | |
2856 ;; Save the active value in effect when the group was entered. | |
2857 (setq gnus-newsgroup-active | |
2858 (gnus-copy-sequence | |
2859 (gnus-active gnus-newsgroup-name))) | |
2860 ;; You can change the summary buffer in some way with this hook. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2861 (gnus-run-hooks 'gnus-select-group-hook) |
17493 | 2862 ;; Set any local variables in the group parameters. |
2863 (gnus-summary-set-local-parameters gnus-newsgroup-name) | |
2864 (gnus-update-format-specifications | |
2865 nil 'summary 'summary-mode 'summary-dummy) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2866 (gnus-update-summary-mark-positions) |
17493 | 2867 ;; Do score processing. |
2868 (when gnus-use-scoring | |
2869 (gnus-possibly-score-headers)) | |
2870 ;; Check whether to fill in the gaps in the threads. | |
2871 (when gnus-build-sparse-threads | |
2872 (gnus-build-sparse-threads)) | |
2873 ;; Find the initial limit. | |
2874 (if gnus-show-threads | |
2875 (if show-all | |
2876 (let ((gnus-newsgroup-dormant nil)) | |
2877 (gnus-summary-initial-limit show-all)) | |
2878 (gnus-summary-initial-limit show-all)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2879 ;; When untreaded, all articles are always shown. |
17493 | 2880 (setq gnus-newsgroup-limit |
2881 (mapcar | |
2882 (lambda (header) (mail-header-number header)) | |
2883 gnus-newsgroup-headers))) | |
2884 ;; Generate the summary buffer. | |
2885 (unless no-display | |
2886 (gnus-summary-prepare)) | |
2887 (when gnus-use-trees | |
2888 (gnus-tree-open group) | |
2889 (setq gnus-summary-highlight-line-function | |
2890 'gnus-tree-highlight-article)) | |
2891 ;; If the summary buffer is empty, but there are some low-scored | |
2892 ;; articles or some excluded dormants, we include these in the | |
2893 ;; buffer. | |
2894 (when (and (zerop (buffer-size)) | |
2895 (not no-display)) | |
2896 (cond (gnus-newsgroup-dormant | |
2897 (gnus-summary-limit-include-dormant)) | |
2898 ((and gnus-newsgroup-scored show-all) | |
2899 (gnus-summary-limit-include-expunged t)))) | |
2900 ;; Function `gnus-apply-kill-file' must be called in this hook. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2901 (gnus-run-hooks 'gnus-apply-kill-hook) |
17493 | 2902 (if (and (zerop (buffer-size)) |
2903 (not no-display)) | |
2904 (progn | |
2905 ;; This newsgroup is empty. | |
2906 (gnus-summary-catchup-and-exit nil t) | |
2907 (gnus-message 6 "No unread news") | |
2908 (when kill-buffer | |
2909 (gnus-kill-or-deaden-summary kill-buffer)) | |
2910 ;; Return nil from this function. | |
2911 nil) | |
2912 ;; Hide conversation thread subtrees. We cannot do this in | |
2913 ;; gnus-summary-prepare-hook since kill processing may not | |
2914 ;; work with hidden articles. | |
2915 (and gnus-show-threads | |
2916 gnus-thread-hide-subtree | |
2917 (gnus-summary-hide-all-threads)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2918 (when kill-buffer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2919 (gnus-kill-or-deaden-summary kill-buffer)) |
17493 | 2920 ;; Show first unread article if requested. |
2921 (if (and (not no-article) | |
2922 (not no-display) | |
2923 gnus-newsgroup-unreads | |
2924 gnus-auto-select-first) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2925 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2926 (gnus-configure-windows 'summary) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2927 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2928 ((eq gnus-auto-select-first 'best) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2929 (gnus-summary-best-unread-article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2930 ((eq gnus-auto-select-first t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2931 (gnus-summary-first-unread-article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2932 ((gnus-functionp gnus-auto-select-first) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2933 (funcall gnus-auto-select-first)))) |
17493 | 2934 ;; Don't select any articles, just move point to the first |
2935 ;; article in the group. | |
2936 (goto-char (point-min)) | |
2937 (gnus-summary-position-point) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2938 (gnus-configure-windows 'summary 'force) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2939 (gnus-set-mode-line 'summary)) |
17493 | 2940 (when (get-buffer-window gnus-group-buffer t) |
2941 ;; Gotta use windows, because recenter does weird stuff if | |
2942 ;; the current buffer ain't the displayed window. | |
2943 (let ((owin (selected-window))) | |
2944 (select-window (get-buffer-window gnus-group-buffer t)) | |
2945 (when (gnus-group-goto-group group) | |
2946 (recenter)) | |
2947 (select-window owin))) | |
2948 ;; Mark this buffer as "prepared". | |
2949 (setq gnus-newsgroup-prepared t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2950 (gnus-run-hooks 'gnus-summary-prepared-hook) |
17493 | 2951 t))))) |
2952 | |
2953 (defun gnus-summary-prepare () | |
2954 "Generate the summary buffer." | |
2955 (interactive) | |
2956 (let ((buffer-read-only nil)) | |
2957 (erase-buffer) | |
2958 (setq gnus-newsgroup-data nil | |
2959 gnus-newsgroup-data-reverse nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2960 (gnus-run-hooks 'gnus-summary-generate-hook) |
17493 | 2961 ;; Generate the buffer, either with threads or without. |
2962 (when gnus-newsgroup-headers | |
2963 (gnus-summary-prepare-threads | |
2964 (if gnus-show-threads | |
2965 (gnus-sort-gathered-threads | |
2966 (funcall gnus-summary-thread-gathering-function | |
2967 (gnus-sort-threads | |
2968 (gnus-cut-threads (gnus-make-threads))))) | |
2969 ;; Unthreaded display. | |
2970 (gnus-sort-articles gnus-newsgroup-headers)))) | |
2971 (setq gnus-newsgroup-data (nreverse gnus-newsgroup-data)) | |
2972 ;; Call hooks for modifying summary buffer. | |
2973 (goto-char (point-min)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2974 (gnus-run-hooks 'gnus-summary-prepare-hook))) |
17493 | 2975 |
2976 (defsubst gnus-general-simplify-subject (subject) | |
2977 "Simply subject by the same rules as gnus-gather-threads-by-subject." | |
2978 (setq subject | |
2979 (cond | |
2980 ;; Truncate the subject. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2981 (gnus-simplify-subject-functions |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2982 (gnus-map-function gnus-simplify-subject-functions subject)) |
17493 | 2983 ((numberp gnus-summary-gather-subject-limit) |
2984 (setq subject (gnus-simplify-subject-re subject)) | |
2985 (if (> (length subject) gnus-summary-gather-subject-limit) | |
2986 (substring subject 0 gnus-summary-gather-subject-limit) | |
2987 subject)) | |
2988 ;; Fuzzily simplify it. | |
2989 ((eq 'fuzzy gnus-summary-gather-subject-limit) | |
2990 (gnus-simplify-subject-fuzzy subject)) | |
2991 ;; Just remove the leading "Re:". | |
2992 (t | |
2993 (gnus-simplify-subject-re subject)))) | |
2994 | |
2995 (if (and gnus-summary-gather-exclude-subject | |
2996 (string-match gnus-summary-gather-exclude-subject subject)) | |
2997 nil ; This article shouldn't be gathered | |
2998 subject)) | |
2999 | |
3000 (defun gnus-summary-simplify-subject-query () | |
3001 "Query where the respool algorithm would put this article." | |
3002 (interactive) | |
3003 (gnus-summary-select-article) | |
3004 (message (gnus-general-simplify-subject (gnus-summary-article-subject)))) | |
3005 | |
3006 (defun gnus-gather-threads-by-subject (threads) | |
3007 "Gather threads by looking at Subject headers." | |
3008 (if (not gnus-summary-make-false-root) | |
3009 threads | |
3010 (let ((hashtb (gnus-make-hashtable 1024)) | |
3011 (prev threads) | |
3012 (result threads) | |
3013 subject hthread whole-subject) | |
3014 (while threads | |
3015 (setq subject (gnus-general-simplify-subject | |
3016 (setq whole-subject (mail-header-subject | |
3017 (caar threads))))) | |
3018 (when subject | |
3019 (if (setq hthread (gnus-gethash subject hashtb)) | |
3020 (progn | |
3021 ;; We enter a dummy root into the thread, if we | |
3022 ;; haven't done that already. | |
3023 (unless (stringp (caar hthread)) | |
3024 (setcar hthread (list whole-subject (car hthread)))) | |
3025 ;; We add this new gathered thread to this gathered | |
3026 ;; thread. | |
3027 (setcdr (car hthread) | |
3028 (nconc (cdar hthread) (list (car threads)))) | |
3029 ;; Remove it from the list of threads. | |
3030 (setcdr prev (cdr threads)) | |
3031 (setq threads prev)) | |
3032 ;; Enter this thread into the hash table. | |
3033 (gnus-sethash subject threads hashtb))) | |
3034 (setq prev threads) | |
3035 (setq threads (cdr threads))) | |
3036 result))) | |
3037 | |
3038 (defun gnus-gather-threads-by-references (threads) | |
3039 "Gather threads by looking at References headers." | |
3040 (let ((idhashtb (gnus-make-hashtable 1024)) | |
3041 (thhashtb (gnus-make-hashtable 1024)) | |
3042 (prev threads) | |
3043 (result threads) | |
3044 ids references id gthread gid entered ref) | |
3045 (while threads | |
3046 (when (setq references (mail-header-references (caar threads))) | |
3047 (setq id (mail-header-id (caar threads)) | |
3048 ids (gnus-split-references references) | |
3049 entered nil) | |
3050 (while (setq ref (pop ids)) | |
3051 (setq ids (delete ref ids)) | |
3052 (if (not (setq gid (gnus-gethash ref idhashtb))) | |
3053 (progn | |
3054 (gnus-sethash ref id idhashtb) | |
3055 (gnus-sethash id threads thhashtb)) | |
3056 (setq gthread (gnus-gethash gid thhashtb)) | |
3057 (unless entered | |
3058 ;; We enter a dummy root into the thread, if we | |
3059 ;; haven't done that already. | |
3060 (unless (stringp (caar gthread)) | |
3061 (setcar gthread (list (mail-header-subject (caar gthread)) | |
3062 (car gthread)))) | |
3063 ;; We add this new gathered thread to this gathered | |
3064 ;; thread. | |
3065 (setcdr (car gthread) | |
3066 (nconc (cdar gthread) (list (car threads))))) | |
3067 ;; Add it into the thread hash table. | |
3068 (gnus-sethash id gthread thhashtb) | |
3069 (setq entered t) | |
3070 ;; Remove it from the list of threads. | |
3071 (setcdr prev (cdr threads)) | |
3072 (setq threads prev)))) | |
3073 (setq prev threads) | |
3074 (setq threads (cdr threads))) | |
3075 result)) | |
3076 | |
3077 (defun gnus-sort-gathered-threads (threads) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3078 "Sort subtreads inside each gathered thread by `gnus-sort-gathered-threads-function'." |
17493 | 3079 (let ((result threads)) |
3080 (while threads | |
3081 (when (stringp (caar threads)) | |
3082 (setcdr (car threads) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3083 (sort (cdar threads) gnus-sort-gathered-threads-function))) |
17493 | 3084 (setq threads (cdr threads))) |
3085 result)) | |
3086 | |
3087 (defun gnus-thread-loop-p (root thread) | |
3088 "Say whether ROOT is in THREAD." | |
3089 (let ((stack (list thread)) | |
3090 (infloop 0) | |
3091 th) | |
3092 (while (setq thread (pop stack)) | |
3093 (setq th (cdr thread)) | |
3094 (while (and th | |
3095 (not (eq (caar th) root))) | |
3096 (pop th)) | |
3097 (if th | |
3098 ;; We have found a loop. | |
3099 (let (ref-dep) | |
3100 (setcdr thread (delq (car th) (cdr thread))) | |
3101 (if (boundp (setq ref-dep (intern "none" | |
3102 gnus-newsgroup-dependencies))) | |
3103 (setcdr (symbol-value ref-dep) | |
3104 (nconc (cdr (symbol-value ref-dep)) | |
3105 (list (car th)))) | |
3106 (set ref-dep (list nil (car th)))) | |
3107 (setq infloop 1 | |
3108 stack nil)) | |
3109 ;; Push all the subthreads onto the stack. | |
3110 (push (cdr thread) stack))) | |
3111 infloop)) | |
3112 | |
3113 (defun gnus-make-threads () | |
3114 "Go through the dependency hashtb and find the roots. Return all threads." | |
3115 (let (threads) | |
3116 (while (catch 'infloop | |
3117 (mapatoms | |
3118 (lambda (refs) | |
3119 ;; Deal with self-referencing References loops. | |
3120 (when (and (car (symbol-value refs)) | |
3121 (not (zerop | |
3122 (apply | |
3123 '+ | |
3124 (mapcar | |
3125 (lambda (thread) | |
3126 (gnus-thread-loop-p | |
3127 (car (symbol-value refs)) thread)) | |
3128 (cdr (symbol-value refs))))))) | |
3129 (setq threads nil) | |
3130 (throw 'infloop t)) | |
3131 (unless (car (symbol-value refs)) | |
3132 ;; These threads do not refer back to any other articles, | |
3133 ;; so they're roots. | |
3134 (setq threads (append (cdr (symbol-value refs)) threads)))) | |
3135 gnus-newsgroup-dependencies))) | |
3136 threads)) | |
3137 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3138 ;; Build the thread tree. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3139 (defsubst gnus-dependencies-add-header (header dependencies force-new) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3140 "Enter HEADER into the DEPENDENCIES table if it is not already there. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3141 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3142 If FORCE-NEW is not nil, enter HEADER into the DEPENDENCIES table even |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3143 if it was already present. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3144 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3145 If `gnus-summary-ignore-duplicates' is nil then duplicate Message-IDs |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3146 will not be entered in the DEPENDENCIES table. Otherwise duplicate |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3147 Message-IDs will be renamed be renamed to a unique Message-ID before |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3148 being entered. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3149 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3150 Returns HEADER if it was entered in the DEPENDENCIES. Returns nil otherwise." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3151 (let* ((id (mail-header-id header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3152 (id-dep (and id (intern id dependencies))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3153 ref ref-dep ref-header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3154 ;; Enter this `header' in the `dependencies' table. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3155 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3156 ((not id-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3157 (setq header nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3158 ;; The first two cases do the normal part: enter a new `header' |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3159 ;; in the `dependencies' table. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3160 ((not (boundp id-dep)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3161 (set id-dep (list header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3162 ((null (car (symbol-value id-dep))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3163 (setcar (symbol-value id-dep) header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3164 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3165 ;; From here the `header' was already present in the |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3166 ;; `dependencies' table. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3167 (force-new |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3168 ;; Overrides an existing entry; |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3169 ;; just set the header part of the entry. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3170 (setcar (symbol-value id-dep) header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3171 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3172 ;; Renames the existing `header' to a unique Message-ID. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3173 ((not gnus-summary-ignore-duplicates) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3174 ;; An article with this Message-ID has already been seen. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3175 ;; We rename the Message-ID. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3176 (set (setq id-dep (intern (setq id (nnmail-message-id)) dependencies)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3177 (list header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3178 (mail-header-set-id header id)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3179 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3180 ;; The last case ignores an existing entry, except it adds any |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3181 ;; additional Xrefs (in case the two articles came from different |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3182 ;; servers. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3183 ;; Also sets `header' to `nil' meaning that the `dependencies' |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3184 ;; table was *not* modified. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3185 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3186 (mail-header-set-xref |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3187 (car (symbol-value id-dep)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3188 (concat (or (mail-header-xref (car (symbol-value id-dep))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3189 "") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3190 (or (mail-header-xref header) ""))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3191 (setq header nil))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3192 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3193 (when header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3194 ;; First check if that we are not creating a References loop. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3195 (setq ref (gnus-parent-id (mail-header-references header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3196 (while (and ref |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3197 (setq ref-dep (intern-soft ref dependencies)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3198 (boundp ref-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3199 (setq ref-header (car (symbol-value ref-dep)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3200 (if (string= id ref) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3201 ;; Yuk! This is a reference loop. Make the article be a |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3202 ;; root article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3203 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3204 (mail-header-set-references (car (symbol-value id-dep)) "none") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3205 (setq ref nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3206 (setq ref (gnus-parent-id (mail-header-references ref-header))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3207 (setq ref (gnus-parent-id (mail-header-references header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3208 (setq ref-dep (intern (or ref "none") dependencies)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3209 (if (boundp ref-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3210 (setcdr (symbol-value ref-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3211 (nconc (cdr (symbol-value ref-dep)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3212 (list (symbol-value id-dep)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3213 (set ref-dep (list nil (symbol-value id-dep))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3214 header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3215 |
17493 | 3216 (defun gnus-build-sparse-threads () |
3217 (let ((headers gnus-newsgroup-headers) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3218 (mail-parse-charset gnus-newsgroup-charset) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3219 (gnus-summary-ignore-duplicates t) |
17493 | 3220 header references generation relations |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3221 subject child end new-child date) |
17493 | 3222 ;; First we create an alist of generations/relations, where |
3223 ;; generations is how much we trust the relation, and the relation | |
3224 ;; is parent/child. | |
3225 (gnus-message 7 "Making sparse threads...") | |
3226 (save-excursion | |
3227 (nnheader-set-temp-buffer " *gnus sparse threads*") | |
3228 (while (setq header (pop headers)) | |
3229 (when (and (setq references (mail-header-references header)) | |
3230 (not (string= references ""))) | |
3231 (insert references) | |
3232 (setq child (mail-header-id header) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3233 subject (mail-header-subject header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3234 date (mail-header-date header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3235 generation 0) |
17493 | 3236 (while (search-backward ">" nil t) |
3237 (setq end (1+ (point))) | |
3238 (when (search-backward "<" nil t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3239 (setq new-child (buffer-substring (point) end)) |
17493 | 3240 (push (list (incf generation) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3241 child (setq child new-child) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3242 subject date) |
17493 | 3243 relations))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3244 (when child |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3245 (push (list (1+ generation) child nil subject) relations)) |
17493 | 3246 (erase-buffer))) |
3247 (kill-buffer (current-buffer))) | |
3248 ;; Sort over trustworthiness. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3249 (mapcar |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3250 (lambda (relation) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3251 (when (gnus-dependencies-add-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3252 (make-full-mail-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3253 gnus-reffed-article-number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3254 (nth 3 relation) "" (or (nth 4 relation) "") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3255 (nth 1 relation) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3256 (or (nth 2 relation) "") 0 0 "") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3257 gnus-newsgroup-dependencies nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3258 (push gnus-reffed-article-number gnus-newsgroup-limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3259 (push gnus-reffed-article-number gnus-newsgroup-sparse) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3260 (push (cons gnus-reffed-article-number gnus-sparse-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3261 gnus-newsgroup-reads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3262 (decf gnus-reffed-article-number))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3263 (sort relations 'car-less-than-car)) |
17493 | 3264 (gnus-message 7 "Making sparse threads...done"))) |
3265 | |
3266 (defun gnus-build-old-threads () | |
3267 ;; Look at all the articles that refer back to old articles, and | |
3268 ;; fetch the headers for the articles that aren't there. This will | |
3269 ;; build complete threads - if the roots haven't been expired by the | |
3270 ;; server, that is. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3271 (let ((mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3272 id heads) |
17493 | 3273 (mapatoms |
3274 (lambda (refs) | |
3275 (when (not (car (symbol-value refs))) | |
3276 (setq heads (cdr (symbol-value refs))) | |
3277 (while heads | |
3278 (if (memq (mail-header-number (caar heads)) | |
3279 gnus-newsgroup-dormant) | |
3280 (setq heads (cdr heads)) | |
3281 (setq id (symbol-name refs)) | |
3282 (while (and (setq id (gnus-build-get-header id)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3283 (not (car (gnus-id-to-thread id))))) |
17493 | 3284 (setq heads nil))))) |
3285 gnus-newsgroup-dependencies))) | |
3286 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3287 ;; This function has to be called with point after the article number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3288 ;; on the beginning of the line. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3289 (defsubst gnus-nov-parse-line (number dependencies &optional force-new) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3290 (let ((eol (gnus-point-at-eol)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3291 (buffer (current-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3292 header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3293 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3294 ;; overview: [num subject from date id refs chars lines misc] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3295 (unwind-protect |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3296 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3297 (narrow-to-region (point) eol) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3298 (unless (eobp) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3299 (forward-char)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3300 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3301 (setq header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3302 (make-full-mail-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3303 number ; number |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3304 (funcall gnus-decode-encoded-word-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3305 (nnheader-nov-field)) ; subject |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3306 (funcall gnus-decode-encoded-word-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3307 (nnheader-nov-field)) ; from |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3308 (nnheader-nov-field) ; date |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3309 (nnheader-nov-read-message-id) ; id |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3310 (nnheader-nov-field) ; refs |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3311 (nnheader-nov-read-integer) ; chars |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3312 (nnheader-nov-read-integer) ; lines |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3313 (unless (eobp) |
31785 | 3314 (if (looking-at "Xref: ") |
3315 (goto-char (match-end 0))) | |
3316 (nnheader-nov-field)) ; Xref | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3317 (nnheader-nov-parse-extra)))) ; extra |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3318 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3319 (widen)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3320 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3321 (when gnus-alter-header-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3322 (funcall gnus-alter-header-function header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3323 (gnus-dependencies-add-header header dependencies force-new))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3324 |
17493 | 3325 (defun gnus-build-get-header (id) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3326 "Look through the buffer of NOV lines and find the header to ID. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3327 Enter this line into the dependencies hash table, and return |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3328 the id of the parent article (if any)." |
17493 | 3329 (let ((deps gnus-newsgroup-dependencies) |
3330 found header) | |
3331 (prog1 | |
3332 (save-excursion | |
3333 (set-buffer nntp-server-buffer) | |
3334 (let ((case-fold-search nil)) | |
3335 (goto-char (point-min)) | |
3336 (while (and (not found) | |
3337 (search-forward id nil t)) | |
3338 (beginning-of-line) | |
3339 (setq found (looking-at | |
3340 (format "^[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t%s" | |
3341 (regexp-quote id)))) | |
3342 (or found (beginning-of-line 2))) | |
3343 (when found | |
3344 (beginning-of-line) | |
3345 (and | |
3346 (setq header (gnus-nov-parse-line | |
3347 (read (current-buffer)) deps)) | |
3348 (gnus-parent-id (mail-header-references header)))))) | |
3349 (when header | |
3350 (let ((number (mail-header-number header))) | |
3351 (push number gnus-newsgroup-limit) | |
3352 (push header gnus-newsgroup-headers) | |
3353 (if (memq number gnus-newsgroup-unselected) | |
3354 (progn | |
3355 (push number gnus-newsgroup-unreads) | |
3356 (setq gnus-newsgroup-unselected | |
3357 (delq number gnus-newsgroup-unselected))) | |
3358 (push number gnus-newsgroup-ancient))))))) | |
3359 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3360 (defun gnus-build-all-threads () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3361 "Read all the headers." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3362 (let ((gnus-summary-ignore-duplicates t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3363 (mail-parse-charset gnus-newsgroup-charset) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3364 (dependencies gnus-newsgroup-dependencies) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3365 header article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3366 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3367 (set-buffer nntp-server-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3368 (let ((case-fold-search nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3369 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3370 (while (not (eobp)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3371 (ignore-errors |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3372 (setq article (read (current-buffer)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3373 header (gnus-nov-parse-line article dependencies))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3374 (when header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3375 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3376 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3377 (push header gnus-newsgroup-headers) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3378 (if (memq (setq article (mail-header-number header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3379 gnus-newsgroup-unselected) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3380 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3381 (push article gnus-newsgroup-unreads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3382 (setq gnus-newsgroup-unselected |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3383 (delq article gnus-newsgroup-unselected))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3384 (push article gnus-newsgroup-ancient))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3385 (forward-line 1))))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3386 |
17493 | 3387 (defun gnus-summary-update-article-line (article header) |
3388 "Update the line for ARTICLE using HEADERS." | |
3389 (let* ((id (mail-header-id header)) | |
3390 (thread (gnus-id-to-thread id))) | |
3391 (unless thread | |
3392 (error "Article in no thread")) | |
3393 ;; Update the thread. | |
3394 (setcar thread header) | |
3395 (gnus-summary-goto-subject article) | |
3396 (let* ((datal (gnus-data-find-list article)) | |
3397 (data (car datal)) | |
3398 (length (when (cdr datal) | |
3399 (- (gnus-data-pos data) | |
3400 (gnus-data-pos (cadr datal))))) | |
3401 (buffer-read-only nil) | |
3402 (level (gnus-summary-thread-level))) | |
3403 (gnus-delete-line) | |
3404 (gnus-summary-insert-line | |
3405 header level nil (gnus-article-mark article) | |
3406 (memq article gnus-newsgroup-replied) | |
3407 (memq article gnus-newsgroup-expirable) | |
3408 ;; Only insert the Subject string when it's different | |
3409 ;; from the previous Subject string. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3410 (if (and |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3411 gnus-show-threads |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3412 (gnus-subject-equal |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3413 (condition-case () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3414 (mail-header-subject |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3415 (gnus-data-header |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3416 (cadr |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3417 (gnus-data-find-list |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3418 article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3419 (gnus-data-list t))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3420 ;; Error on the side of excessive subjects. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3421 (error "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3422 (mail-header-subject header))) |
17493 | 3423 "" |
3424 (mail-header-subject header)) | |
3425 nil (cdr (assq article gnus-newsgroup-scored)) | |
3426 (memq article gnus-newsgroup-processable)) | |
3427 (when length | |
3428 (gnus-data-update-list | |
3429 (cdr datal) (- length (- (gnus-data-pos data) (point)))))))) | |
3430 | |
3431 (defun gnus-summary-update-article (article &optional iheader) | |
3432 "Update ARTICLE in the summary buffer." | |
3433 (set-buffer gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3434 (let* ((header (gnus-summary-article-header article)) |
17493 | 3435 (id (mail-header-id header)) |
3436 (data (gnus-data-find article)) | |
3437 (thread (gnus-id-to-thread id)) | |
3438 (references (mail-header-references header)) | |
3439 (parent | |
3440 (gnus-id-to-thread | |
3441 (or (gnus-parent-id | |
3442 (when (and references | |
3443 (not (equal "" references))) | |
3444 references)) | |
3445 "none"))) | |
3446 (buffer-read-only nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3447 (old (car thread))) |
17493 | 3448 (when thread |
3449 (unless iheader | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3450 (setcar thread nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3451 (when parent |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3452 (delq thread parent))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3453 (if (gnus-summary-insert-subject id header) |
17493 | 3454 ;; Set the (possibly) new article number in the data structure. |
3455 (gnus-data-set-number data (gnus-id-to-article id)) | |
3456 (setcar thread old) | |
3457 nil)))) | |
3458 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3459 (defun gnus-rebuild-thread (id &optional line) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3460 "Rebuild the thread containing ID. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3461 If LINE, insert the rebuilt thread starting on line LINE." |
17493 | 3462 (let ((buffer-read-only nil) |
3463 old-pos current thread data) | |
3464 (if (not gnus-show-threads) | |
3465 (setq thread (list (car (gnus-id-to-thread id)))) | |
3466 ;; Get the thread this article is part of. | |
3467 (setq thread (gnus-remove-thread id))) | |
3468 (setq old-pos (gnus-point-at-bol)) | |
3469 (setq current (save-excursion | |
3470 (and (zerop (forward-line -1)) | |
3471 (gnus-summary-article-number)))) | |
3472 ;; If this is a gathered thread, we have to go some re-gathering. | |
3473 (when (stringp (car thread)) | |
3474 (let ((subject (car thread)) | |
3475 roots thr) | |
3476 (setq thread (cdr thread)) | |
3477 (while thread | |
3478 (unless (memq (setq thr (gnus-id-to-thread | |
3479 (gnus-root-id | |
3480 (mail-header-id (caar thread))))) | |
3481 roots) | |
3482 (push thr roots)) | |
3483 (setq thread (cdr thread))) | |
3484 ;; We now have all (unique) roots. | |
3485 (if (= (length roots) 1) | |
3486 ;; All the loose roots are now one solid root. | |
3487 (setq thread (car roots)) | |
3488 (setq thread (cons subject (gnus-sort-threads roots)))))) | |
3489 (let (threads) | |
3490 ;; We then insert this thread into the summary buffer. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3491 (when line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3492 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3493 (forward-line (1- line))) |
17493 | 3494 (let (gnus-newsgroup-data gnus-newsgroup-threads) |
3495 (if gnus-show-threads | |
3496 (gnus-summary-prepare-threads (gnus-cut-threads (list thread))) | |
3497 (gnus-summary-prepare-unthreaded thread)) | |
3498 (setq data (nreverse gnus-newsgroup-data)) | |
3499 (setq threads gnus-newsgroup-threads)) | |
3500 ;; We splice the new data into the data structure. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3501 ;;!!! This is kinda bogus. We assume that in LINE is non-nil, |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3502 ;;!!! then we want to insert at the beginning of the buffer. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3503 ;;!!! That happens to be true with Gnus now, but that may |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3504 ;;!!! change in the future. Perhaps. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3505 (gnus-data-enter-list |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3506 (if line nil current) data (- (point) old-pos)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3507 (setq gnus-newsgroup-threads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3508 (nconc threads gnus-newsgroup-threads)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3509 (gnus-data-compute-positions)))) |
17493 | 3510 |
3511 (defun gnus-number-to-header (number) | |
3512 "Return the header for article NUMBER." | |
3513 (let ((headers gnus-newsgroup-headers)) | |
3514 (while (and headers | |
3515 (not (= number (mail-header-number (car headers))))) | |
3516 (pop headers)) | |
3517 (when headers | |
3518 (car headers)))) | |
3519 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3520 (defun gnus-parent-headers (in-headers &optional generation) |
17493 | 3521 "Return the headers of the GENERATIONeth parent of HEADERS." |
3522 (unless generation | |
3523 (setq generation 1)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
3524 (let ((parent t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3525 (headers in-headers) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
3526 references) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3527 (while (and parent |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3528 (not (zerop generation)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3529 (setq references (mail-header-references headers))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3530 (setq headers (if (and references |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3531 (setq parent (gnus-parent-id references))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3532 (car (gnus-id-to-thread parent)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3533 nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3534 (decf generation)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3535 (and (not (eq headers in-headers)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3536 headers))) |
17493 | 3537 |
3538 (defun gnus-id-to-thread (id) | |
3539 "Return the (sub-)thread where ID appears." | |
3540 (gnus-gethash id gnus-newsgroup-dependencies)) | |
3541 | |
3542 (defun gnus-id-to-article (id) | |
3543 "Return the article number of ID." | |
3544 (let ((thread (gnus-id-to-thread id))) | |
3545 (when (and thread | |
3546 (car thread)) | |
3547 (mail-header-number (car thread))))) | |
3548 | |
3549 (defun gnus-id-to-header (id) | |
3550 "Return the article headers of ID." | |
3551 (car (gnus-id-to-thread id))) | |
3552 | |
3553 (defun gnus-article-displayed-root-p (article) | |
3554 "Say whether ARTICLE is a root(ish) article." | |
3555 (let ((level (gnus-summary-thread-level article)) | |
3556 (refs (mail-header-references (gnus-summary-article-header article))) | |
3557 particle) | |
3558 (cond | |
3559 ((null level) nil) | |
3560 ((zerop level) t) | |
3561 ((null refs) t) | |
3562 ((null (gnus-parent-id refs)) t) | |
3563 ((and (= 1 level) | |
3564 (null (setq particle (gnus-id-to-article | |
3565 (gnus-parent-id refs)))) | |
3566 (null (gnus-summary-thread-level particle))))))) | |
3567 | |
3568 (defun gnus-root-id (id) | |
3569 "Return the id of the root of the thread where ID appears." | |
3570 (let (last-id prev) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3571 (while (and id (setq prev (car (gnus-id-to-thread id)))) |
17493 | 3572 (setq last-id id |
3573 id (gnus-parent-id (mail-header-references prev)))) | |
3574 last-id)) | |
3575 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3576 (defun gnus-articles-in-thread (thread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3577 "Return the list of articles in THREAD." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3578 (cons (mail-header-number (car thread)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3579 (apply 'nconc (mapcar 'gnus-articles-in-thread (cdr thread))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3580 |
17493 | 3581 (defun gnus-remove-thread (id &optional dont-remove) |
3582 "Remove the thread that has ID in it." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3583 (let (headers thread last-id) |
17493 | 3584 ;; First go up in this thread until we find the root. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3585 (setq last-id (gnus-root-id id) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3586 headers (message-flatten-list (gnus-id-to-thread last-id))) |
17493 | 3587 ;; We have now found the real root of this thread. It might have |
3588 ;; been gathered into some loose thread, so we have to search | |
3589 ;; through the threads to find the thread we wanted. | |
3590 (let ((threads gnus-newsgroup-threads) | |
3591 sub) | |
3592 (while threads | |
3593 (setq sub (car threads)) | |
3594 (if (stringp (car sub)) | |
3595 ;; This is a gathered thread, so we look at the roots | |
3596 ;; below it to find whether this article is in this | |
3597 ;; gathered root. | |
3598 (progn | |
3599 (setq sub (cdr sub)) | |
3600 (while sub | |
3601 (when (member (caar sub) headers) | |
3602 (setq thread (car threads) | |
3603 threads nil | |
3604 sub nil)) | |
3605 (setq sub (cdr sub)))) | |
3606 ;; It's an ordinary thread, so we check it. | |
3607 (when (eq (car sub) (car headers)) | |
3608 (setq thread sub | |
3609 threads nil))) | |
3610 (setq threads (cdr threads))) | |
3611 ;; If this article is in no thread, then it's a root. | |
3612 (if thread | |
3613 (unless dont-remove | |
3614 (setq gnus-newsgroup-threads (delq thread gnus-newsgroup-threads))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3615 (setq thread (gnus-id-to-thread last-id))) |
17493 | 3616 (when thread |
3617 (prog1 | |
3618 thread ; We return this thread. | |
3619 (unless dont-remove | |
3620 (if (stringp (car thread)) | |
3621 (progn | |
3622 ;; If we use dummy roots, then we have to remove the | |
3623 ;; dummy root as well. | |
3624 (when (eq gnus-summary-make-false-root 'dummy) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3625 ;; We go to the dummy root by going to |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3626 ;; the first sub-"thread", and then one line up. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3627 (gnus-summary-goto-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3628 (mail-header-number (caadr thread))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3629 (forward-line -1) |
17493 | 3630 (gnus-delete-line) |
3631 (gnus-data-compute-positions)) | |
3632 (setq thread (cdr thread)) | |
3633 (while thread | |
3634 (gnus-remove-thread-1 (car thread)) | |
3635 (setq thread (cdr thread)))) | |
3636 (gnus-remove-thread-1 thread)))))))) | |
3637 | |
3638 (defun gnus-remove-thread-1 (thread) | |
3639 "Remove the thread THREAD recursively." | |
3640 (let ((number (mail-header-number (pop thread))) | |
3641 d) | |
3642 (setq thread (reverse thread)) | |
3643 (while thread | |
3644 (gnus-remove-thread-1 (pop thread))) | |
3645 (when (setq d (gnus-data-find number)) | |
3646 (goto-char (gnus-data-pos d)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3647 (gnus-summary-show-thread) |
17493 | 3648 (gnus-data-remove |
3649 number | |
3650 (- (gnus-point-at-bol) | |
3651 (prog1 | |
3652 (1+ (gnus-point-at-eol)) | |
3653 (gnus-delete-line))))))) | |
3654 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3655 (defun gnus-sort-threads-1 (threads func) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3656 (sort (mapcar (lambda (thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3657 (cons (car thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3658 (and (cdr thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3659 (gnus-sort-threads-1 (cdr thread) func)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3660 threads) func)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3661 |
17493 | 3662 (defun gnus-sort-threads (threads) |
3663 "Sort THREADS." | |
3664 (if (not gnus-thread-sort-functions) | |
3665 threads | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3666 (gnus-message 8 "Sorting threads...") |
17493 | 3667 (prog1 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3668 (gnus-sort-threads-1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3669 threads |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3670 (gnus-make-sort-function gnus-thread-sort-functions)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3671 (gnus-message 8 "Sorting threads...done")))) |
17493 | 3672 |
3673 (defun gnus-sort-articles (articles) | |
3674 "Sort ARTICLES." | |
3675 (when gnus-article-sort-functions | |
3676 (gnus-message 7 "Sorting articles...") | |
3677 (prog1 | |
3678 (setq gnus-newsgroup-headers | |
3679 (sort articles (gnus-make-sort-function | |
3680 gnus-article-sort-functions))) | |
3681 (gnus-message 7 "Sorting articles...done")))) | |
3682 | |
3683 ;; Written by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>. | |
3684 (defmacro gnus-thread-header (thread) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3685 "Return header of first article in THREAD. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3686 Note that THREAD must never, ever be anything else than a variable - |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3687 using some other form will lead to serious barfage." |
17493 | 3688 (or (symbolp thread) (signal 'wrong-type-argument '(symbolp thread))) |
3689 ;; (8% speedup to gnus-summary-prepare, just for fun :-) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3690 (list 'byte-code "\10\211:\203\17\0\211@;\203\16\0A@@\207" |
17493 | 3691 (vector thread) 2)) |
3692 | |
3693 (defsubst gnus-article-sort-by-number (h1 h2) | |
3694 "Sort articles by article number." | |
3695 (< (mail-header-number h1) | |
3696 (mail-header-number h2))) | |
3697 | |
3698 (defun gnus-thread-sort-by-number (h1 h2) | |
3699 "Sort threads by root article number." | |
3700 (gnus-article-sort-by-number | |
3701 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3702 | |
3703 (defsubst gnus-article-sort-by-lines (h1 h2) | |
3704 "Sort articles by article Lines header." | |
3705 (< (mail-header-lines h1) | |
3706 (mail-header-lines h2))) | |
3707 | |
3708 (defun gnus-thread-sort-by-lines (h1 h2) | |
3709 "Sort threads by root article Lines header." | |
3710 (gnus-article-sort-by-lines | |
3711 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3712 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3713 (defsubst gnus-article-sort-by-chars (h1 h2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3714 "Sort articles by octet length." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3715 (< (mail-header-chars h1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3716 (mail-header-chars h2))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3717 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3718 (defun gnus-thread-sort-by-chars (h1 h2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3719 "Sort threads by root article octet length." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3720 (gnus-article-sort-by-chars |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3721 (gnus-thread-header h1) (gnus-thread-header h2))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3722 |
17493 | 3723 (defsubst gnus-article-sort-by-author (h1 h2) |
3724 "Sort articles by root author." | |
3725 (string-lessp | |
3726 (let ((extract (funcall | |
3727 gnus-extract-address-components | |
3728 (mail-header-from h1)))) | |
3729 (or (car extract) (cadr extract) "")) | |
3730 (let ((extract (funcall | |
3731 gnus-extract-address-components | |
3732 (mail-header-from h2)))) | |
3733 (or (car extract) (cadr extract) "")))) | |
3734 | |
3735 (defun gnus-thread-sort-by-author (h1 h2) | |
3736 "Sort threads by root author." | |
3737 (gnus-article-sort-by-author | |
3738 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3739 | |
3740 (defsubst gnus-article-sort-by-subject (h1 h2) | |
3741 "Sort articles by root subject." | |
3742 (string-lessp | |
3743 (downcase (gnus-simplify-subject-re (mail-header-subject h1))) | |
3744 (downcase (gnus-simplify-subject-re (mail-header-subject h2))))) | |
3745 | |
3746 (defun gnus-thread-sort-by-subject (h1 h2) | |
3747 "Sort threads by root subject." | |
3748 (gnus-article-sort-by-subject | |
3749 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3750 | |
3751 (defsubst gnus-article-sort-by-date (h1 h2) | |
3752 "Sort articles by root article date." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3753 (time-less-p |
17493 | 3754 (gnus-date-get-time (mail-header-date h1)) |
3755 (gnus-date-get-time (mail-header-date h2)))) | |
3756 | |
3757 (defun gnus-thread-sort-by-date (h1 h2) | |
3758 "Sort threads by root article date." | |
3759 (gnus-article-sort-by-date | |
3760 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3761 | |
3762 (defsubst gnus-article-sort-by-score (h1 h2) | |
3763 "Sort articles by root article score. | |
3764 Unscored articles will be counted as having a score of zero." | |
3765 (> (or (cdr (assq (mail-header-number h1) | |
3766 gnus-newsgroup-scored)) | |
3767 gnus-summary-default-score 0) | |
3768 (or (cdr (assq (mail-header-number h2) | |
3769 gnus-newsgroup-scored)) | |
3770 gnus-summary-default-score 0))) | |
3771 | |
3772 (defun gnus-thread-sort-by-score (h1 h2) | |
3773 "Sort threads by root article score." | |
3774 (gnus-article-sort-by-score | |
3775 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3776 | |
3777 (defun gnus-thread-sort-by-total-score (h1 h2) | |
3778 "Sort threads by the sum of all scores in the thread. | |
3779 Unscored articles will be counted as having a score of zero." | |
3780 (> (gnus-thread-total-score h1) (gnus-thread-total-score h2))) | |
3781 | |
3782 (defun gnus-thread-total-score (thread) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3783 ;; This function find the total score of THREAD. |
17493 | 3784 (cond ((null thread) |
3785 0) | |
3786 ((consp thread) | |
3787 (if (stringp (car thread)) | |
3788 (apply gnus-thread-score-function 0 | |
3789 (mapcar 'gnus-thread-total-score-1 (cdr thread))) | |
3790 (gnus-thread-total-score-1 thread))) | |
3791 (t | |
3792 (gnus-thread-total-score-1 (list thread))))) | |
3793 | |
3794 (defun gnus-thread-total-score-1 (root) | |
3795 ;; This function find the total score of the thread below ROOT. | |
3796 (setq root (car root)) | |
3797 (apply gnus-thread-score-function | |
3798 (or (append | |
3799 (mapcar 'gnus-thread-total-score | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3800 (cdr (gnus-id-to-thread (mail-header-id root)))) |
17493 | 3801 (when (> (mail-header-number root) 0) |
3802 (list (or (cdr (assq (mail-header-number root) | |
3803 gnus-newsgroup-scored)) | |
3804 gnus-summary-default-score 0)))) | |
3805 (list gnus-summary-default-score) | |
3806 '(0)))) | |
3807 | |
3808 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>. | |
3809 (defvar gnus-tmp-prev-subject nil) | |
3810 (defvar gnus-tmp-false-parent nil) | |
3811 (defvar gnus-tmp-root-expunged nil) | |
3812 (defvar gnus-tmp-dummy-line nil) | |
3813 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3814 (defvar gnus-tmp-header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3815 (defun gnus-extra-header (type &optional header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3816 "Return the extra header of TYPE." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3817 (or (cdr (assq type (mail-header-extra (or header gnus-tmp-header)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3818 "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3819 |
17493 | 3820 (defun gnus-summary-prepare-threads (threads) |
3821 "Prepare summary buffer from THREADS and indentation LEVEL. | |
3822 THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])' | |
3823 or a straight list of headers." | |
3824 (gnus-message 7 "Generating summary...") | |
3825 | |
3826 (setq gnus-newsgroup-threads threads) | |
3827 (beginning-of-line) | |
3828 | |
3829 (let ((gnus-tmp-level 0) | |
3830 (default-score (or gnus-summary-default-score 0)) | |
3831 (gnus-visual-p (gnus-visual-p 'summary-highlight 'highlight)) | |
3832 thread number subject stack state gnus-tmp-gathered beg-match | |
3833 new-roots gnus-tmp-new-adopts thread-end | |
3834 gnus-tmp-header gnus-tmp-unread | |
3835 gnus-tmp-replied gnus-tmp-subject-or-nil | |
3836 gnus-tmp-dummy gnus-tmp-indentation gnus-tmp-lines gnus-tmp-score | |
3837 gnus-tmp-score-char gnus-tmp-from gnus-tmp-name | |
3838 gnus-tmp-number gnus-tmp-opening-bracket gnus-tmp-closing-bracket) | |
3839 | |
3840 (setq gnus-tmp-prev-subject nil) | |
3841 | |
3842 (if (vectorp (car threads)) | |
3843 ;; If this is a straight (sic) list of headers, then a | |
3844 ;; threaded summary display isn't required, so we just create | |
3845 ;; an unthreaded one. | |
3846 (gnus-summary-prepare-unthreaded threads) | |
3847 | |
3848 ;; Do the threaded display. | |
3849 | |
3850 (while (or threads stack gnus-tmp-new-adopts new-roots) | |
3851 | |
3852 (if (and (= gnus-tmp-level 0) | |
3853 (or (not stack) | |
3854 (= (caar stack) 0)) | |
3855 (not gnus-tmp-false-parent) | |
3856 (or gnus-tmp-new-adopts new-roots)) | |
3857 (if gnus-tmp-new-adopts | |
3858 (setq gnus-tmp-level (if gnus-tmp-root-expunged 0 1) | |
3859 thread (list (car gnus-tmp-new-adopts)) | |
3860 gnus-tmp-header (caar thread) | |
3861 gnus-tmp-new-adopts (cdr gnus-tmp-new-adopts)) | |
3862 (when new-roots | |
3863 (setq thread (list (car new-roots)) | |
3864 gnus-tmp-header (caar thread) | |
3865 new-roots (cdr new-roots)))) | |
3866 | |
3867 (if threads | |
3868 ;; If there are some threads, we do them before the | |
3869 ;; threads on the stack. | |
3870 (setq thread threads | |
3871 gnus-tmp-header (caar thread)) | |
3872 ;; There were no current threads, so we pop something off | |
3873 ;; the stack. | |
3874 (setq state (car stack) | |
3875 gnus-tmp-level (car state) | |
3876 thread (cdr state) | |
3877 stack (cdr stack) | |
3878 gnus-tmp-header (caar thread)))) | |
3879 | |
3880 (setq gnus-tmp-false-parent nil) | |
3881 (setq gnus-tmp-root-expunged nil) | |
3882 (setq thread-end nil) | |
3883 | |
3884 (if (stringp gnus-tmp-header) | |
3885 ;; The header is a dummy root. | |
3886 (cond | |
3887 ((eq gnus-summary-make-false-root 'adopt) | |
3888 ;; We let the first article adopt the rest. | |
3889 (setq gnus-tmp-new-adopts (nconc gnus-tmp-new-adopts | |
3890 (cddar thread))) | |
3891 (setq gnus-tmp-gathered | |
3892 (nconc (mapcar | |
3893 (lambda (h) (mail-header-number (car h))) | |
3894 (cddar thread)) | |
3895 gnus-tmp-gathered)) | |
3896 (setq thread (cons (list (caar thread) | |
3897 (cadar thread)) | |
3898 (cdr thread))) | |
3899 (setq gnus-tmp-level -1 | |
3900 gnus-tmp-false-parent t)) | |
3901 ((eq gnus-summary-make-false-root 'empty) | |
3902 ;; We print adopted articles with empty subject fields. | |
3903 (setq gnus-tmp-gathered | |
3904 (nconc (mapcar | |
3905 (lambda (h) (mail-header-number (car h))) | |
3906 (cddar thread)) | |
3907 gnus-tmp-gathered)) | |
3908 (setq gnus-tmp-level -1)) | |
3909 ((eq gnus-summary-make-false-root 'dummy) | |
3910 ;; We remember that we probably want to output a dummy | |
3911 ;; root. | |
3912 (setq gnus-tmp-dummy-line gnus-tmp-header) | |
3913 (setq gnus-tmp-prev-subject gnus-tmp-header)) | |
3914 (t | |
3915 ;; We do not make a root for the gathered | |
3916 ;; sub-threads at all. | |
3917 (setq gnus-tmp-level -1))) | |
3918 | |
3919 (setq number (mail-header-number gnus-tmp-header) | |
3920 subject (mail-header-subject gnus-tmp-header)) | |
3921 | |
3922 (cond | |
3923 ;; If the thread has changed subject, we might want to make | |
3924 ;; this subthread into a root. | |
3925 ((and (null gnus-thread-ignore-subject) | |
3926 (not (zerop gnus-tmp-level)) | |
3927 gnus-tmp-prev-subject | |
3928 (not (inline | |
3929 (gnus-subject-equal gnus-tmp-prev-subject subject)))) | |
3930 (setq new-roots (nconc new-roots (list (car thread))) | |
3931 thread-end t | |
3932 gnus-tmp-header nil)) | |
3933 ;; If the article lies outside the current limit, | |
3934 ;; then we do not display it. | |
3935 ((not (memq number gnus-newsgroup-limit)) | |
3936 (setq gnus-tmp-gathered | |
3937 (nconc (mapcar | |
3938 (lambda (h) (mail-header-number (car h))) | |
3939 (cdar thread)) | |
3940 gnus-tmp-gathered)) | |
3941 (setq gnus-tmp-new-adopts (if (cdar thread) | |
3942 (append gnus-tmp-new-adopts | |
3943 (cdar thread)) | |
3944 gnus-tmp-new-adopts) | |
3945 thread-end t | |
3946 gnus-tmp-header nil) | |
3947 (when (zerop gnus-tmp-level) | |
3948 (setq gnus-tmp-root-expunged t))) | |
3949 ;; Perhaps this article is to be marked as read? | |
3950 ((and gnus-summary-mark-below | |
3951 (< (or (cdr (assq number gnus-newsgroup-scored)) | |
3952 default-score) | |
3953 gnus-summary-mark-below) | |
3954 ;; Don't touch sparse articles. | |
3955 (not (gnus-summary-article-sparse-p number)) | |
3956 (not (gnus-summary-article-ancient-p number))) | |
3957 (setq gnus-newsgroup-unreads | |
3958 (delq number gnus-newsgroup-unreads)) | |
3959 (if gnus-newsgroup-auto-expire | |
3960 (push number gnus-newsgroup-expirable) | |
3961 (push (cons number gnus-low-score-mark) | |
3962 gnus-newsgroup-reads)))) | |
3963 | |
3964 (when gnus-tmp-header | |
3965 ;; We may have an old dummy line to output before this | |
3966 ;; article. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3967 (when (and gnus-tmp-dummy-line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3968 (gnus-subject-equal |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3969 gnus-tmp-dummy-line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3970 (mail-header-subject gnus-tmp-header))) |
17493 | 3971 (gnus-summary-insert-dummy-line |
3972 gnus-tmp-dummy-line (mail-header-number gnus-tmp-header)) | |
3973 (setq gnus-tmp-dummy-line nil)) | |
3974 | |
3975 ;; Compute the mark. | |
3976 (setq gnus-tmp-unread (gnus-article-mark number)) | |
3977 | |
3978 (push (gnus-data-make number gnus-tmp-unread (1+ (point)) | |
3979 gnus-tmp-header gnus-tmp-level) | |
3980 gnus-newsgroup-data) | |
3981 | |
3982 ;; Actually insert the line. | |
3983 (setq | |
3984 gnus-tmp-subject-or-nil | |
3985 (cond | |
3986 ((and gnus-thread-ignore-subject | |
3987 gnus-tmp-prev-subject | |
3988 (not (inline (gnus-subject-equal | |
3989 gnus-tmp-prev-subject subject)))) | |
3990 subject) | |
3991 ((zerop gnus-tmp-level) | |
3992 (if (and (eq gnus-summary-make-false-root 'empty) | |
3993 (memq number gnus-tmp-gathered) | |
3994 gnus-tmp-prev-subject | |
3995 (inline (gnus-subject-equal | |
3996 gnus-tmp-prev-subject subject))) | |
3997 gnus-summary-same-subject | |
3998 subject)) | |
3999 (t gnus-summary-same-subject))) | |
4000 (if (and (eq gnus-summary-make-false-root 'adopt) | |
4001 (= gnus-tmp-level 1) | |
4002 (memq number gnus-tmp-gathered)) | |
4003 (setq gnus-tmp-opening-bracket ?\< | |
4004 gnus-tmp-closing-bracket ?\>) | |
4005 (setq gnus-tmp-opening-bracket ?\[ | |
4006 gnus-tmp-closing-bracket ?\])) | |
4007 (setq | |
4008 gnus-tmp-indentation | |
4009 (aref gnus-thread-indent-array gnus-tmp-level) | |
4010 gnus-tmp-lines (mail-header-lines gnus-tmp-header) | |
4011 gnus-tmp-score (or (cdr (assq number gnus-newsgroup-scored)) | |
4012 gnus-summary-default-score 0) | |
4013 gnus-tmp-score-char | |
4014 (if (or (null gnus-summary-default-score) | |
4015 (<= (abs (- gnus-tmp-score gnus-summary-default-score)) | |
4016 gnus-summary-zcore-fuzz)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4017 ? ;Whitespace |
17493 | 4018 (if (< gnus-tmp-score gnus-summary-default-score) |
4019 gnus-score-below-mark gnus-score-over-mark)) | |
4020 gnus-tmp-replied | |
4021 (cond ((memq number gnus-newsgroup-processable) | |
4022 gnus-process-mark) | |
4023 ((memq number gnus-newsgroup-cached) | |
4024 gnus-cached-mark) | |
4025 ((memq number gnus-newsgroup-replied) | |
4026 gnus-replied-mark) | |
4027 ((memq number gnus-newsgroup-saved) | |
4028 gnus-saved-mark) | |
4029 (t gnus-unread-mark)) | |
4030 gnus-tmp-from (mail-header-from gnus-tmp-header) | |
4031 gnus-tmp-name | |
4032 (cond | |
4033 ((string-match "<[^>]+> *$" gnus-tmp-from) | |
4034 (setq beg-match (match-beginning 0)) | |
4035 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from) | |
4036 (substring gnus-tmp-from (1+ (match-beginning 0)) | |
4037 (1- (match-end 0)))) | |
4038 (substring gnus-tmp-from 0 beg-match))) | |
4039 ((string-match "(.+)" gnus-tmp-from) | |
4040 (substring gnus-tmp-from | |
4041 (1+ (match-beginning 0)) (1- (match-end 0)))) | |
4042 (t gnus-tmp-from))) | |
4043 (when (string= gnus-tmp-name "") | |
4044 (setq gnus-tmp-name gnus-tmp-from)) | |
4045 (unless (numberp gnus-tmp-lines) | |
4046 (setq gnus-tmp-lines 0)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4047 (gnus-put-text-property |
17493 | 4048 (point) |
4049 (progn (eval gnus-summary-line-format-spec) (point)) | |
4050 'gnus-number number) | |
4051 (when gnus-visual-p | |
4052 (forward-line -1) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4053 (gnus-run-hooks 'gnus-summary-update-hook) |
17493 | 4054 (forward-line 1)) |
4055 | |
4056 (setq gnus-tmp-prev-subject subject))) | |
4057 | |
4058 (when (nth 1 thread) | |
4059 (push (cons (max 0 gnus-tmp-level) (nthcdr 1 thread)) stack)) | |
4060 (incf gnus-tmp-level) | |
4061 (setq threads (if thread-end nil (cdar thread))) | |
4062 (unless threads | |
4063 (setq gnus-tmp-level 0))))) | |
4064 (gnus-message 7 "Generating summary...done")) | |
4065 | |
4066 (defun gnus-summary-prepare-unthreaded (headers) | |
4067 "Generate an unthreaded summary buffer based on HEADERS." | |
4068 (let (header number mark) | |
4069 | |
4070 (beginning-of-line) | |
4071 | |
4072 (while headers | |
4073 ;; We may have to root out some bad articles... | |
4074 (when (memq (setq number (mail-header-number | |
4075 (setq header (pop headers)))) | |
4076 gnus-newsgroup-limit) | |
4077 ;; Mark article as read when it has a low score. | |
4078 (when (and gnus-summary-mark-below | |
4079 (< (or (cdr (assq number gnus-newsgroup-scored)) | |
4080 gnus-summary-default-score 0) | |
4081 gnus-summary-mark-below) | |
4082 (not (gnus-summary-article-ancient-p number))) | |
4083 (setq gnus-newsgroup-unreads | |
4084 (delq number gnus-newsgroup-unreads)) | |
4085 (if gnus-newsgroup-auto-expire | |
4086 (push number gnus-newsgroup-expirable) | |
4087 (push (cons number gnus-low-score-mark) | |
4088 gnus-newsgroup-reads))) | |
4089 | |
4090 (setq mark (gnus-article-mark number)) | |
4091 (push (gnus-data-make number mark (1+ (point)) header 0) | |
4092 gnus-newsgroup-data) | |
4093 (gnus-summary-insert-line | |
4094 header 0 number | |
4095 mark (memq number gnus-newsgroup-replied) | |
4096 (memq number gnus-newsgroup-expirable) | |
4097 (mail-header-subject header) nil | |
4098 (cdr (assq number gnus-newsgroup-scored)) | |
4099 (memq number gnus-newsgroup-processable)))))) | |
4100 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4101 (defun gnus-summary-remove-list-identifiers () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4102 "Remove list identifiers in `gnus-list-identifiers' from articles in the current group." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4103 (let ((regexp (if (stringp gnus-list-identifiers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4104 gnus-list-identifiers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4105 (mapconcat 'identity gnus-list-identifiers " *\\|")))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4106 (dolist (header gnus-newsgroup-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4107 (when (string-match (concat "\\(\\(\\(Re: +\\)?\\(" regexp |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4108 " *\\)\\)+\\(Re: +\\)?\\)") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4109 (mail-header-subject header)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4110 (mail-header-set-subject |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4111 header (concat (substring (mail-header-subject header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4112 0 (match-beginning 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4113 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4114 (match-string 3 (mail-header-subject header)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4115 (match-string 5 (mail-header-subject header))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4116 (substring (mail-header-subject header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4117 (match-end 1)))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4118 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4119 (defun gnus-select-newsgroup (group &optional read-all select-articles) |
17493 | 4120 "Select newsgroup GROUP. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4121 If READ-ALL is non-nil, all articles in the group are selected. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4122 If SELECT-ARTICLES, only select those articles from GROUP." |
17493 | 4123 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb)) |
4124 ;;!!! Dirty hack; should be removed. | |
4125 (gnus-summary-ignore-duplicates | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4126 (if (eq (car (gnus-find-method-for-group group)) 'nnvirtual) |
17493 | 4127 t |
4128 gnus-summary-ignore-duplicates)) | |
4129 (info (nth 2 entry)) | |
4130 articles fetched-articles cached) | |
4131 | |
4132 (unless (gnus-check-server | |
4133 (setq gnus-current-select-method | |
4134 (gnus-find-method-for-group group))) | |
4135 (error "Couldn't open server")) | |
4136 | |
4137 (or (and entry (not (eq (car entry) t))) ; Either it's active... | |
4138 (gnus-activate-group group) ; Or we can activate it... | |
4139 (progn ; Or we bug out. | |
4140 (when (equal major-mode 'gnus-summary-mode) | |
4141 (kill-buffer (current-buffer))) | |
4142 (error "Couldn't request group %s: %s" | |
4143 group (gnus-status-message group)))) | |
4144 | |
4145 (unless (gnus-request-group group t) | |
4146 (when (equal major-mode 'gnus-summary-mode) | |
4147 (kill-buffer (current-buffer))) | |
4148 (error "Couldn't request group %s: %s" | |
4149 group (gnus-status-message group))) | |
4150 | |
4151 (setq gnus-newsgroup-name group) | |
4152 (setq gnus-newsgroup-unselected nil) | |
4153 (setq gnus-newsgroup-unreads (gnus-list-of-unread-articles group)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4154 (gnus-summary-setup-default-charset) |
17493 | 4155 |
4156 ;; Adjust and set lists of article marks. | |
4157 (when info | |
4158 (gnus-adjust-marked-articles info)) | |
4159 | |
4160 ;; Kludge to avoid having cached articles nixed out in virtual groups. | |
4161 (when (gnus-virtual-group-p group) | |
4162 (setq cached gnus-newsgroup-cached)) | |
4163 | |
4164 (setq gnus-newsgroup-unreads | |
4165 (gnus-set-difference | |
4166 (gnus-set-difference gnus-newsgroup-unreads gnus-newsgroup-marked) | |
4167 gnus-newsgroup-dormant)) | |
4168 | |
4169 (setq gnus-newsgroup-processable nil) | |
4170 | |
4171 (gnus-update-read-articles group gnus-newsgroup-unreads) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4172 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4173 (if (setq articles select-articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4174 (setq gnus-newsgroup-unselected |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4175 (gnus-sorted-intersection |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4176 gnus-newsgroup-unreads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4177 (gnus-sorted-complement gnus-newsgroup-unreads articles))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4178 (setq articles (gnus-articles-to-read group read-all))) |
17493 | 4179 |
4180 (cond | |
4181 ((null articles) | |
4182 ;;(gnus-message 3 "Couldn't select newsgroup -- no articles to display") | |
4183 'quit) | |
4184 ((eq articles 0) nil) | |
4185 (t | |
4186 ;; Init the dependencies hash table. | |
4187 (setq gnus-newsgroup-dependencies | |
4188 (gnus-make-hashtable (length articles))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4189 (gnus-set-global-variables) |
17493 | 4190 ;; Retrieve the headers and read them in. |
4191 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name) | |
4192 (setq gnus-newsgroup-headers | |
4193 (if (eq 'nov | |
4194 (setq gnus-headers-retrieved-by | |
4195 (gnus-retrieve-headers | |
4196 articles gnus-newsgroup-name | |
4197 ;; We might want to fetch old headers, but | |
4198 ;; not if there is only 1 article. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4199 (and (or (and |
17493 | 4200 (not (eq gnus-fetch-old-headers 'some)) |
4201 (not (numberp gnus-fetch-old-headers))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4202 (> (length articles) 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4203 gnus-fetch-old-headers)))) |
17493 | 4204 (gnus-get-newsgroup-headers-xover |
4205 articles nil nil gnus-newsgroup-name t) | |
4206 (gnus-get-newsgroup-headers))) | |
4207 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name) | |
4208 | |
4209 ;; Kludge to avoid having cached articles nixed out in virtual groups. | |
4210 (when cached | |
4211 (setq gnus-newsgroup-cached cached)) | |
4212 | |
4213 ;; Suppress duplicates? | |
4214 (when gnus-suppress-duplicates | |
4215 (gnus-dup-suppress-articles)) | |
4216 | |
4217 ;; Set the initial limit. | |
4218 (setq gnus-newsgroup-limit (copy-sequence articles)) | |
4219 ;; Remove canceled articles from the list of unread articles. | |
4220 (setq gnus-newsgroup-unreads | |
4221 (gnus-set-sorted-intersection | |
4222 gnus-newsgroup-unreads | |
4223 (setq fetched-articles | |
4224 (mapcar (lambda (headers) (mail-header-number headers)) | |
4225 gnus-newsgroup-headers)))) | |
4226 ;; Removed marked articles that do not exist. | |
4227 (gnus-update-missing-marks | |
4228 (gnus-sorted-complement fetched-articles articles)) | |
4229 ;; We might want to build some more threads first. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4230 (when (and gnus-fetch-old-headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4231 (eq gnus-headers-retrieved-by 'nov)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4232 (if (eq gnus-fetch-old-headers 'invisible) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4233 (gnus-build-all-threads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4234 (gnus-build-old-threads))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4235 ;; Let the Gnus agent mark articles as read. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4236 (when gnus-agent |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4237 (gnus-agent-get-undownloaded-list)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4238 ;; Remove list identifiers from subject |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4239 (when gnus-list-identifiers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4240 (gnus-summary-remove-list-identifiers)) |
17493 | 4241 ;; Check whether auto-expire is to be done in this group. |
4242 (setq gnus-newsgroup-auto-expire | |
4243 (gnus-group-auto-expirable-p group)) | |
4244 ;; Set up the article buffer now, if necessary. | |
4245 (unless gnus-single-article-buffer | |
4246 (gnus-article-setup-buffer)) | |
4247 ;; First and last article in this newsgroup. | |
4248 (when gnus-newsgroup-headers | |
4249 (setq gnus-newsgroup-begin | |
4250 (mail-header-number (car gnus-newsgroup-headers)) | |
4251 gnus-newsgroup-end | |
4252 (mail-header-number | |
4253 (gnus-last-element gnus-newsgroup-headers)))) | |
4254 ;; GROUP is successfully selected. | |
4255 (or gnus-newsgroup-headers t))))) | |
4256 | |
4257 (defun gnus-articles-to-read (group &optional read-all) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4258 "Find out what articles the user wants to read." |
17493 | 4259 (let* ((articles |
4260 ;; Select all articles if `read-all' is non-nil, or if there | |
4261 ;; are no unread articles. | |
4262 (if (or read-all | |
4263 (and (zerop (length gnus-newsgroup-marked)) | |
4264 (zerop (length gnus-newsgroup-unreads))) | |
4265 (eq (gnus-group-find-parameter group 'display) | |
4266 'all)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4267 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4268 (gnus-uncompress-range (gnus-active group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4269 (gnus-cache-articles-in-group group)) |
17493 | 4270 (sort (append gnus-newsgroup-dormant gnus-newsgroup-marked |
4271 (copy-sequence gnus-newsgroup-unreads)) | |
4272 '<))) | |
4273 (scored-list (gnus-killed-articles gnus-newsgroup-killed articles)) | |
4274 (scored (length scored-list)) | |
4275 (number (length articles)) | |
4276 (marked (+ (length gnus-newsgroup-marked) | |
4277 (length gnus-newsgroup-dormant))) | |
4278 (select | |
4279 (cond | |
4280 ((numberp read-all) | |
4281 read-all) | |
4282 (t | |
4283 (condition-case () | |
4284 (cond | |
4285 ((and (or (<= scored marked) (= scored number)) | |
4286 (numberp gnus-large-newsgroup) | |
4287 (> number gnus-large-newsgroup)) | |
4288 (let ((input | |
4289 (read-string | |
4290 (format | |
4291 "How many articles from %s (default %d): " | |
4292 (gnus-limit-string gnus-newsgroup-name 35) | |
4293 number)))) | |
4294 (if (string-match "^[ \t]*$" input) number input))) | |
4295 ((and (> scored marked) (< scored number) | |
4296 (> (- scored number) 20)) | |
4297 (let ((input | |
4298 (read-string | |
4299 (format "%s %s (%d scored, %d total): " | |
4300 "How many articles from" | |
4301 group scored number)))) | |
4302 (if (string-match "^[ \t]*$" input) | |
4303 number input))) | |
4304 (t number)) | |
4305 (quit nil)))))) | |
4306 (setq select (if (stringp select) (string-to-number select) select)) | |
4307 (if (or (null select) (zerop select)) | |
4308 select | |
4309 (if (and (not (zerop scored)) (<= (abs select) scored)) | |
4310 (progn | |
4311 (setq articles (sort scored-list '<)) | |
4312 (setq number (length articles))) | |
4313 (setq articles (copy-sequence articles))) | |
4314 | |
4315 (when (< (abs select) number) | |
4316 (if (< select 0) | |
4317 ;; Select the N oldest articles. | |
4318 (setcdr (nthcdr (1- (abs select)) articles) nil) | |
4319 ;; Select the N most recent articles. | |
4320 (setq articles (nthcdr (- number select) articles)))) | |
4321 (setq gnus-newsgroup-unselected | |
4322 (gnus-sorted-intersection | |
4323 gnus-newsgroup-unreads | |
4324 (gnus-sorted-complement gnus-newsgroup-unreads articles))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4325 (when gnus-alter-articles-to-read-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4326 (setq gnus-newsgroup-unreads |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4327 (sort |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4328 (funcall gnus-alter-articles-to-read-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4329 gnus-newsgroup-name gnus-newsgroup-unreads) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4330 '<))) |
17493 | 4331 articles))) |
4332 | |
4333 (defun gnus-killed-articles (killed articles) | |
4334 (let (out) | |
4335 (while articles | |
4336 (when (inline (gnus-member-of-range (car articles) killed)) | |
4337 (push (car articles) out)) | |
4338 (setq articles (cdr articles))) | |
4339 out)) | |
4340 | |
4341 (defun gnus-uncompress-marks (marks) | |
4342 "Uncompress the mark ranges in MARKS." | |
4343 (let ((uncompressed '(score bookmark)) | |
4344 out) | |
4345 (while marks | |
4346 (if (memq (caar marks) uncompressed) | |
4347 (push (car marks) out) | |
4348 (push (cons (caar marks) (gnus-uncompress-range (cdar marks))) out)) | |
4349 (setq marks (cdr marks))) | |
4350 out)) | |
4351 | |
4352 (defun gnus-adjust-marked-articles (info) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4353 "Set all article lists and remove all marks that are no longer valid." |
17493 | 4354 (let* ((marked-lists (gnus-info-marks info)) |
4355 (active (gnus-active (gnus-info-group info))) | |
4356 (min (car active)) | |
4357 (max (cdr active)) | |
4358 (types gnus-article-mark-lists) | |
4359 (uncompressed '(score bookmark killed)) | |
4360 marks var articles article mark) | |
4361 | |
4362 (while marked-lists | |
4363 (setq marks (pop marked-lists)) | |
4364 (set (setq var (intern (format "gnus-newsgroup-%s" | |
4365 (car (rassq (setq mark (car marks)) | |
4366 types))))) | |
4367 (if (memq (car marks) uncompressed) (cdr marks) | |
4368 (gnus-uncompress-range (cdr marks)))) | |
4369 | |
4370 (setq articles (symbol-value var)) | |
4371 | |
4372 ;; All articles have to be subsets of the active articles. | |
4373 (cond | |
4374 ;; Adjust "simple" lists. | |
4375 ((memq mark '(tick dormant expire reply save)) | |
4376 (while articles | |
4377 (when (or (< (setq article (pop articles)) min) (> article max)) | |
4378 (set var (delq article (symbol-value var)))))) | |
4379 ;; Adjust assocs. | |
4380 ((memq mark uncompressed) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4381 (when (not (listp (cdr (symbol-value var)))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4382 (set var (list (symbol-value var)))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4383 (when (not (listp (cdr articles))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4384 (setq articles (list articles))) |
17493 | 4385 (while articles |
4386 (when (or (not (consp (setq article (pop articles)))) | |
4387 (< (car article) min) | |
4388 (> (car article) max)) | |
4389 (set var (delq article (symbol-value var)))))))))) | |
4390 | |
4391 (defun gnus-update-missing-marks (missing) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4392 "Go through the list of MISSING articles and remove them from the mark lists." |
17493 | 4393 (when missing |
4394 (let ((types gnus-article-mark-lists) | |
4395 var m) | |
4396 ;; Go through all types. | |
4397 (while types | |
4398 (setq var (intern (format "gnus-newsgroup-%s" (car (pop types))))) | |
4399 (when (symbol-value var) | |
4400 ;; This list has articles. So we delete all missing articles | |
4401 ;; from it. | |
4402 (setq m missing) | |
4403 (while m | |
4404 (set var (delq (pop m) (symbol-value var))))))))) | |
4405 | |
4406 (defun gnus-update-marks () | |
4407 "Enter the various lists of marked articles into the newsgroup info list." | |
4408 (let ((types gnus-article-mark-lists) | |
4409 (info (gnus-get-info gnus-newsgroup-name)) | |
4410 (uncompressed '(score bookmark killed)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4411 type list newmarked symbol delta-marks) |
17493 | 4412 (when info |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4413 ;; Add all marks lists to the list of marks lists. |
17493 | 4414 (while (setq type (pop types)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4415 (setq list (symbol-value |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4416 (setq symbol |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4417 (intern (format "gnus-newsgroup-%s" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4418 (car type)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4419 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4420 (when list |
17493 | 4421 ;; Get rid of the entries of the articles that have the |
4422 ;; default score. | |
4423 (when (and (eq (cdr type) 'score) | |
4424 gnus-save-score | |
4425 list) | |
4426 (let* ((arts list) | |
4427 (prev (cons nil list)) | |
4428 (all prev)) | |
4429 (while arts | |
4430 (if (or (not (consp (car arts))) | |
4431 (= (cdar arts) gnus-summary-default-score)) | |
4432 (setcdr prev (cdr arts)) | |
4433 (setq prev arts)) | |
4434 (setq arts (cdr arts))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4435 (setq list (cdr all))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4436 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4437 (unless (memq (cdr type) uncompressed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4438 (setq list (gnus-compress-sequence (set symbol (sort list '<)) t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4439 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4440 (when (gnus-check-backend-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4441 'request-set-mark gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4442 ;; propagate flags to server, with the following exceptions: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4443 ;; uncompressed:s are not proper flags (they are cons cells) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4444 ;; cache is a internal gnus flag |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4445 ;; download are local to one gnus installation (well) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4446 ;; unsend are for nndraft groups only |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4447 ;; xxx: generality of this? this suits nnimap anyway |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4448 (unless (memq (cdr type) (append '(cache download unsend) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4449 uncompressed)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4450 (let* ((old (cdr (assq (cdr type) (gnus-info-marks info)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4451 (del (gnus-remove-from-range (gnus-copy-sequence old) list)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4452 (add (gnus-remove-from-range |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4453 (gnus-copy-sequence list) old))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4454 (when add |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4455 (push (list add 'add (list (cdr type))) delta-marks)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4456 (when del |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4457 (push (list del 'del (list (cdr type))) delta-marks))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4458 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4459 (when list |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4460 (push (cons (cdr type) list) newmarked))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4461 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4462 (when delta-marks |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4463 (unless (gnus-check-group gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4464 (error "Can't open server for %s" gnus-newsgroup-name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4465 (gnus-request-set-mark gnus-newsgroup-name delta-marks)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4466 |
17493 | 4467 ;; Enter these new marks into the info of the group. |
4468 (if (nthcdr 3 info) | |
4469 (setcar (nthcdr 3 info) newmarked) | |
4470 ;; Add the marks lists to the end of the info. | |
4471 (when newmarked | |
4472 (setcdr (nthcdr 2 info) (list newmarked)))) | |
4473 | |
4474 ;; Cut off the end of the info if there's nothing else there. | |
4475 (let ((i 5)) | |
4476 (while (and (> i 2) | |
4477 (not (nth i info))) | |
4478 (when (nthcdr (decf i) info) | |
4479 (setcdr (nthcdr i info) nil))))))) | |
4480 | |
4481 (defun gnus-set-mode-line (where) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4482 "Set the mode line of the article or summary buffers. |
17493 | 4483 If WHERE is `summary', the summary mode line format will be used." |
4484 ;; Is this mode line one we keep updated? | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4485 (when (and (memq where gnus-updated-mode-lines) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4486 (symbol-value |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4487 (intern (format "gnus-%s-mode-line-format-spec" where)))) |
17493 | 4488 (let (mode-string) |
4489 (save-excursion | |
4490 ;; We evaluate this in the summary buffer since these | |
4491 ;; variables are buffer-local to that buffer. | |
4492 (set-buffer gnus-summary-buffer) | |
4493 ;; We bind all these variables that are used in the `eval' form | |
4494 ;; below. | |
4495 (let* ((mformat (symbol-value | |
4496 (intern | |
4497 (format "gnus-%s-mode-line-format-spec" where)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4498 (gnus-tmp-group-name (gnus-group-name-decode |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4499 gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4500 (gnus-group-name-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4501 nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4502 gnus-newsgroup-name))) |
17493 | 4503 (gnus-tmp-article-number (or gnus-current-article 0)) |
4504 (gnus-tmp-unread gnus-newsgroup-unreads) | |
4505 (gnus-tmp-unread-and-unticked (length gnus-newsgroup-unreads)) | |
4506 (gnus-tmp-unselected (length gnus-newsgroup-unselected)) | |
4507 (gnus-tmp-unread-and-unselected | |
4508 (cond ((and (zerop gnus-tmp-unread-and-unticked) | |
4509 (zerop gnus-tmp-unselected)) | |
4510 "") | |
4511 ((zerop gnus-tmp-unselected) | |
4512 (format "{%d more}" gnus-tmp-unread-and-unticked)) | |
4513 (t (format "{%d(+%d) more}" | |
4514 gnus-tmp-unread-and-unticked | |
4515 gnus-tmp-unselected)))) | |
4516 (gnus-tmp-subject | |
4517 (if (and gnus-current-headers | |
4518 (vectorp gnus-current-headers)) | |
4519 (gnus-mode-string-quote | |
4520 (mail-header-subject gnus-current-headers)) | |
4521 "")) | |
4522 bufname-length max-len | |
4523 gnus-tmp-header);; passed as argument to any user-format-funcs | |
4524 (setq mode-string (eval mformat)) | |
4525 (setq bufname-length (if (string-match "%b" mode-string) | |
4526 (- (length | |
4527 (buffer-name | |
4528 (if (eq where 'summary) | |
4529 nil | |
4530 (get-buffer gnus-article-buffer)))) | |
4531 2) | |
4532 0)) | |
4533 (setq max-len (max 4 (if gnus-mode-non-string-length | |
4534 (- (window-width) | |
4535 gnus-mode-non-string-length | |
4536 bufname-length) | |
4537 (length mode-string)))) | |
4538 ;; We might have to chop a bit of the string off... | |
4539 (when (> (length mode-string) max-len) | |
4540 (setq mode-string | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4541 (concat (truncate-string-to-width mode-string (- max-len 3)) |
17493 | 4542 "..."))) |
4543 ;; Pad the mode string a bit. | |
4544 (setq mode-string (format (format "%%-%ds" max-len) mode-string)))) | |
4545 ;; Update the mode line. | |
4546 (setq mode-line-buffer-identification | |
4547 (gnus-mode-line-buffer-identification (list mode-string))) | |
4548 (set-buffer-modified-p t)))) | |
4549 | |
4550 (defun gnus-create-xref-hashtb (from-newsgroup headers unreads) | |
4551 "Go through the HEADERS list and add all Xrefs to a hash table. | |
4552 The resulting hash table is returned, or nil if no Xrefs were found." | |
4553 (let* ((virtual (gnus-virtual-group-p from-newsgroup)) | |
4554 (prefix (if virtual "" (gnus-group-real-prefix from-newsgroup))) | |
4555 (xref-hashtb (gnus-make-hashtable)) | |
4556 start group entry number xrefs header) | |
4557 (while headers | |
4558 (setq header (pop headers)) | |
4559 (when (and (setq xrefs (mail-header-xref header)) | |
4560 (not (memq (setq number (mail-header-number header)) | |
4561 unreads))) | |
4562 (setq start 0) | |
4563 (while (string-match "\\([^ ]+\\)[:/]\\([0-9]+\\)" xrefs start) | |
4564 (setq start (match-end 0)) | |
4565 (setq group (if prefix | |
4566 (concat prefix (substring xrefs (match-beginning 1) | |
4567 (match-end 1))) | |
4568 (substring xrefs (match-beginning 1) (match-end 1)))) | |
4569 (setq number | |
4570 (string-to-int (substring xrefs (match-beginning 2) | |
4571 (match-end 2)))) | |
4572 (if (setq entry (gnus-gethash group xref-hashtb)) | |
4573 (setcdr entry (cons number (cdr entry))) | |
4574 (gnus-sethash group (cons number nil) xref-hashtb))))) | |
4575 (and start xref-hashtb))) | |
4576 | |
4577 (defun gnus-mark-xrefs-as-read (from-newsgroup headers unreads) | |
4578 "Look through all the headers and mark the Xrefs as read." | |
4579 (let ((virtual (gnus-virtual-group-p from-newsgroup)) | |
4580 name entry info xref-hashtb idlist method nth4) | |
4581 (save-excursion | |
4582 (set-buffer gnus-group-buffer) | |
4583 (when (setq xref-hashtb | |
4584 (gnus-create-xref-hashtb from-newsgroup headers unreads)) | |
4585 (mapatoms | |
4586 (lambda (group) | |
4587 (unless (string= from-newsgroup (setq name (symbol-name group))) | |
4588 (setq idlist (symbol-value group)) | |
4589 ;; Dead groups are not updated. | |
4590 (and (prog1 | |
4591 (setq entry (gnus-gethash name gnus-newsrc-hashtb) | |
4592 info (nth 2 entry)) | |
4593 (when (stringp (setq nth4 (gnus-info-method info))) | |
4594 (setq nth4 (gnus-server-to-method nth4)))) | |
4595 ;; Only do the xrefs if the group has the same | |
4596 ;; select method as the group we have just read. | |
4597 (or (gnus-methods-equal-p | |
4598 nth4 (gnus-find-method-for-group from-newsgroup)) | |
4599 virtual | |
4600 (equal nth4 (setq method (gnus-find-method-for-group | |
4601 from-newsgroup))) | |
4602 (and (equal (car nth4) (car method)) | |
4603 (equal (nth 1 nth4) (nth 1 method)))) | |
4604 gnus-use-cross-reference | |
4605 (or (not (eq gnus-use-cross-reference t)) | |
4606 virtual | |
4607 ;; Only do cross-references on subscribed | |
4608 ;; groups, if that is what is wanted. | |
4609 (<= (gnus-info-level info) gnus-level-subscribed)) | |
4610 (gnus-group-make-articles-read name idlist)))) | |
4611 xref-hashtb))))) | |
4612 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4613 (defun gnus-compute-read-articles (group articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4614 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4615 (info (nth 2 entry)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4616 (active (gnus-active group)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4617 ninfo) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4618 (when entry |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4619 ;; First peel off all invalid article numbers. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4620 (when active |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4621 (let ((ids articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4622 id first) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4623 (while (setq id (pop ids)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4624 (when (and first (> id (cdr active))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4625 ;; We'll end up in this situation in one particular |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4626 ;; obscure situation. If you re-scan a group and get |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4627 ;; a new article that is cross-posted to a different |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4628 ;; group that has not been re-scanned, you might get |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4629 ;; crossposted article that has a higher number than |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4630 ;; Gnus believes possible. So we re-activate this |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4631 ;; group as well. This might mean doing the |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4632 ;; crossposting thingy will *increase* the number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4633 ;; of articles in some groups. Tsk, tsk. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4634 (setq active (or (gnus-activate-group group) active))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4635 (when (or (> id (cdr active)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4636 (< id (car active))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4637 (setq articles (delq id articles)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4638 ;; If the read list is nil, we init it. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4639 (if (and active |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4640 (null (gnus-info-read info)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4641 (> (car active) 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4642 (setq ninfo (cons 1 (1- (car active)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4643 (setq ninfo (gnus-info-read info))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4644 ;; Then we add the read articles to the range. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4645 (gnus-add-to-range |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4646 ninfo (setq articles (sort articles '<)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4647 |
17493 | 4648 (defun gnus-group-make-articles-read (group articles) |
4649 "Update the info of GROUP to say that ARTICLES are read." | |
4650 (let* ((num 0) | |
4651 (entry (gnus-gethash group gnus-newsrc-hashtb)) | |
4652 (info (nth 2 entry)) | |
4653 (active (gnus-active group)) | |
4654 range) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4655 (when entry |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4656 (setq range (gnus-compute-read-articles group articles)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4657 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4658 (set-buffer gnus-group-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4659 (gnus-undo-register |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4660 `(progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4661 (gnus-info-set-marks ',info ',(gnus-info-marks info) t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4662 (gnus-info-set-read ',info ',(gnus-info-read info)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4663 (gnus-get-unread-articles-in-group ',info (gnus-active ,group)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4664 (gnus-group-update-group ,group t)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4665 ;; Add the read articles to the range. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4666 (gnus-info-set-read info range) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4667 ;; Then we have to re-compute how many unread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4668 ;; articles there are in this group. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4669 (when active |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4670 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4671 ((not range) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4672 (setq num (- (1+ (cdr active)) (car active)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4673 ((not (listp (cdr range))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4674 (setq num (- (cdr active) (- (1+ (cdr range)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4675 (car range))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4676 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4677 (while range |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4678 (if (numberp (car range)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4679 (setq num (1+ num)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4680 (setq num (+ num (- (1+ (cdar range)) (caar range))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4681 (setq range (cdr range))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4682 (setq num (- (cdr active) num)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4683 ;; Update the number of unread articles. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4684 (setcar entry num) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4685 ;; Update the group buffer. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4686 (gnus-group-update-group group t))))) |
17493 | 4687 |
4688 (defvar gnus-newsgroup-none-id 0) | |
4689 | |
4690 (defun gnus-get-newsgroup-headers (&optional dependencies force-new) | |
4691 (let ((cur nntp-server-buffer) | |
4692 (dependencies | |
4693 (or dependencies | |
4694 (save-excursion (set-buffer gnus-summary-buffer) | |
4695 gnus-newsgroup-dependencies))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4696 headers id end ref |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4697 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4698 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4699 (save-excursion (condition-case nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4700 (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4701 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4702 gnus-newsgroup-ignored-charsets))) |
17493 | 4703 (save-excursion |
4704 (set-buffer nntp-server-buffer) | |
4705 ;; Translate all TAB characters into SPACE characters. | |
4706 (subst-char-in-region (point-min) (point-max) ?\t ? t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4707 (subst-char-in-region (point-min) (point-max) ?\r ? t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4708 (gnus-run-hooks 'gnus-parse-headers-hook) |
17493 | 4709 (let ((case-fold-search t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4710 in-reply-to header p lines chars) |
17493 | 4711 (goto-char (point-min)) |
4712 ;; Search to the beginning of the next header. Error messages | |
4713 ;; do not begin with 2 or 3. | |
4714 (while (re-search-forward "^[23][0-9]+ " nil t) | |
4715 (setq id nil | |
4716 ref nil) | |
4717 ;; This implementation of this function, with nine | |
4718 ;; search-forwards instead of the one re-search-forward and | |
4719 ;; a case (which basically was the old function) is actually | |
4720 ;; about twice as fast, even though it looks messier. You | |
4721 ;; can't have everything, I guess. Speed and elegance | |
4722 ;; doesn't always go hand in hand. | |
4723 (setq | |
4724 header | |
4725 (vector | |
4726 ;; Number. | |
4727 (prog1 | |
4728 (read cur) | |
4729 (end-of-line) | |
4730 (setq p (point)) | |
4731 (narrow-to-region (point) | |
4732 (or (and (search-forward "\n.\n" nil t) | |
4733 (- (point) 2)) | |
4734 (point)))) | |
4735 ;; Subject. | |
4736 (progn | |
4737 (goto-char p) | |
4738 (if (search-forward "\nsubject: " nil t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4739 (funcall gnus-decode-encoded-word-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4740 (nnheader-header-value)) |
19594
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
4741 "(none)")) |
17493 | 4742 ;; From. |
4743 (progn | |
4744 (goto-char p) | |
4745 (if (search-forward "\nfrom: " nil t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4746 (funcall gnus-decode-encoded-word-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4747 (nnheader-header-value)) |
19594
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
4748 "(nobody)")) |
17493 | 4749 ;; Date. |
4750 (progn | |
4751 (goto-char p) | |
4752 (if (search-forward "\ndate: " nil t) | |
4753 (nnheader-header-value) "")) | |
4754 ;; Message-ID. | |
4755 (progn | |
4756 (goto-char p) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4757 (setq id (if (re-search-forward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4758 "^message-id: *\\(<[^\n\t> ]+>\\)" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4759 ;; We do it this way to make sure the Message-ID |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4760 ;; is (somewhat) syntactically valid. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4761 (buffer-substring (match-beginning 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4762 (match-end 1)) |
17493 | 4763 ;; If there was no message-id, we just fake one |
4764 ;; to make subsequent routines simpler. | |
4765 (nnheader-generate-fake-message-id)))) | |
4766 ;; References. | |
4767 (progn | |
4768 (goto-char p) | |
4769 (if (search-forward "\nreferences: " nil t) | |
4770 (progn | |
4771 (setq end (point)) | |
4772 (prog1 | |
4773 (nnheader-header-value) | |
4774 (setq ref | |
4775 (buffer-substring | |
4776 (progn | |
4777 (end-of-line) | |
4778 (search-backward ">" end t) | |
4779 (1+ (point))) | |
4780 (progn | |
4781 (search-backward "<" end t) | |
4782 (point)))))) | |
4783 ;; Get the references from the in-reply-to header if there | |
4784 ;; were no references and the in-reply-to header looks | |
4785 ;; promising. | |
4786 (if (and (search-forward "\nin-reply-to: " nil t) | |
4787 (setq in-reply-to (nnheader-header-value)) | |
4788 (string-match "<[^>]+>" in-reply-to)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4789 (let (ref2) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4790 (setq ref (substring in-reply-to (match-beginning 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4791 (match-end 0))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4792 (while (string-match "<[^>]+>" in-reply-to (match-end 0)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4793 (setq ref2 (substring in-reply-to (match-beginning 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4794 (match-end 0))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4795 (when (> (length ref2) (length ref)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4796 (setq ref ref2))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4797 ref) |
17493 | 4798 (setq ref nil)))) |
4799 ;; Chars. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4800 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4801 (goto-char p) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4802 (if (search-forward "\nchars: " nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4803 (if (numberp (setq chars (ignore-errors (read cur)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4804 chars 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4805 0)) |
17493 | 4806 ;; Lines. |
4807 (progn | |
4808 (goto-char p) | |
4809 (if (search-forward "\nlines: " nil t) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4810 (if (numberp (setq lines (ignore-errors (read cur)))) |
17493 | 4811 lines 0) |
4812 0)) | |
4813 ;; Xref. | |
4814 (progn | |
4815 (goto-char p) | |
4816 (and (search-forward "\nxref: " nil t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4817 (nnheader-header-value))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4818 ;; Extra. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4819 (when gnus-extra-headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4820 (let ((extra gnus-extra-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4821 out) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4822 (while extra |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4823 (goto-char p) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4824 (when (search-forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4825 (concat "\n" (symbol-name (car extra)) ": ") nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4826 (push (cons (car extra) (nnheader-header-value)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4827 out)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4828 (pop extra)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4829 out)))) |
17493 | 4830 (when (equal id ref) |
4831 (setq ref nil)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4832 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4833 (when gnus-alter-header-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4834 (funcall gnus-alter-header-function header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4835 (setq id (mail-header-id header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4836 ref (gnus-parent-id (mail-header-references header)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4837 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4838 (when (setq header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4839 (gnus-dependencies-add-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4840 header dependencies force-new)) |
17493 | 4841 (push header headers)) |
4842 (goto-char (point-max)) | |
4843 (widen)) | |
4844 (nreverse headers))))) | |
4845 | |
4846 ;; Goes through the xover lines and returns a list of vectors | |
4847 (defun gnus-get-newsgroup-headers-xover (sequence &optional | |
4848 force-new dependencies | |
4849 group also-fetch-heads) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4850 "Parse the news overview data in the server buffer. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4851 Return a list of headers that match SEQUENCE (see |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4852 `nntp-retrieve-headers')." |
17493 | 4853 ;; Get the Xref when the users reads the articles since most/some |
4854 ;; NNTP servers do not include Xrefs when using XOVER. | |
4855 (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4856 (let ((mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4857 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4858 (cur nntp-server-buffer) |
17493 | 4859 (dependencies (or dependencies gnus-newsgroup-dependencies)) |
4860 number headers header) | |
4861 (save-excursion | |
4862 (set-buffer nntp-server-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4863 (subst-char-in-region (point-min) (point-max) ?\r ? t) |
17493 | 4864 ;; Allow the user to mangle the headers before parsing them. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4865 (gnus-run-hooks 'gnus-parse-headers-hook) |
17493 | 4866 (goto-char (point-min)) |
4867 (while (not (eobp)) | |
4868 (condition-case () | |
4869 (while (and sequence (not (eobp))) | |
4870 (setq number (read cur)) | |
4871 (while (and sequence | |
4872 (< (car sequence) number)) | |
4873 (setq sequence (cdr sequence))) | |
4874 (and sequence | |
4875 (eq number (car sequence)) | |
4876 (progn | |
4877 (setq sequence (cdr sequence)) | |
4878 (setq header (inline | |
4879 (gnus-nov-parse-line | |
4880 number dependencies force-new)))) | |
4881 (push header headers)) | |
4882 (forward-line 1)) | |
4883 (error | |
4884 (gnus-error 4 "Strange nov line (%d)" | |
4885 (count-lines (point-min) (point))))) | |
4886 (forward-line 1)) | |
4887 ;; A common bug in inn is that if you have posted an article and | |
4888 ;; then retrieves the active file, it will answer correctly -- | |
4889 ;; the new article is included. However, a NOV entry for the | |
4890 ;; article may not have been generated yet, so this may fail. | |
4891 ;; We work around this problem by retrieving the last few | |
4892 ;; headers using HEAD. | |
4893 (if (or (not also-fetch-heads) | |
4894 (not sequence)) | |
4895 ;; We (probably) got all the headers. | |
4896 (nreverse headers) | |
4897 (let ((gnus-nov-is-evil t)) | |
4898 (nconc | |
4899 (nreverse headers) | |
4900 (when (gnus-retrieve-headers sequence group) | |
4901 (gnus-get-newsgroup-headers)))))))) | |
4902 | |
4903 (defun gnus-article-get-xrefs () | |
4904 "Fill in the Xref value in `gnus-current-headers', if necessary. | |
4905 This is meant to be called in `gnus-article-internal-prepare-hook'." | |
4906 (let ((headers (save-excursion (set-buffer gnus-summary-buffer) | |
4907 gnus-current-headers))) | |
4908 (or (not gnus-use-cross-reference) | |
4909 (not headers) | |
4910 (and (mail-header-xref headers) | |
4911 (not (string= (mail-header-xref headers) ""))) | |
4912 (let ((case-fold-search t) | |
4913 xref) | |
4914 (save-restriction | |
4915 (nnheader-narrow-to-headers) | |
4916 (goto-char (point-min)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4917 (when (or (and (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4918 (eq (downcase (char-after)) ?x) |
17493 | 4919 (looking-at "Xref:")) |
4920 (search-forward "\nXref:" nil t)) | |
4921 (goto-char (1+ (match-end 0))) | |
4922 (setq xref (buffer-substring (point) | |
4923 (progn (end-of-line) (point)))) | |
4924 (mail-header-set-xref headers xref))))))) | |
4925 | |
4926 (defun gnus-summary-insert-subject (id &optional old-header use-old-header) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4927 "Find article ID and insert the summary line for that article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4928 OLD-HEADER can either be a header or a line number to insert |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4929 the subject line on." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4930 (let* ((line (and (numberp old-header) old-header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4931 (old-header (and (vectorp old-header) old-header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4932 (header (cond ((and old-header use-old-header) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4933 old-header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4934 ((and (numberp id) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4935 (gnus-number-to-header id)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4936 (gnus-number-to-header id)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4937 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4938 (gnus-read-header id)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4939 (number (and (numberp id) id)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4940 d) |
17493 | 4941 (when header |
4942 ;; Rebuild the thread that this article is part of and go to the | |
4943 ;; article we have fetched. | |
4944 (when (and (not gnus-show-threads) | |
4945 old-header) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4946 (when (and number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4947 (setq d (gnus-data-find (mail-header-number old-header)))) |
17493 | 4948 (goto-char (gnus-data-pos d)) |
4949 (gnus-data-remove | |
4950 number | |
4951 (- (gnus-point-at-bol) | |
4952 (prog1 | |
4953 (1+ (gnus-point-at-eol)) | |
4954 (gnus-delete-line)))))) | |
4955 (when old-header | |
4956 (mail-header-set-number header (mail-header-number old-header))) | |
4957 (setq gnus-newsgroup-sparse | |
4958 (delq (setq number (mail-header-number header)) | |
4959 gnus-newsgroup-sparse)) | |
4960 (setq gnus-newsgroup-ancient (delq number gnus-newsgroup-ancient)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4961 (push number gnus-newsgroup-limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4962 (gnus-rebuild-thread (mail-header-id header) line) |
17493 | 4963 (gnus-summary-goto-subject number nil t)) |
4964 (when (and (numberp number) | |
4965 (> number 0)) | |
4966 ;; We have to update the boundaries even if we can't fetch the | |
4967 ;; article if ID is a number -- so that the next `P' or `N' | |
4968 ;; command will fetch the previous (or next) article even | |
4969 ;; if the one we tried to fetch this time has been canceled. | |
4970 (when (> number gnus-newsgroup-end) | |
4971 (setq gnus-newsgroup-end number)) | |
4972 (when (< number gnus-newsgroup-begin) | |
4973 (setq gnus-newsgroup-begin number)) | |
4974 (setq gnus-newsgroup-unselected | |
4975 (delq number gnus-newsgroup-unselected))) | |
4976 ;; Report back a success? | |
4977 (and header (mail-header-number header)))) | |
4978 | |
4979 ;;; Process/prefix in the summary buffer | |
4980 | |
4981 (defun gnus-summary-work-articles (n) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4982 "Return a list of articles to be worked upon. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4983 The prefix argument, the list of process marked articles, and the |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4984 current article will be taken into consideration." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4985 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4986 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4987 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4988 (n |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4989 ;; A numerical prefix has been given. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4990 (setq n (prefix-numeric-value n)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4991 (let ((backward (< n 0)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4992 (n (abs (prefix-numeric-value n))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4993 articles article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4994 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4995 (while |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4996 (and (> n 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4997 (push (setq article (gnus-summary-article-number)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4998 articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4999 (if backward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5000 (gnus-summary-find-prev nil article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5001 (gnus-summary-find-next nil article))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5002 (decf n))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5003 (nreverse articles))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5004 ((and (gnus-region-active-p) (mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5005 (message "region active") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5006 ;; Work on the region between point and mark. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5007 (let ((max (max (point) (mark))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5008 articles article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5009 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5010 (goto-char (min (min (point) (mark)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5011 (while |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5012 (and |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5013 (push (setq article (gnus-summary-article-number)) articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5014 (gnus-summary-find-next nil article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5015 (< (point) max))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5016 (nreverse articles)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5017 (gnus-newsgroup-processable |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5018 ;; There are process-marked articles present. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5019 ;; Save current state. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5020 (gnus-summary-save-process-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5021 ;; Return the list. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5022 (reverse gnus-newsgroup-processable)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5023 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5024 ;; Just return the current article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5025 (list (gnus-summary-article-number)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5026 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5027 (defmacro gnus-summary-iterate (arg &rest forms) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5028 "Iterate over the process/prefixed articles and do FORMS. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5029 ARG is the interactive prefix given to the command. FORMS will be |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5030 executed with point over the summary line of the articles." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5031 (let ((articles (make-symbol "gnus-summary-iterate-articles"))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5032 `(let ((,articles (gnus-summary-work-articles ,arg))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5033 (while ,articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5034 (gnus-summary-goto-subject (car ,articles)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5035 ,@forms |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5036 (pop ,articles))))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5037 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5038 (put 'gnus-summary-iterate 'lisp-indent-function 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5039 (put 'gnus-summary-iterate 'edebug-form-spec '(form body)) |
17493 | 5040 |
5041 (defun gnus-summary-save-process-mark () | |
5042 "Push the current set of process marked articles on the stack." | |
5043 (interactive) | |
5044 (push (copy-sequence gnus-newsgroup-processable) | |
5045 gnus-newsgroup-process-stack)) | |
5046 | |
5047 (defun gnus-summary-kill-process-mark () | |
5048 "Push the current set of process marked articles on the stack and unmark." | |
5049 (interactive) | |
5050 (gnus-summary-save-process-mark) | |
5051 (gnus-summary-unmark-all-processable)) | |
5052 | |
5053 (defun gnus-summary-yank-process-mark () | |
5054 "Pop the last process mark state off the stack and restore it." | |
5055 (interactive) | |
5056 (unless gnus-newsgroup-process-stack | |
5057 (error "Empty mark stack")) | |
5058 (gnus-summary-process-mark-set (pop gnus-newsgroup-process-stack))) | |
5059 | |
5060 (defun gnus-summary-process-mark-set (set) | |
5061 "Make SET into the current process marked articles." | |
5062 (gnus-summary-unmark-all-processable) | |
5063 (while set | |
5064 (gnus-summary-set-process-mark (pop set)))) | |
5065 | |
5066 ;;; Searching and stuff | |
5067 | |
5068 (defun gnus-summary-search-group (&optional backward use-level) | |
5069 "Search for next unread newsgroup. | |
5070 If optional argument BACKWARD is non-nil, search backward instead." | |
5071 (save-excursion | |
5072 (set-buffer gnus-group-buffer) | |
5073 (when (gnus-group-search-forward | |
5074 backward nil (if use-level (gnus-group-group-level) nil)) | |
5075 (gnus-group-group-name)))) | |
5076 | |
5077 (defun gnus-summary-best-group (&optional exclude-group) | |
5078 "Find the name of the best unread group. | |
5079 If EXCLUDE-GROUP, do not go to this group." | |
5080 (save-excursion | |
5081 (set-buffer gnus-group-buffer) | |
5082 (save-excursion | |
5083 (gnus-group-best-unread-group exclude-group)))) | |
5084 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5085 (defun gnus-summary-find-next (&optional unread article backward undownloaded) |
17493 | 5086 (if backward (gnus-summary-find-prev) |
5087 (let* ((dummy (gnus-summary-article-intangible-p)) | |
5088 (article (or article (gnus-summary-article-number))) | |
5089 (arts (gnus-data-find-list article)) | |
5090 result) | |
5091 (when (and (not dummy) | |
5092 (or (not gnus-summary-check-current) | |
5093 (not unread) | |
5094 (not (gnus-data-unread-p (car arts))))) | |
5095 (setq arts (cdr arts))) | |
5096 (when (setq result | |
5097 (if unread | |
5098 (progn | |
5099 (while arts | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5100 (when (or (and undownloaded |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5101 (eq gnus-undownloaded-mark |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5102 (gnus-data-mark (car arts)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5103 (gnus-data-unread-p (car arts))) |
17493 | 5104 (setq result (car arts) |
5105 arts nil)) | |
5106 (setq arts (cdr arts))) | |
5107 result) | |
5108 (car arts))) | |
5109 (goto-char (gnus-data-pos result)) | |
5110 (gnus-data-number result))))) | |
5111 | |
5112 (defun gnus-summary-find-prev (&optional unread article) | |
5113 (let* ((eobp (eobp)) | |
5114 (article (or article (gnus-summary-article-number))) | |
5115 (arts (gnus-data-find-list article (gnus-data-list 'rev))) | |
5116 result) | |
5117 (when (and (not eobp) | |
5118 (or (not gnus-summary-check-current) | |
5119 (not unread) | |
5120 (not (gnus-data-unread-p (car arts))))) | |
5121 (setq arts (cdr arts))) | |
5122 (when (setq result | |
5123 (if unread | |
5124 (progn | |
5125 (while arts | |
5126 (when (gnus-data-unread-p (car arts)) | |
5127 (setq result (car arts) | |
5128 arts nil)) | |
5129 (setq arts (cdr arts))) | |
5130 result) | |
5131 (car arts))) | |
5132 (goto-char (gnus-data-pos result)) | |
5133 (gnus-data-number result)))) | |
5134 | |
5135 (defun gnus-summary-find-subject (subject &optional unread backward article) | |
5136 (let* ((simp-subject (gnus-simplify-subject-fully subject)) | |
5137 (article (or article (gnus-summary-article-number))) | |
5138 (articles (gnus-data-list backward)) | |
5139 (arts (gnus-data-find-list article articles)) | |
5140 result) | |
5141 (when (or (not gnus-summary-check-current) | |
5142 (not unread) | |
5143 (not (gnus-data-unread-p (car arts)))) | |
5144 (setq arts (cdr arts))) | |
5145 (while arts | |
5146 (and (or (not unread) | |
5147 (gnus-data-unread-p (car arts))) | |
5148 (vectorp (gnus-data-header (car arts))) | |
5149 (gnus-subject-equal | |
5150 simp-subject (mail-header-subject (gnus-data-header (car arts))) t) | |
5151 (setq result (car arts) | |
5152 arts nil)) | |
5153 (setq arts (cdr arts))) | |
5154 (and result | |
5155 (goto-char (gnus-data-pos result)) | |
5156 (gnus-data-number result)))) | |
5157 | |
5158 (defun gnus-summary-search-forward (&optional unread subject backward) | |
5159 "Search forward for an article. | |
5160 If UNREAD, look for unread articles. If SUBJECT, look for | |
5161 articles with that subject. If BACKWARD, search backward instead." | |
5162 (cond (subject (gnus-summary-find-subject subject unread backward)) | |
5163 (backward (gnus-summary-find-prev unread)) | |
5164 (t (gnus-summary-find-next unread)))) | |
5165 | |
5166 (defun gnus-recenter (&optional n) | |
5167 "Center point in window and redisplay frame. | |
5168 Also do horizontal recentering." | |
5169 (interactive "P") | |
5170 (when (and gnus-auto-center-summary | |
5171 (not (eq gnus-auto-center-summary 'vertical))) | |
5172 (gnus-horizontal-recenter)) | |
5173 (recenter n)) | |
5174 | |
5175 (defun gnus-summary-recenter () | |
5176 "Center point in the summary window. | |
5177 If `gnus-auto-center-summary' is nil, or the article buffer isn't | |
5178 displayed, no centering will be performed." | |
5179 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle). | |
5180 ;; Recenter only when requested. Suggested by popovich@park.cs.columbia.edu. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5181 (interactive) |
17493 | 5182 (let* ((top (cond ((< (window-height) 4) 0) |
5183 ((< (window-height) 7) 1) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5184 (t (if (numberp gnus-auto-center-summary) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5185 gnus-auto-center-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5186 2)))) |
17493 | 5187 (height (1- (window-height))) |
5188 (bottom (save-excursion (goto-char (point-max)) | |
5189 (forward-line (- height)) | |
5190 (point))) | |
5191 (window (get-buffer-window (current-buffer)))) | |
5192 ;; The user has to want it. | |
5193 (when gnus-auto-center-summary | |
5194 (when (get-buffer-window gnus-article-buffer) | |
5195 ;; Only do recentering when the article buffer is displayed, | |
5196 ;; Set the window start to either `bottom', which is the biggest | |
5197 ;; possible valid number, or the second line from the top, | |
5198 ;; whichever is the least. | |
5199 (set-window-start | |
5200 window (min bottom (save-excursion | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5201 (forward-line (- top)) (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5202 t)) |
17493 | 5203 ;; Do horizontal recentering while we're at it. |
5204 (when (and (get-buffer-window (current-buffer) t) | |
5205 (not (eq gnus-auto-center-summary 'vertical))) | |
5206 (let ((selected (selected-window))) | |
5207 (select-window (get-buffer-window (current-buffer) t)) | |
5208 (gnus-summary-position-point) | |
5209 (gnus-horizontal-recenter) | |
5210 (select-window selected)))))) | |
5211 | |
5212 (defun gnus-summary-jump-to-group (newsgroup) | |
5213 "Move point to NEWSGROUP in group mode buffer." | |
5214 ;; Keep update point of group mode buffer if visible. | |
5215 (if (eq (current-buffer) (get-buffer gnus-group-buffer)) | |
5216 (save-window-excursion | |
5217 ;; Take care of tree window mode. | |
5218 (when (get-buffer-window gnus-group-buffer) | |
5219 (pop-to-buffer gnus-group-buffer)) | |
5220 (gnus-group-jump-to-group newsgroup)) | |
5221 (save-excursion | |
5222 ;; Take care of tree window mode. | |
5223 (if (get-buffer-window gnus-group-buffer) | |
5224 (pop-to-buffer gnus-group-buffer) | |
5225 (set-buffer gnus-group-buffer)) | |
5226 (gnus-group-jump-to-group newsgroup)))) | |
5227 | |
5228 ;; This function returns a list of article numbers based on the | |
5229 ;; difference between the ranges of read articles in this group and | |
5230 ;; the range of active articles. | |
5231 (defun gnus-list-of-unread-articles (group) | |
5232 (let* ((read (gnus-info-read (gnus-get-info group))) | |
5233 (active (or (gnus-active group) (gnus-activate-group group))) | |
5234 (last (cdr active)) | |
5235 first nlast unread) | |
5236 ;; If none are read, then all are unread. | |
5237 (if (not read) | |
5238 (setq first (car active)) | |
5239 ;; If the range of read articles is a single range, then the | |
5240 ;; first unread article is the article after the last read | |
5241 ;; article. Sounds logical, doesn't it? | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5242 (if (and (not (listp (cdr read))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5243 (or (< (car read) (car active)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5244 (progn (setq read (list read)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5245 nil))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5246 (setq first (max (car active) (1+ (cdr read)))) |
17493 | 5247 ;; `read' is a list of ranges. |
5248 (when (/= (setq nlast (or (and (numberp (car read)) (car read)) | |
5249 (caar read))) | |
5250 1) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5251 (setq first (car active))) |
17493 | 5252 (while read |
5253 (when first | |
5254 (while (< first nlast) | |
5255 (push first unread) | |
5256 (setq first (1+ first)))) | |
5257 (setq first (1+ (if (atom (car read)) (car read) (cdar read)))) | |
5258 (setq nlast (if (atom (cadr read)) (cadr read) (caadr read))) | |
5259 (setq read (cdr read))))) | |
5260 ;; And add the last unread articles. | |
5261 (while (<= first last) | |
5262 (push first unread) | |
5263 (setq first (1+ first))) | |
5264 ;; Return the list of unread articles. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5265 (delq 0 (nreverse unread)))) |
17493 | 5266 |
5267 (defun gnus-list-of-read-articles (group) | |
5268 "Return a list of unread, unticked and non-dormant articles." | |
5269 (let* ((info (gnus-get-info group)) | |
5270 (marked (gnus-info-marks info)) | |
5271 (active (gnus-active group))) | |
5272 (and info active | |
5273 (gnus-set-difference | |
5274 (gnus-sorted-complement | |
5275 (gnus-uncompress-range active) | |
5276 (gnus-list-of-unread-articles group)) | |
5277 (append | |
5278 (gnus-uncompress-range (cdr (assq 'dormant marked))) | |
5279 (gnus-uncompress-range (cdr (assq 'tick marked)))))))) | |
5280 | |
5281 ;; Various summary commands | |
5282 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5283 (defun gnus-summary-select-article-buffer () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5284 "Reconfigure windows to show article buffer." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5285 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5286 (if (not (gnus-buffer-live-p gnus-article-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5287 (error "There is no article buffer for this summary buffer") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5288 (gnus-configure-windows 'article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5289 (select-window (get-buffer-window gnus-article-buffer)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5290 |
17493 | 5291 (defun gnus-summary-universal-argument (arg) |
5292 "Perform any operation on all articles that are process/prefixed." | |
5293 (interactive "P") | |
5294 (let ((articles (gnus-summary-work-articles arg)) | |
5295 func article) | |
5296 (if (eq | |
5297 (setq | |
5298 func | |
5299 (key-binding | |
5300 (read-key-sequence | |
5301 (substitute-command-keys | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5302 "\\<gnus-summary-mode-map>\\[gnus-summary-universal-argument]")))) |
17493 | 5303 'undefined) |
5304 (gnus-error 1 "Undefined key") | |
5305 (save-excursion | |
5306 (while articles | |
5307 (gnus-summary-goto-subject (setq article (pop articles))) | |
5308 (let (gnus-newsgroup-processable) | |
5309 (command-execute func)) | |
5310 (gnus-summary-remove-process-mark article))))) | |
5311 (gnus-summary-position-point)) | |
5312 | |
5313 (defun gnus-summary-toggle-truncation (&optional arg) | |
5314 "Toggle truncation of summary lines. | |
5315 With arg, turn line truncation on iff arg is positive." | |
5316 (interactive "P") | |
5317 (setq truncate-lines | |
5318 (if (null arg) (not truncate-lines) | |
5319 (> (prefix-numeric-value arg) 0))) | |
5320 (redraw-display)) | |
5321 | |
5322 (defun gnus-summary-reselect-current-group (&optional all rescan) | |
5323 "Exit and then reselect the current newsgroup. | |
5324 The prefix argument ALL means to select all articles." | |
5325 (interactive "P") | |
5326 (when (gnus-ephemeral-group-p gnus-newsgroup-name) | |
5327 (error "Ephemeral groups can't be reselected")) | |
5328 (let ((current-subject (gnus-summary-article-number)) | |
5329 (group gnus-newsgroup-name)) | |
5330 (setq gnus-newsgroup-begin nil) | |
5331 (gnus-summary-exit) | |
5332 ;; We have to adjust the point of group mode buffer because | |
5333 ;; point was moved to the next unread newsgroup by exiting. | |
5334 (gnus-summary-jump-to-group group) | |
5335 (when rescan | |
5336 (save-excursion | |
5337 (gnus-group-get-new-news-this-group 1))) | |
5338 (gnus-group-read-group all t) | |
5339 (gnus-summary-goto-subject current-subject nil t))) | |
5340 | |
5341 (defun gnus-summary-rescan-group (&optional all) | |
5342 "Exit the newsgroup, ask for new articles, and select the newsgroup." | |
5343 (interactive "P") | |
5344 (gnus-summary-reselect-current-group all t)) | |
5345 | |
5346 (defun gnus-summary-update-info (&optional non-destructive) | |
5347 (save-excursion | |
5348 (let ((group gnus-newsgroup-name)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5349 (when group |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5350 (when gnus-newsgroup-kill-headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5351 (setq gnus-newsgroup-killed |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5352 (gnus-compress-sequence |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5353 (nconc |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5354 (gnus-set-sorted-intersection |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5355 (gnus-uncompress-range gnus-newsgroup-killed) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5356 (setq gnus-newsgroup-unselected |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5357 (sort gnus-newsgroup-unselected '<))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5358 (setq gnus-newsgroup-unreads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5359 (sort gnus-newsgroup-unreads '<))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5360 t))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5361 (unless (listp (cdr gnus-newsgroup-killed)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5362 (setq gnus-newsgroup-killed (list gnus-newsgroup-killed))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5363 (let ((headers gnus-newsgroup-headers)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5364 ;; Set the new ranges of read articles. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5365 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5366 (set-buffer gnus-group-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5367 (gnus-undo-force-boundary)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5368 (gnus-update-read-articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5369 group (append gnus-newsgroup-unreads gnus-newsgroup-unselected)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5370 ;; Set the current article marks. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5371 (let ((gnus-newsgroup-scored |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5372 (if (and (not gnus-save-score) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5373 (not non-destructive)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5374 nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5375 gnus-newsgroup-scored))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5376 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5377 (gnus-update-marks))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5378 ;; Do the cross-ref thing. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5379 (when gnus-use-cross-reference |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5380 (gnus-mark-xrefs-as-read group headers gnus-newsgroup-unreads)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5381 ;; Do not switch windows but change the buffer to work. |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5382 (set-buffer gnus-group-buffer) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5383 (unless (gnus-ephemeral-group-p group) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5384 (gnus-group-update-group group))))))) |
17493 | 5385 |
5386 (defun gnus-summary-save-newsrc (&optional force) | |
5387 "Save the current number of read/marked articles in the dribble buffer. | |
5388 The dribble buffer will then be saved. | |
5389 If FORCE (the prefix), also save the .newsrc file(s)." | |
5390 (interactive "P") | |
5391 (gnus-summary-update-info t) | |
5392 (if force | |
5393 (gnus-save-newsrc-file) | |
5394 (gnus-dribble-save))) | |
5395 | |
5396 (defun gnus-summary-exit (&optional temporary) | |
5397 "Exit reading current newsgroup, and then return to group selection mode. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5398 `gnus-exit-group-hook' is called with no arguments if that value is non-nil." |
17493 | 5399 (interactive) |
5400 (gnus-set-global-variables) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5401 (when (gnus-buffer-live-p gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5402 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5403 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5404 (mm-destroy-parts gnus-article-mime-handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5405 ;; Set it to nil for safety reason. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5406 (setq gnus-article-mime-handle-alist nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5407 (setq gnus-article-mime-handles nil))) |
17493 | 5408 (gnus-kill-save-kill-buffer) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5409 (gnus-async-halt-prefetch) |
17493 | 5410 (let* ((group gnus-newsgroup-name) |
5411 (quit-config (gnus-group-quit-config gnus-newsgroup-name)) | |
5412 (mode major-mode) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5413 (group-point nil) |
17493 | 5414 (buf (current-buffer))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5415 (unless quit-config |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5416 ;; Do adaptive scoring, and possibly save score files. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5417 (when gnus-newsgroup-adaptive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5418 (gnus-score-adaptive)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5419 (when gnus-use-scoring |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5420 (gnus-score-save))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5421 (gnus-run-hooks 'gnus-summary-prepare-exit-hook) |
17493 | 5422 ;; If we have several article buffers, we kill them at exit. |
5423 (unless gnus-single-article-buffer | |
5424 (gnus-kill-buffer gnus-original-article-buffer) | |
5425 (setq gnus-article-current nil)) | |
5426 (when gnus-use-cache | |
5427 (gnus-cache-possibly-remove-articles) | |
5428 (gnus-cache-save-buffers)) | |
5429 (gnus-async-prefetch-remove-group group) | |
5430 (when gnus-suppress-duplicates | |
5431 (gnus-dup-enter-articles)) | |
5432 (when gnus-use-trees | |
5433 (gnus-tree-close group)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5434 (when gnus-use-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5435 (gnus-cache-write-active)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5436 ;; Remove entries for this group. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5437 (nnmail-purge-split-history (gnus-group-real-name group)) |
17493 | 5438 ;; Make all changes in this group permanent. |
5439 (unless quit-config | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5440 (gnus-run-hooks 'gnus-exit-group-hook) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5441 (gnus-summary-update-info)) |
17493 | 5442 (gnus-close-group group) |
5443 ;; Make sure where we were, and go to next newsgroup. | |
5444 (set-buffer gnus-group-buffer) | |
5445 (unless quit-config | |
5446 (gnus-group-jump-to-group group)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5447 (gnus-run-hooks 'gnus-summary-exit-hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5448 (unless (or quit-config |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5449 ;; If this group has disappeared from the summary |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5450 ;; buffer, don't skip forwards. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5451 (not (string= group (gnus-group-group-name)))) |
17493 | 5452 (gnus-group-next-unread-group 1)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5453 (setq group-point (point)) |
17493 | 5454 (if temporary |
5455 nil ;Nothing to do. | |
5456 ;; If we have several article buffers, we kill them at exit. | |
5457 (unless gnus-single-article-buffer | |
5458 (gnus-kill-buffer gnus-article-buffer) | |
5459 (gnus-kill-buffer gnus-original-article-buffer) | |
5460 (setq gnus-article-current nil)) | |
5461 (set-buffer buf) | |
5462 (if (not gnus-kill-summary-on-exit) | |
5463 (gnus-deaden-summary) | |
5464 ;; We set all buffer-local variables to nil. It is unclear why | |
5465 ;; this is needed, but if we don't, buffer-local variables are | |
5466 ;; not garbage-collected, it seems. This would the lead to en | |
5467 ;; ever-growing Emacs. | |
5468 (gnus-summary-clear-local-variables) | |
5469 (when (get-buffer gnus-article-buffer) | |
5470 (bury-buffer gnus-article-buffer)) | |
5471 ;; We clear the global counterparts of the buffer-local | |
5472 ;; variables as well, just to be on the safe side. | |
5473 (set-buffer gnus-group-buffer) | |
5474 (gnus-summary-clear-local-variables) | |
5475 ;; Return to group mode buffer. | |
5476 (when (eq mode 'gnus-summary-mode) | |
5477 (gnus-kill-buffer buf))) | |
5478 (setq gnus-current-select-method gnus-select-method) | |
5479 (pop-to-buffer gnus-group-buffer) | |
5480 (if (not quit-config) | |
5481 (progn | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5482 (goto-char group-point) |
17493 | 5483 (gnus-configure-windows 'group 'force)) |
5484 (gnus-handle-ephemeral-exit quit-config)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5485 ;; Clear the current group name. |
17493 | 5486 (unless quit-config |
5487 (setq gnus-newsgroup-name nil))))) | |
5488 | |
5489 (defalias 'gnus-summary-quit 'gnus-summary-exit-no-update) | |
5490 (defun gnus-summary-exit-no-update (&optional no-questions) | |
5491 "Quit reading current newsgroup without updating read article info." | |
5492 (interactive) | |
5493 (let* ((group gnus-newsgroup-name) | |
5494 (quit-config (gnus-group-quit-config group))) | |
5495 (when (or no-questions | |
5496 gnus-expert-user | |
5497 (gnus-y-or-n-p "Discard changes to this group and exit? ")) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5498 (gnus-async-halt-prefetch) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5499 (mapcar 'funcall |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5500 (delq 'gnus-summary-expire-articles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5501 (copy-sequence gnus-summary-prepare-exit-hook))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5502 (when (gnus-buffer-live-p gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5503 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5504 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5505 (mm-destroy-parts gnus-article-mime-handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5506 ;; Set it to nil for safety reason. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5507 (setq gnus-article-mime-handle-alist nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5508 (setq gnus-article-mime-handles nil))) |
17493 | 5509 ;; If we have several article buffers, we kill them at exit. |
5510 (unless gnus-single-article-buffer | |
5511 (gnus-kill-buffer gnus-article-buffer) | |
5512 (gnus-kill-buffer gnus-original-article-buffer) | |
5513 (setq gnus-article-current nil)) | |
5514 (if (not gnus-kill-summary-on-exit) | |
5515 (gnus-deaden-summary) | |
5516 (gnus-close-group group) | |
5517 (gnus-summary-clear-local-variables) | |
5518 (set-buffer gnus-group-buffer) | |
5519 (gnus-summary-clear-local-variables) | |
5520 (when (get-buffer gnus-summary-buffer) | |
5521 (kill-buffer gnus-summary-buffer))) | |
5522 (unless gnus-single-article-buffer | |
5523 (setq gnus-article-current nil)) | |
5524 (when gnus-use-trees | |
5525 (gnus-tree-close group)) | |
5526 (gnus-async-prefetch-remove-group group) | |
5527 (when (get-buffer gnus-article-buffer) | |
5528 (bury-buffer gnus-article-buffer)) | |
5529 ;; Return to the group buffer. | |
5530 (gnus-configure-windows 'group 'force) | |
5531 ;; Clear the current group name. | |
5532 (setq gnus-newsgroup-name nil) | |
5533 (when (equal (gnus-group-group-name) group) | |
5534 (gnus-group-next-unread-group 1)) | |
5535 (when quit-config | |
5536 (gnus-handle-ephemeral-exit quit-config))))) | |
5537 | |
5538 (defun gnus-handle-ephemeral-exit (quit-config) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5539 "Handle movement when leaving an ephemeral group. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5540 The state which existed when entering the ephemeral is reset." |
17493 | 5541 (if (not (buffer-name (car quit-config))) |
5542 (gnus-configure-windows 'group 'force) | |
5543 (set-buffer (car quit-config)) | |
5544 (cond ((eq major-mode 'gnus-summary-mode) | |
5545 (gnus-set-global-variables)) | |
5546 ((eq major-mode 'gnus-article-mode) | |
5547 (save-excursion | |
5548 ;; The `gnus-summary-buffer' variable may point | |
5549 ;; to the old summary buffer when using a single | |
5550 ;; article buffer. | |
5551 (unless (gnus-buffer-live-p gnus-summary-buffer) | |
5552 (set-buffer gnus-group-buffer)) | |
5553 (set-buffer gnus-summary-buffer) | |
5554 (gnus-set-global-variables)))) | |
5555 (if (or (eq (cdr quit-config) 'article) | |
5556 (eq (cdr quit-config) 'pick)) | |
5557 (progn | |
5558 ;; The current article may be from the ephemeral group | |
5559 ;; thus it is best that we reload this article | |
5560 (gnus-summary-show-article) | |
5561 (if (and (boundp 'gnus-pick-mode) (symbol-value 'gnus-pick-mode)) | |
5562 (gnus-configure-windows 'pick 'force) | |
5563 (gnus-configure-windows (cdr quit-config) 'force))) | |
5564 (gnus-configure-windows (cdr quit-config) 'force)) | |
5565 (when (eq major-mode 'gnus-summary-mode) | |
5566 (gnus-summary-next-subject 1 nil t) | |
5567 (gnus-summary-recenter) | |
5568 (gnus-summary-position-point)))) | |
5569 | |
5570 ;;; Dead summaries. | |
5571 | |
5572 (defvar gnus-dead-summary-mode-map nil) | |
5573 | |
5574 (unless gnus-dead-summary-mode-map | |
5575 (setq gnus-dead-summary-mode-map (make-keymap)) | |
5576 (suppress-keymap gnus-dead-summary-mode-map) | |
5577 (substitute-key-definition | |
5578 'undefined 'gnus-summary-wake-up-the-dead gnus-dead-summary-mode-map) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5579 (let ((keys '("\C-d" "\r" "\177" [delete]))) |
17493 | 5580 (while keys |
5581 (define-key gnus-dead-summary-mode-map | |
5582 (pop keys) 'gnus-summary-wake-up-the-dead)))) | |
5583 | |
5584 (defvar gnus-dead-summary-mode nil | |
5585 "Minor mode for Gnus summary buffers.") | |
5586 | |
5587 (defun gnus-dead-summary-mode (&optional arg) | |
5588 "Minor mode for Gnus summary buffers." | |
5589 (interactive "P") | |
5590 (when (eq major-mode 'gnus-summary-mode) | |
5591 (make-local-variable 'gnus-dead-summary-mode) | |
5592 (setq gnus-dead-summary-mode | |
5593 (if (null arg) (not gnus-dead-summary-mode) | |
5594 (> (prefix-numeric-value arg) 0))) | |
5595 (when gnus-dead-summary-mode | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5596 (gnus-add-minor-mode |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5597 'gnus-dead-summary-mode " Dead" gnus-dead-summary-mode-map)))) |
17493 | 5598 |
5599 (defun gnus-deaden-summary () | |
5600 "Make the current summary buffer into a dead summary buffer." | |
5601 ;; Kill any previous dead summary buffer. | |
5602 (when (and gnus-dead-summary | |
5603 (buffer-name gnus-dead-summary)) | |
5604 (save-excursion | |
5605 (set-buffer gnus-dead-summary) | |
5606 (when gnus-dead-summary-mode | |
5607 (kill-buffer (current-buffer))))) | |
5608 ;; Make this the current dead summary. | |
5609 (setq gnus-dead-summary (current-buffer)) | |
5610 (gnus-dead-summary-mode 1) | |
5611 (let ((name (buffer-name))) | |
5612 (when (string-match "Summary" name) | |
5613 (rename-buffer | |
5614 (concat (substring name 0 (match-beginning 0)) "Dead " | |
5615 (substring name (match-beginning 0))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5616 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5617 (bury-buffer)))) |
17493 | 5618 |
5619 (defun gnus-kill-or-deaden-summary (buffer) | |
5620 "Kill or deaden the summary BUFFER." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5621 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5622 (when (and (buffer-name buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5623 (not gnus-single-article-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5624 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5625 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5626 (gnus-kill-buffer gnus-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5627 (gnus-kill-buffer gnus-original-article-buffer))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5628 (cond (gnus-kill-summary-on-exit |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5629 (when (and gnus-use-trees |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5630 (gnus-buffer-exists-p buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5631 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5632 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5633 (gnus-tree-close gnus-newsgroup-name))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5634 (gnus-kill-buffer buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5635 ((gnus-buffer-exists-p buffer) |
17493 | 5636 (save-excursion |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5637 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5638 (gnus-deaden-summary)))))) |
17493 | 5639 |
5640 (defun gnus-summary-wake-up-the-dead (&rest args) | |
5641 "Wake up the dead summary buffer." | |
5642 (interactive) | |
5643 (gnus-dead-summary-mode -1) | |
5644 (let ((name (buffer-name))) | |
5645 (when (string-match "Dead " name) | |
5646 (rename-buffer | |
5647 (concat (substring name 0 (match-beginning 0)) | |
5648 (substring name (match-end 0))) | |
5649 t))) | |
5650 (gnus-message 3 "This dead summary is now alive again")) | |
5651 | |
5652 ;; Suggested by Andrew Eskilsson <pi92ae@pt.hk-r.se>. | |
5653 (defun gnus-summary-fetch-faq (&optional faq-dir) | |
5654 "Fetch the FAQ for the current group. | |
5655 If FAQ-DIR (the prefix), prompt for a directory to search for the faq | |
5656 in." | |
5657 (interactive | |
5658 (list | |
5659 (when current-prefix-arg | |
5660 (completing-read | |
5661 "Faq dir: " (and (listp gnus-group-faq-directory) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5662 (mapcar (lambda (file) (list file)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5663 gnus-group-faq-directory)))))) |
17493 | 5664 (let (gnus-faq-buffer) |
5665 (when (setq gnus-faq-buffer | |
5666 (gnus-group-fetch-faq gnus-newsgroup-name faq-dir)) | |
5667 (gnus-configure-windows 'summary-faq)))) | |
5668 | |
5669 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>. | |
5670 (defun gnus-summary-describe-group (&optional force) | |
5671 "Describe the current newsgroup." | |
5672 (interactive "P") | |
5673 (gnus-group-describe-group force gnus-newsgroup-name)) | |
5674 | |
5675 (defun gnus-summary-describe-briefly () | |
5676 "Describe summary mode commands briefly." | |
5677 (interactive) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5678 (gnus-message 6 (substitute-command-keys "\\<gnus-summary-mode-map>\\[gnus-summary-next-page]:Select \\[gnus-summary-next-unread-article]:Forward \\[gnus-summary-prev-unread-article]:Backward \\[gnus-summary-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-summary-describe-briefly]:This help"))) |
17493 | 5679 |
5680 ;; Walking around group mode buffer from summary mode. | |
5681 | |
5682 (defun gnus-summary-next-group (&optional no-article target-group backward) | |
5683 "Exit current newsgroup and then select next unread newsgroup. | |
5684 If prefix argument NO-ARTICLE is non-nil, no article is selected | |
5685 initially. If NEXT-GROUP, go to this group. If BACKWARD, go to | |
5686 previous group instead." | |
5687 (interactive "P") | |
5688 ;; Stop pre-fetching. | |
5689 (gnus-async-halt-prefetch) | |
5690 (let ((current-group gnus-newsgroup-name) | |
5691 (current-buffer (current-buffer)) | |
5692 entered) | |
5693 ;; First we semi-exit this group to update Xrefs and all variables. | |
5694 ;; We can't do a real exit, because the window conf must remain | |
5695 ;; the same in case the user is prompted for info, and we don't | |
5696 ;; want the window conf to change before that... | |
5697 (gnus-summary-exit t) | |
5698 (while (not entered) | |
5699 ;; Then we find what group we are supposed to enter. | |
5700 (set-buffer gnus-group-buffer) | |
5701 (gnus-group-jump-to-group current-group) | |
5702 (setq target-group | |
5703 (or target-group | |
5704 (if (eq gnus-keep-same-level 'best) | |
5705 (gnus-summary-best-group gnus-newsgroup-name) | |
5706 (gnus-summary-search-group backward gnus-keep-same-level)))) | |
5707 (if (not target-group) | |
5708 ;; There are no further groups, so we return to the group | |
5709 ;; buffer. | |
5710 (progn | |
5711 (gnus-message 5 "Returning to the group buffer") | |
5712 (setq entered t) | |
5713 (when (gnus-buffer-live-p current-buffer) | |
5714 (set-buffer current-buffer) | |
5715 (gnus-summary-exit)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5716 (gnus-run-hooks 'gnus-group-no-more-groups-hook)) |
17493 | 5717 ;; We try to enter the target group. |
5718 (gnus-group-jump-to-group target-group) | |
5719 (let ((unreads (gnus-group-group-unread))) | |
5720 (if (and (or (eq t unreads) | |
5721 (and unreads (not (zerop unreads)))) | |
5722 (gnus-summary-read-group | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5723 target-group nil no-article |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5724 (and (buffer-name current-buffer) current-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5725 nil backward)) |
17493 | 5726 (setq entered t) |
5727 (setq current-group target-group | |
5728 target-group nil))))))) | |
5729 | |
5730 (defun gnus-summary-prev-group (&optional no-article) | |
5731 "Exit current newsgroup and then select previous unread newsgroup. | |
5732 If prefix argument NO-ARTICLE is non-nil, no article is selected initially." | |
5733 (interactive "P") | |
5734 (gnus-summary-next-group no-article nil t)) | |
5735 | |
5736 ;; Walking around summary lines. | |
5737 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5738 (defun gnus-summary-first-subject (&optional unread undownloaded) |
17493 | 5739 "Go to the first unread subject. |
5740 If UNREAD is non-nil, go to the first unread article. | |
5741 Returns the article selected or nil if there are no unread articles." | |
5742 (interactive "P") | |
5743 (prog1 | |
5744 (cond | |
5745 ;; Empty summary. | |
5746 ((null gnus-newsgroup-data) | |
5747 (gnus-message 3 "No articles in the group") | |
5748 nil) | |
5749 ;; Pick the first article. | |
5750 ((not unread) | |
5751 (goto-char (gnus-data-pos (car gnus-newsgroup-data))) | |
5752 (gnus-data-number (car gnus-newsgroup-data))) | |
5753 ;; No unread articles. | |
5754 ((null gnus-newsgroup-unreads) | |
5755 (gnus-message 3 "No more unread articles") | |
5756 nil) | |
5757 ;; Find the first unread article. | |
5758 (t | |
5759 (let ((data gnus-newsgroup-data)) | |
5760 (while (and data | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5761 (and (not (and undownloaded |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5762 (eq gnus-undownloaded-mark |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5763 (gnus-data-mark (car data))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5764 (not (gnus-data-unread-p (car data))))) |
17493 | 5765 (setq data (cdr data))) |
5766 (when data | |
5767 (goto-char (gnus-data-pos (car data))) | |
5768 (gnus-data-number (car data)))))) | |
5769 (gnus-summary-position-point))) | |
5770 | |
5771 (defun gnus-summary-next-subject (n &optional unread dont-display) | |
5772 "Go to next N'th summary line. | |
5773 If N is negative, go to the previous N'th subject line. | |
5774 If UNREAD is non-nil, only unread articles are selected. | |
5775 The difference between N and the actual number of steps taken is | |
5776 returned." | |
5777 (interactive "p") | |
5778 (let ((backward (< n 0)) | |
5779 (n (abs n))) | |
5780 (while (and (> n 0) | |
5781 (if backward | |
5782 (gnus-summary-find-prev unread) | |
5783 (gnus-summary-find-next unread))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5784 (unless (zerop (setq n (1- n))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5785 (gnus-summary-show-thread))) |
17493 | 5786 (when (/= 0 n) |
5787 (gnus-message 7 "No more%s articles" | |
5788 (if unread " unread" ""))) | |
5789 (unless dont-display | |
5790 (gnus-summary-recenter) | |
5791 (gnus-summary-position-point)) | |
5792 n)) | |
5793 | |
5794 (defun gnus-summary-next-unread-subject (n) | |
5795 "Go to next N'th unread summary line." | |
5796 (interactive "p") | |
5797 (gnus-summary-next-subject n t)) | |
5798 | |
5799 (defun gnus-summary-prev-subject (n &optional unread) | |
5800 "Go to previous N'th summary line. | |
5801 If optional argument UNREAD is non-nil, only unread article is selected." | |
5802 (interactive "p") | |
5803 (gnus-summary-next-subject (- n) unread)) | |
5804 | |
5805 (defun gnus-summary-prev-unread-subject (n) | |
5806 "Go to previous N'th unread summary line." | |
5807 (interactive "p") | |
5808 (gnus-summary-next-subject (- n) t)) | |
5809 | |
5810 (defun gnus-summary-goto-subject (article &optional force silent) | |
5811 "Go the subject line of ARTICLE. | |
5812 If FORCE, also allow jumping to articles not currently shown." | |
5813 (interactive "nArticle number: ") | |
5814 (let ((b (point)) | |
5815 (data (gnus-data-find article))) | |
5816 ;; We read in the article if we have to. | |
5817 (and (not data) | |
5818 force | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5819 (gnus-summary-insert-subject |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5820 article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5821 (if (or (numberp force) (vectorp force)) force) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5822 t) |
17493 | 5823 (setq data (gnus-data-find article))) |
5824 (goto-char b) | |
5825 (if (not data) | |
5826 (progn | |
5827 (unless silent | |
5828 (gnus-message 3 "Can't find article %d" article)) | |
5829 nil) | |
5830 (goto-char (gnus-data-pos data)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5831 (gnus-summary-position-point) |
17493 | 5832 article))) |
5833 | |
5834 ;; Walking around summary lines with displaying articles. | |
5835 | |
5836 (defun gnus-summary-expand-window (&optional arg) | |
5837 "Make the summary buffer take up the entire Emacs frame. | |
5838 Given a prefix, will force an `article' buffer configuration." | |
5839 (interactive "P") | |
5840 (if arg | |
5841 (gnus-configure-windows 'article 'force) | |
5842 (gnus-configure-windows 'summary 'force))) | |
5843 | |
5844 (defun gnus-summary-display-article (article &optional all-header) | |
5845 "Display ARTICLE in article buffer." | |
5846 (gnus-set-global-variables) | |
5847 (if (null article) | |
5848 nil | |
5849 (prog1 | |
5850 (if gnus-summary-display-article-function | |
5851 (funcall gnus-summary-display-article-function article all-header) | |
5852 (gnus-article-prepare article all-header)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5853 (gnus-run-hooks 'gnus-select-article-hook) |
17493 | 5854 (when (and gnus-current-article |
5855 (not (zerop gnus-current-article))) | |
5856 (gnus-summary-goto-subject gnus-current-article)) | |
5857 (gnus-summary-recenter) | |
5858 (when (and gnus-use-trees gnus-show-threads) | |
5859 (gnus-possibly-generate-tree article) | |
5860 (gnus-highlight-selected-tree article)) | |
5861 ;; Successfully display article. | |
5862 (gnus-article-set-window-start | |
5863 (cdr (assq article gnus-newsgroup-bookmarks)))))) | |
5864 | |
5865 (defun gnus-summary-select-article (&optional all-headers force pseudo article) | |
5866 "Select the current article. | |
5867 If ALL-HEADERS is non-nil, show all header fields. If FORCE is | |
5868 non-nil, the article will be re-fetched even if it already present in | |
5869 the article buffer. If PSEUDO is non-nil, pseudo-articles will also | |
5870 be displayed." | |
5871 ;; Make sure we are in the summary buffer to work around bbdb bug. | |
5872 (unless (eq major-mode 'gnus-summary-mode) | |
5873 (set-buffer gnus-summary-buffer)) | |
5874 (let ((article (or article (gnus-summary-article-number))) | |
5875 (all-headers (not (not all-headers))) ;Must be T or NIL. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5876 gnus-summary-display-article-function) |
17493 | 5877 (and (not pseudo) |
5878 (gnus-summary-article-pseudo-p article) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5879 (error "This is a pseudo-article")) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5880 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5881 (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5882 (if (or (and gnus-single-article-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5883 (or (null gnus-current-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5884 (null gnus-article-current) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5885 (null (get-buffer gnus-article-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5886 (not (eq article (cdr gnus-article-current))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5887 (not (equal (car gnus-article-current) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5888 gnus-newsgroup-name)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5889 (and (not gnus-single-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5890 (or (null gnus-current-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5891 (not (eq gnus-current-article article)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5892 force) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5893 ;; The requested article is different from the current article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5894 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5895 (when (gnus-buffer-live-p gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5896 (with-current-buffer gnus-article-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5897 (mm-enable-multibyte))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5898 (gnus-summary-display-article article all-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5899 (when (gnus-buffer-live-p gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5900 (with-current-buffer gnus-article-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5901 (if (not gnus-article-decoded-p) ;; a local variable |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5902 (mm-disable-multibyte)))) |
17493 | 5903 (when (or all-headers gnus-show-all-headers) |
5904 (gnus-article-show-all-headers)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5905 (gnus-article-set-window-start |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5906 (cdr (assq article gnus-newsgroup-bookmarks))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5907 article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5908 (when (or all-headers gnus-show-all-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5909 (gnus-article-show-all-headers)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5910 'old)))) |
17493 | 5911 |
5912 (defun gnus-summary-set-current-mark (&optional current-mark) | |
5913 "Obsolete function." | |
5914 nil) | |
5915 | |
5916 (defun gnus-summary-next-article (&optional unread subject backward push) | |
5917 "Select the next article. | |
5918 If UNREAD, only unread articles are selected. | |
5919 If SUBJECT, only articles with SUBJECT are selected. | |
5920 If BACKWARD, the previous article is selected instead of the next." | |
5921 (interactive "P") | |
5922 (cond | |
5923 ;; Is there such an article? | |
5924 ((and (gnus-summary-search-forward unread subject backward) | |
5925 (or (gnus-summary-display-article (gnus-summary-article-number)) | |
5926 (eq (gnus-summary-article-mark) gnus-canceled-mark))) | |
5927 (gnus-summary-position-point)) | |
5928 ;; If not, we try the first unread, if that is wanted. | |
5929 ((and subject | |
5930 gnus-auto-select-same | |
5931 (gnus-summary-first-unread-article)) | |
5932 (gnus-summary-position-point) | |
5933 (gnus-message 6 "Wrapped")) | |
5934 ;; Try to get next/previous article not displayed in this group. | |
5935 ((and gnus-auto-extend-newsgroup | |
5936 (not unread) (not subject)) | |
5937 (gnus-summary-goto-article | |
5938 (if backward (1- gnus-newsgroup-begin) (1+ gnus-newsgroup-end)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5939 nil (count-lines (point-min) (point)))) |
17493 | 5940 ;; Go to next/previous group. |
5941 (t | |
5942 (unless (gnus-ephemeral-group-p gnus-newsgroup-name) | |
5943 (gnus-summary-jump-to-group gnus-newsgroup-name)) | |
5944 (let ((cmd last-command-char) | |
5945 (point | |
5946 (save-excursion | |
5947 (set-buffer gnus-group-buffer) | |
5948 (point))) | |
5949 (group | |
5950 (if (eq gnus-keep-same-level 'best) | |
5951 (gnus-summary-best-group gnus-newsgroup-name) | |
5952 (gnus-summary-search-group backward gnus-keep-same-level)))) | |
5953 ;; For some reason, the group window gets selected. We change | |
5954 ;; it back. | |
5955 (select-window (get-buffer-window (current-buffer))) | |
5956 ;; Select next unread newsgroup automagically. | |
5957 (cond | |
5958 ((or (not gnus-auto-select-next) | |
5959 (not cmd)) | |
5960 (gnus-message 7 "No more%s articles" (if unread " unread" ""))) | |
5961 ((or (eq gnus-auto-select-next 'quietly) | |
5962 (and (eq gnus-auto-select-next 'slightly-quietly) | |
5963 push) | |
5964 (and (eq gnus-auto-select-next 'almost-quietly) | |
5965 (gnus-summary-last-article-p))) | |
5966 ;; Select quietly. | |
5967 (if (gnus-ephemeral-group-p gnus-newsgroup-name) | |
5968 (gnus-summary-exit) | |
5969 (gnus-message 7 "No more%s articles (%s)..." | |
5970 (if unread " unread" "") | |
5971 (if group (concat "selecting " group) | |
5972 "exiting")) | |
5973 (gnus-summary-next-group nil group backward))) | |
5974 (t | |
5975 (when (gnus-key-press-event-p last-input-event) | |
5976 (gnus-summary-walk-group-buffer | |
5977 gnus-newsgroup-name cmd unread backward point)))))))) | |
5978 | |
5979 (defun gnus-summary-walk-group-buffer (from-group cmd unread backward start) | |
5980 (let ((keystrokes '((?\C-n (gnus-group-next-unread-group 1)) | |
5981 (?\C-p (gnus-group-prev-unread-group 1)))) | |
5982 (cursor-in-echo-area t) | |
5983 keve key group ended) | |
5984 (save-excursion | |
5985 (set-buffer gnus-group-buffer) | |
5986 (goto-char start) | |
5987 (setq group | |
5988 (if (eq gnus-keep-same-level 'best) | |
5989 (gnus-summary-best-group gnus-newsgroup-name) | |
5990 (gnus-summary-search-group backward gnus-keep-same-level)))) | |
5991 (while (not ended) | |
5992 (gnus-message | |
5993 5 "No more%s articles%s" (if unread " unread" "") | |
5994 (if (and group | |
5995 (not (gnus-ephemeral-group-p gnus-newsgroup-name))) | |
5996 (format " (Type %s for %s [%s])" | |
5997 (single-key-description cmd) group | |
5998 (car (gnus-gethash group gnus-newsrc-hashtb))) | |
5999 (format " (Type %s to exit %s)" | |
6000 (single-key-description cmd) | |
6001 gnus-newsgroup-name))) | |
6002 ;; Confirm auto selection. | |
6003 (setq key (car (setq keve (gnus-read-event-char)))) | |
6004 (setq ended t) | |
6005 (cond | |
6006 ((assq key keystrokes) | |
6007 (let ((obuf (current-buffer))) | |
6008 (switch-to-buffer gnus-group-buffer) | |
6009 (when group | |
6010 (gnus-group-jump-to-group group)) | |
6011 (eval (cadr (assq key keystrokes))) | |
6012 (setq group (gnus-group-group-name)) | |
6013 (switch-to-buffer obuf)) | |
6014 (setq ended nil)) | |
6015 ((equal key cmd) | |
6016 (if (or (not group) | |
6017 (gnus-ephemeral-group-p gnus-newsgroup-name)) | |
6018 (gnus-summary-exit) | |
6019 (gnus-summary-next-group nil group backward))) | |
6020 (t | |
6021 (push (cdr keve) unread-command-events)))))) | |
6022 | |
6023 (defun gnus-summary-next-unread-article () | |
6024 "Select unread article after current one." | |
6025 (interactive) | |
6026 (gnus-summary-next-article | |
6027 (or (not (eq gnus-summary-goto-unread 'never)) | |
6028 (gnus-summary-last-article-p (gnus-summary-article-number))) | |
6029 (and gnus-auto-select-same | |
6030 (gnus-summary-article-subject)))) | |
6031 | |
6032 (defun gnus-summary-prev-article (&optional unread subject) | |
6033 "Select the article after the current one. | |
6034 If UNREAD is non-nil, only unread articles are selected." | |
6035 (interactive "P") | |
6036 (gnus-summary-next-article unread subject t)) | |
6037 | |
6038 (defun gnus-summary-prev-unread-article () | |
6039 "Select unread article before current one." | |
6040 (interactive) | |
6041 (gnus-summary-prev-article | |
6042 (or (not (eq gnus-summary-goto-unread 'never)) | |
6043 (gnus-summary-first-article-p (gnus-summary-article-number))) | |
6044 (and gnus-auto-select-same | |
6045 (gnus-summary-article-subject)))) | |
6046 | |
6047 (defun gnus-summary-next-page (&optional lines circular) | |
6048 "Show next page of the selected article. | |
6049 If at the end of the current article, select the next article. | |
6050 LINES says how many lines should be scrolled up. | |
6051 | |
6052 If CIRCULAR is non-nil, go to the start of the article instead of | |
6053 selecting the next article when reaching the end of the current | |
6054 article." | |
6055 (interactive "P") | |
6056 (setq gnus-summary-buffer (current-buffer)) | |
6057 (gnus-set-global-variables) | |
6058 (let ((article (gnus-summary-article-number)) | |
6059 (article-window (get-buffer-window gnus-article-buffer t)) | |
6060 endp) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6061 ;; If the buffer is empty, we have no article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6062 (unless article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6063 (error "No article to select")) |
17493 | 6064 (gnus-configure-windows 'article) |
6065 (if (eq (cdr (assq article gnus-newsgroup-reads)) gnus-canceled-mark) | |
6066 (if (and (eq gnus-summary-goto-unread 'never) | |
6067 (not (gnus-summary-last-article-p article))) | |
6068 (gnus-summary-next-article) | |
6069 (gnus-summary-next-unread-article)) | |
6070 (if (or (null gnus-current-article) | |
6071 (null gnus-article-current) | |
6072 (/= article (cdr gnus-article-current)) | |
6073 (not (equal (car gnus-article-current) gnus-newsgroup-name))) | |
6074 ;; Selected subject is different from current article's. | |
6075 (gnus-summary-display-article article) | |
6076 (when article-window | |
6077 (gnus-eval-in-buffer-window gnus-article-buffer | |
6078 (setq endp (gnus-article-next-page lines))) | |
6079 (when endp | |
6080 (cond (circular | |
6081 (gnus-summary-beginning-of-article)) | |
6082 (lines | |
6083 (gnus-message 3 "End of message")) | |
6084 ((null lines) | |
6085 (if (and (eq gnus-summary-goto-unread 'never) | |
6086 (not (gnus-summary-last-article-p article))) | |
6087 (gnus-summary-next-article) | |
6088 (gnus-summary-next-unread-article)))))))) | |
6089 (gnus-summary-recenter) | |
6090 (gnus-summary-position-point))) | |
6091 | |
6092 (defun gnus-summary-prev-page (&optional lines move) | |
6093 "Show previous page of selected article. | |
6094 Argument LINES specifies lines to be scrolled down. | |
6095 If MOVE, move to the previous unread article if point is at | |
6096 the beginning of the buffer." | |
6097 (interactive "P") | |
6098 (let ((article (gnus-summary-article-number)) | |
6099 (article-window (get-buffer-window gnus-article-buffer t)) | |
6100 endp) | |
6101 (gnus-configure-windows 'article) | |
6102 (if (or (null gnus-current-article) | |
6103 (null gnus-article-current) | |
6104 (/= article (cdr gnus-article-current)) | |
6105 (not (equal (car gnus-article-current) gnus-newsgroup-name))) | |
6106 ;; Selected subject is different from current article's. | |
6107 (gnus-summary-display-article article) | |
6108 (gnus-summary-recenter) | |
6109 (when article-window | |
6110 (gnus-eval-in-buffer-window gnus-article-buffer | |
6111 (setq endp (gnus-article-prev-page lines))) | |
6112 (when (and move endp) | |
6113 (cond (lines | |
6114 (gnus-message 3 "Beginning of message")) | |
6115 ((null lines) | |
6116 (if (and (eq gnus-summary-goto-unread 'never) | |
6117 (not (gnus-summary-first-article-p article))) | |
6118 (gnus-summary-prev-article) | |
6119 (gnus-summary-prev-unread-article)))))))) | |
6120 (gnus-summary-position-point)) | |
6121 | |
6122 (defun gnus-summary-prev-page-or-article (&optional lines) | |
6123 "Show previous page of selected article. | |
6124 Argument LINES specifies lines to be scrolled down. | |
6125 If at the beginning of the article, go to the next article." | |
6126 (interactive "P") | |
6127 (gnus-summary-prev-page lines t)) | |
6128 | |
6129 (defun gnus-summary-scroll-up (lines) | |
6130 "Scroll up (or down) one line current article. | |
6131 Argument LINES specifies lines to be scrolled up (or down if negative)." | |
6132 (interactive "p") | |
6133 (gnus-configure-windows 'article) | |
6134 (gnus-summary-show-thread) | |
6135 (when (eq (gnus-summary-select-article nil nil 'pseudo) 'old) | |
6136 (gnus-eval-in-buffer-window gnus-article-buffer | |
6137 (cond ((> lines 0) | |
6138 (when (gnus-article-next-page lines) | |
6139 (gnus-message 3 "End of message"))) | |
6140 ((< lines 0) | |
6141 (gnus-article-prev-page (- lines)))))) | |
6142 (gnus-summary-recenter) | |
6143 (gnus-summary-position-point)) | |
6144 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6145 (defun gnus-summary-scroll-down (lines) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6146 "Scroll down (or up) one line current article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6147 Argument LINES specifies lines to be scrolled down (or up if negative)." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6148 (interactive "p") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6149 (gnus-summary-scroll-up (- lines))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6150 |
17493 | 6151 (defun gnus-summary-next-same-subject () |
6152 "Select next article which has the same subject as current one." | |
6153 (interactive) | |
6154 (gnus-summary-next-article nil (gnus-summary-article-subject))) | |
6155 | |
6156 (defun gnus-summary-prev-same-subject () | |
6157 "Select previous article which has the same subject as current one." | |
6158 (interactive) | |
6159 (gnus-summary-prev-article nil (gnus-summary-article-subject))) | |
6160 | |
6161 (defun gnus-summary-next-unread-same-subject () | |
6162 "Select next unread article which has the same subject as current one." | |
6163 (interactive) | |
6164 (gnus-summary-next-article t (gnus-summary-article-subject))) | |
6165 | |
6166 (defun gnus-summary-prev-unread-same-subject () | |
6167 "Select previous unread article which has the same subject as current one." | |
6168 (interactive) | |
6169 (gnus-summary-prev-article t (gnus-summary-article-subject))) | |
6170 | |
6171 (defun gnus-summary-first-unread-article () | |
6172 "Select the first unread article. | |
6173 Return nil if there are no unread articles." | |
6174 (interactive) | |
6175 (prog1 | |
6176 (when (gnus-summary-first-subject t) | |
6177 (gnus-summary-show-thread) | |
6178 (gnus-summary-first-subject t) | |
6179 (gnus-summary-display-article (gnus-summary-article-number))) | |
6180 (gnus-summary-position-point))) | |
6181 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6182 (defun gnus-summary-first-unread-subject () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6183 "Place the point on the subject line of the first unread article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6184 Return nil if there are no unread articles." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6185 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6186 (prog1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6187 (when (gnus-summary-first-subject t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6188 (gnus-summary-show-thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6189 (gnus-summary-first-subject t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6190 (gnus-summary-position-point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6191 |
17493 | 6192 (defun gnus-summary-first-article () |
6193 "Select the first article. | |
6194 Return nil if there are no articles." | |
6195 (interactive) | |
6196 (prog1 | |
6197 (when (gnus-summary-first-subject) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6198 (gnus-summary-show-thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6199 (gnus-summary-first-subject) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6200 (gnus-summary-display-article (gnus-summary-article-number))) |
17493 | 6201 (gnus-summary-position-point))) |
6202 | |
6203 (defun gnus-summary-best-unread-article () | |
6204 "Select the unread article with the highest score." | |
6205 (interactive) | |
6206 (let ((best -1000000) | |
6207 (data gnus-newsgroup-data) | |
6208 article score) | |
6209 (while data | |
6210 (and (gnus-data-unread-p (car data)) | |
6211 (> (setq score | |
6212 (gnus-summary-article-score (gnus-data-number (car data)))) | |
6213 best) | |
6214 (setq best score | |
6215 article (gnus-data-number (car data)))) | |
6216 (setq data (cdr data))) | |
6217 (prog1 | |
6218 (if article | |
6219 (gnus-summary-goto-article article) | |
6220 (error "No unread articles")) | |
6221 (gnus-summary-position-point)))) | |
6222 | |
6223 (defun gnus-summary-last-subject () | |
6224 "Go to the last displayed subject line in the group." | |
6225 (let ((article (gnus-data-number (car (gnus-data-list t))))) | |
6226 (when article | |
6227 (gnus-summary-goto-subject article)))) | |
6228 | |
6229 (defun gnus-summary-goto-article (article &optional all-headers force) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6230 "Fetch ARTICLE (article number or Message-ID) and display it if it exists. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6231 If ALL-HEADERS is non-nil, no header lines are hidden. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6232 If FORCE, go to the article even if it isn't displayed. If FORCE |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6233 is a number, it is the line the article is to be displayed on." |
17493 | 6234 (interactive |
6235 (list | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6236 (completing-read |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6237 "Article number or Message-ID: " |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6238 (mapcar (lambda (number) (list (int-to-string number))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6239 gnus-newsgroup-limit)) |
17493 | 6240 current-prefix-arg |
6241 t)) | |
6242 (prog1 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6243 (if (and (stringp article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6244 (string-match "@" article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6245 (gnus-summary-refer-article article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6246 (when (stringp article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6247 (setq article (string-to-number article))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6248 (if (gnus-summary-goto-subject article force) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6249 (gnus-summary-display-article article all-headers) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6250 (gnus-message 4 "Couldn't go to article %s" article) nil)) |
17493 | 6251 (gnus-summary-position-point))) |
6252 | |
6253 (defun gnus-summary-goto-last-article () | |
6254 "Go to the previously read article." | |
6255 (interactive) | |
6256 (prog1 | |
6257 (when gnus-last-article | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6258 (gnus-summary-goto-article gnus-last-article nil t)) |
17493 | 6259 (gnus-summary-position-point))) |
6260 | |
6261 (defun gnus-summary-pop-article (number) | |
6262 "Pop one article off the history and go to the previous. | |
6263 NUMBER articles will be popped off." | |
6264 (interactive "p") | |
6265 (let (to) | |
6266 (setq gnus-newsgroup-history | |
6267 (cdr (setq to (nthcdr number gnus-newsgroup-history)))) | |
6268 (if to | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6269 (gnus-summary-goto-article (car to) nil t) |
17493 | 6270 (error "Article history empty"))) |
6271 (gnus-summary-position-point)) | |
6272 | |
6273 ;; Summary commands and functions for limiting the summary buffer. | |
6274 | |
6275 (defun gnus-summary-limit-to-articles (n) | |
6276 "Limit the summary buffer to the next N articles. | |
6277 If not given a prefix, use the process marked articles instead." | |
6278 (interactive "P") | |
6279 (prog1 | |
6280 (let ((articles (gnus-summary-work-articles n))) | |
6281 (setq gnus-newsgroup-processable nil) | |
6282 (gnus-summary-limit articles)) | |
6283 (gnus-summary-position-point))) | |
6284 | |
6285 (defun gnus-summary-pop-limit (&optional total) | |
6286 "Restore the previous limit. | |
6287 If given a prefix, remove all limits." | |
6288 (interactive "P") | |
6289 (when total | |
6290 (setq gnus-newsgroup-limits | |
6291 (list (mapcar (lambda (h) (mail-header-number h)) | |
6292 gnus-newsgroup-headers)))) | |
6293 (unless gnus-newsgroup-limits | |
6294 (error "No limit to pop")) | |
6295 (prog1 | |
6296 (gnus-summary-limit nil 'pop) | |
6297 (gnus-summary-position-point))) | |
6298 | |
6299 (defun gnus-summary-limit-to-subject (subject &optional header) | |
6300 "Limit the summary buffer to articles that have subjects that match a regexp." | |
6301 (interactive "sLimit to subject (regexp): ") | |
6302 (unless header | |
6303 (setq header "subject")) | |
6304 (when (not (equal "" subject)) | |
6305 (prog1 | |
6306 (let ((articles (gnus-summary-find-matching | |
6307 (or header "subject") subject 'all))) | |
6308 (unless articles | |
6309 (error "Found no matches for \"%s\"" subject)) | |
6310 (gnus-summary-limit articles)) | |
6311 (gnus-summary-position-point)))) | |
6312 | |
6313 (defun gnus-summary-limit-to-author (from) | |
6314 "Limit the summary buffer to articles that have authors that match a regexp." | |
6315 (interactive "sLimit to author (regexp): ") | |
6316 (gnus-summary-limit-to-subject from "from")) | |
6317 | |
6318 (defun gnus-summary-limit-to-age (age &optional younger-p) | |
6319 "Limit the summary buffer to articles that are older than (or equal) AGE days. | |
6320 If YOUNGER-P (the prefix) is non-nil, limit the summary buffer to | |
6321 articles that are younger than AGE days." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6322 (interactive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6323 (let ((younger current-prefix-arg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6324 (days-got nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6325 days) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6326 (while (not days-got) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6327 (setq days (if younger |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6328 (read-string "Limit to articles within (in days): ") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6329 (read-string "Limit to articles old than (in days): "))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6330 (when (> (length days) 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6331 (setq days (read days))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6332 (if (numberp days) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6333 (setq days-got t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6334 (message "Please enter a number.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6335 (sleep-for 1))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6336 (list days younger))) |
17493 | 6337 (prog1 |
6338 (let ((data gnus-newsgroup-data) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6339 (cutoff (days-to-time age)) |
17493 | 6340 articles d date is-younger) |
6341 (while (setq d (pop data)) | |
6342 (when (and (vectorp (gnus-data-header d)) | |
6343 (setq date (mail-header-date (gnus-data-header d)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6344 (setq is-younger (time-less-p |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6345 (time-since (condition-case () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6346 (date-to-time date) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6347 (error '(0 0)))) |
17493 | 6348 cutoff)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6349 (when (if younger-p |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6350 is-younger |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6351 (not is-younger)) |
17493 | 6352 (push (gnus-data-number d) articles)))) |
6353 (gnus-summary-limit (nreverse articles))) | |
6354 (gnus-summary-position-point))) | |
6355 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6356 (defun gnus-summary-limit-to-extra (header regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6357 "Limit the summary buffer to articles that match an 'extra' header." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6358 (interactive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6359 (let ((header |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6360 (intern |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6361 (gnus-completing-read |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6362 (symbol-name (car gnus-extra-headers)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6363 "Limit extra header:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6364 (mapcar (lambda (x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6365 (cons (symbol-name x) x)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6366 gnus-extra-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6367 nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6368 t)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6369 (list header |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6370 (read-string (format "Limit to header %s (regexp): " header))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6371 (when (not (equal "" regexp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6372 (prog1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6373 (let ((articles (gnus-summary-find-matching |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6374 (cons 'extra header) regexp 'all))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6375 (unless articles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6376 (error "Found no matches for \"%s\"" regexp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6377 (gnus-summary-limit articles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6378 (gnus-summary-position-point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6379 |
17493 | 6380 (defalias 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread) |
6381 (make-obsolete | |
6382 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread) | |
6383 | |
6384 (defun gnus-summary-limit-to-unread (&optional all) | |
6385 "Limit the summary buffer to articles that are not marked as read. | |
6386 If ALL is non-nil, limit strictly to unread articles." | |
6387 (interactive "P") | |
6388 (if all | |
6389 (gnus-summary-limit-to-marks (char-to-string gnus-unread-mark)) | |
6390 (gnus-summary-limit-to-marks | |
6391 ;; Concat all the marks that say that an article is read and have | |
6392 ;; those removed. | |
6393 (list gnus-del-mark gnus-read-mark gnus-ancient-mark | |
6394 gnus-killed-mark gnus-kill-file-mark | |
6395 gnus-low-score-mark gnus-expirable-mark | |
6396 gnus-canceled-mark gnus-catchup-mark gnus-sparse-mark | |
6397 gnus-duplicate-mark gnus-souped-mark) | |
6398 'reverse))) | |
6399 | |
6400 (defalias 'gnus-summary-delete-marked-with 'gnus-summary-limit-exclude-marks) | |
6401 (make-obsolete 'gnus-summary-delete-marked-with | |
6402 'gnus-summary-limit-exlude-marks) | |
6403 | |
6404 (defun gnus-summary-limit-exclude-marks (marks &optional reverse) | |
6405 "Exclude articles that are marked with MARKS (e.g. \"DK\"). | |
6406 If REVERSE, limit the summary buffer to articles that are marked | |
6407 with MARKS. MARKS can either be a string of marks or a list of marks. | |
6408 Returns how many articles were removed." | |
6409 (interactive "sMarks: ") | |
6410 (gnus-summary-limit-to-marks marks t)) | |
6411 | |
6412 (defun gnus-summary-limit-to-marks (marks &optional reverse) | |
6413 "Limit the summary buffer to articles that are marked with MARKS (e.g. \"DK\"). | |
6414 If REVERSE (the prefix), limit the summary buffer to articles that are | |
6415 not marked with MARKS. MARKS can either be a string of marks or a | |
6416 list of marks. | |
6417 Returns how many articles were removed." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6418 (interactive "sMarks: \nP") |
17493 | 6419 (prog1 |
6420 (let ((data gnus-newsgroup-data) | |
6421 (marks (if (listp marks) marks | |
6422 (append marks nil))) ; Transform to list. | |
6423 articles) | |
6424 (while data | |
6425 (when (if reverse (not (memq (gnus-data-mark (car data)) marks)) | |
6426 (memq (gnus-data-mark (car data)) marks)) | |
6427 (push (gnus-data-number (car data)) articles)) | |
6428 (setq data (cdr data))) | |
6429 (gnus-summary-limit articles)) | |
6430 (gnus-summary-position-point))) | |
6431 | |
6432 (defun gnus-summary-limit-to-score (&optional score) | |
6433 "Limit to articles with score at or above SCORE." | |
6434 (interactive "P") | |
6435 (setq score (if score | |
6436 (prefix-numeric-value score) | |
6437 (or gnus-summary-default-score 0))) | |
6438 (let ((data gnus-newsgroup-data) | |
6439 articles) | |
6440 (while data | |
6441 (when (>= (gnus-summary-article-score (gnus-data-number (car data))) | |
6442 score) | |
6443 (push (gnus-data-number (car data)) articles)) | |
6444 (setq data (cdr data))) | |
6445 (prog1 | |
6446 (gnus-summary-limit articles) | |
6447 (gnus-summary-position-point)))) | |
6448 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6449 (defun gnus-summary-limit-include-thread (id) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6450 "Display all the hidden articles that in the current thread." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6451 (interactive (list (mail-header-id (gnus-summary-article-header)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6452 (let ((articles (gnus-articles-in-thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6453 (gnus-id-to-thread (gnus-root-id id))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6454 (prog1 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6455 (gnus-summary-limit (nconc articles gnus-newsgroup-limit)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6456 (gnus-summary-position-point)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6457 |
17493 | 6458 (defun gnus-summary-limit-include-dormant () |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6459 "Display all the hidden articles that are marked as dormant. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6460 Note that this command only works on a subset of the articles currently |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6461 fetched for this group." |
17493 | 6462 (interactive) |
6463 (unless gnus-newsgroup-dormant | |
6464 (error "There are no dormant articles in this group")) | |
6465 (prog1 | |
6466 (gnus-summary-limit (append gnus-newsgroup-dormant gnus-newsgroup-limit)) | |
6467 (gnus-summary-position-point))) | |
6468 | |
6469 (defun gnus-summary-limit-exclude-dormant () | |
6470 "Hide all dormant articles." | |
6471 (interactive) | |
6472 (prog1 | |
6473 (gnus-summary-limit-to-marks (list gnus-dormant-mark) 'reverse) | |
6474 (gnus-summary-position-point))) | |
6475 | |
6476 (defun gnus-summary-limit-exclude-childless-dormant () | |
6477 "Hide all dormant articles that have no children." | |
6478 (interactive) | |
6479 (let ((data (gnus-data-list t)) | |
6480 articles d children) | |
6481 ;; Find all articles that are either not dormant or have | |
6482 ;; children. | |
6483 (while (setq d (pop data)) | |
6484 (when (or (not (= (gnus-data-mark d) gnus-dormant-mark)) | |
6485 (and (setq children | |
6486 (gnus-article-children (gnus-data-number d))) | |
6487 (let (found) | |
6488 (while children | |
6489 (when (memq (car children) articles) | |
6490 (setq children nil | |
6491 found t)) | |
6492 (pop children)) | |
6493 found))) | |
6494 (push (gnus-data-number d) articles))) | |
6495 ;; Do the limiting. | |
6496 (prog1 | |
6497 (gnus-summary-limit articles) | |
6498 (gnus-summary-position-point)))) | |
6499 | |
6500 (defun gnus-summary-limit-mark-excluded-as-read (&optional all) | |
6501 "Mark all unread excluded articles as read. | |
6502 If ALL, mark even excluded ticked and dormants as read." | |
6503 (interactive "P") | |
6504 (let ((articles (gnus-sorted-complement | |
6505 (sort | |
6506 (mapcar (lambda (h) (mail-header-number h)) | |
6507 gnus-newsgroup-headers) | |
6508 '<) | |
6509 (sort gnus-newsgroup-limit '<))) | |
6510 article) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6511 (setq gnus-newsgroup-unreads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6512 (gnus-intersection gnus-newsgroup-unreads gnus-newsgroup-limit)) |
17493 | 6513 (if all |
6514 (setq gnus-newsgroup-dormant nil | |
6515 gnus-newsgroup-marked nil | |
6516 gnus-newsgroup-reads | |
6517 (nconc | |
6518 (mapcar (lambda (n) (cons n gnus-catchup-mark)) articles) | |
6519 gnus-newsgroup-reads)) | |
6520 (while (setq article (pop articles)) | |
6521 (unless (or (memq article gnus-newsgroup-dormant) | |
6522 (memq article gnus-newsgroup-marked)) | |
6523 (push (cons article gnus-catchup-mark) gnus-newsgroup-reads)))))) | |
6524 | |
6525 (defun gnus-summary-limit (articles &optional pop) | |
6526 (if pop | |
6527 ;; We pop the previous limit off the stack and use that. | |
6528 (setq articles (car gnus-newsgroup-limits) | |
6529 gnus-newsgroup-limits (cdr gnus-newsgroup-limits)) | |
6530 ;; We use the new limit, so we push the old limit on the stack. | |
6531 (push gnus-newsgroup-limit gnus-newsgroup-limits)) | |
6532 ;; Set the limit. | |
6533 (setq gnus-newsgroup-limit articles) | |
6534 (let ((total (length gnus-newsgroup-data)) | |
6535 (data (gnus-data-find-list (gnus-summary-article-number))) | |
6536 (gnus-summary-mark-below nil) ; Inhibit this. | |
6537 found) | |
6538 ;; This will do all the work of generating the new summary buffer | |
6539 ;; according to the new limit. | |
6540 (gnus-summary-prepare) | |
6541 ;; Hide any threads, possibly. | |
6542 (and gnus-show-threads | |
6543 gnus-thread-hide-subtree | |
6544 (gnus-summary-hide-all-threads)) | |
6545 ;; Try to return to the article you were at, or one in the | |
6546 ;; neighborhood. | |
6547 (when data | |
6548 ;; We try to find some article after the current one. | |
6549 (while data | |
6550 (when (gnus-summary-goto-subject (gnus-data-number (car data)) nil t) | |
6551 (setq data nil | |
6552 found t)) | |
6553 (setq data (cdr data)))) | |
6554 (unless found | |
6555 ;; If there is no data, that means that we were after the last | |
6556 ;; article. The same goes when we can't find any articles | |
6557 ;; after the current one. | |
6558 (goto-char (point-max)) | |
6559 (gnus-summary-find-prev)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6560 (gnus-set-mode-line 'summary) |
17493 | 6561 ;; We return how many articles were removed from the summary |
6562 ;; buffer as a result of the new limit. | |
6563 (- total (length gnus-newsgroup-data)))) | |
6564 | |
6565 (defsubst gnus-invisible-cut-children (threads) | |
6566 (let ((num 0)) | |
6567 (while threads | |
6568 (when (memq (mail-header-number (caar threads)) gnus-newsgroup-limit) | |
6569 (incf num)) | |
6570 (pop threads)) | |
6571 (< num 2))) | |
6572 | |
6573 (defsubst gnus-cut-thread (thread) | |
6574 "Go forwards in the thread until we find an article that we want to display." | |
6575 (when (or (eq gnus-fetch-old-headers 'some) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6576 (eq gnus-fetch-old-headers 'invisible) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6577 (numberp gnus-fetch-old-headers) |
17493 | 6578 (eq gnus-build-sparse-threads 'some) |
6579 (eq gnus-build-sparse-threads 'more)) | |
6580 ;; Deal with old-fetched headers and sparse threads. | |
6581 (while (and | |
6582 thread | |
6583 (or | |
6584 (gnus-summary-article-sparse-p (mail-header-number (car thread))) | |
6585 (gnus-summary-article-ancient-p | |
6586 (mail-header-number (car thread)))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6587 (if (or (<= (length (cdr thread)) 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6588 (eq gnus-fetch-old-headers 'invisible)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6589 (setq gnus-newsgroup-limit |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6590 (delq (mail-header-number (car thread)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6591 gnus-newsgroup-limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6592 thread (cadr thread)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6593 (when (gnus-invisible-cut-children (cdr thread)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6594 (let ((th (cdr thread))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6595 (while th |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6596 (if (memq (mail-header-number (caar th)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6597 gnus-newsgroup-limit) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6598 (setq thread (car th) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6599 th nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6600 (setq th (cdr th)))))))))) |
17493 | 6601 thread) |
6602 | |
6603 (defun gnus-cut-threads (threads) | |
6604 "Cut off all uninteresting articles from the beginning of threads." | |
6605 (when (or (eq gnus-fetch-old-headers 'some) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6606 (eq gnus-fetch-old-headers 'invisible) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6607 (numberp gnus-fetch-old-headers) |
17493 | 6608 (eq gnus-build-sparse-threads 'some) |
6609 (eq gnus-build-sparse-threads 'more)) | |
6610 (let ((th threads)) | |
6611 (while th | |
6612 (setcar th (gnus-cut-thread (car th))) | |
6613 (setq th (cdr th))))) | |
6614 ;; Remove nixed out threads. | |
6615 (delq nil threads)) | |
6616 | |
6617 (defun gnus-summary-initial-limit (&optional show-if-empty) | |
6618 "Figure out what the initial limit is supposed to be on group entry. | |
6619 This entails weeding out unwanted dormants, low-scored articles, | |
6620 fetch-old-headers verbiage, and so on." | |
6621 ;; Most groups have nothing to remove. | |
6622 (if (or gnus-inhibit-limiting | |
6623 (and (null gnus-newsgroup-dormant) | |
6624 (not (eq gnus-fetch-old-headers 'some)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6625 (not (numberp gnus-fetch-old-headers)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6626 (not (eq gnus-fetch-old-headers 'invisible)) |
17493 | 6627 (null gnus-summary-expunge-below) |
6628 (not (eq gnus-build-sparse-threads 'some)) | |
6629 (not (eq gnus-build-sparse-threads 'more)) | |
6630 (null gnus-thread-expunge-below) | |
6631 (not gnus-use-nocem))) | |
6632 () ; Do nothing. | |
6633 (push gnus-newsgroup-limit gnus-newsgroup-limits) | |
6634 (setq gnus-newsgroup-limit nil) | |
6635 (mapatoms | |
6636 (lambda (node) | |
6637 (unless (car (symbol-value node)) | |
6638 ;; These threads have no parents -- they are roots. | |
6639 (let ((nodes (cdr (symbol-value node))) | |
6640 thread) | |
6641 (while nodes | |
6642 (if (and gnus-thread-expunge-below | |
6643 (< (gnus-thread-total-score (car nodes)) | |
6644 gnus-thread-expunge-below)) | |
6645 (gnus-expunge-thread (pop nodes)) | |
6646 (setq thread (pop nodes)) | |
6647 (gnus-summary-limit-children thread)))))) | |
6648 gnus-newsgroup-dependencies) | |
6649 ;; If this limitation resulted in an empty group, we might | |
6650 ;; pop the previous limit and use it instead. | |
6651 (when (and (not gnus-newsgroup-limit) | |
6652 show-if-empty) | |
6653 (setq gnus-newsgroup-limit (pop gnus-newsgroup-limits))) | |
6654 gnus-newsgroup-limit)) | |
6655 | |
6656 (defun gnus-summary-limit-children (thread) | |
6657 "Return 1 if this subthread is visible and 0 if it is not." | |
6658 ;; First we get the number of visible children to this thread. This | |
6659 ;; is done by recursing down the thread using this function, so this | |
6660 ;; will really go down to a leaf article first, before slowly | |
6661 ;; working its way up towards the root. | |
6662 (when thread | |
6663 (let ((children | |
6664 (if (cdr thread) | |
6665 (apply '+ (mapcar 'gnus-summary-limit-children | |
6666 (cdr thread))) | |
6667 0)) | |
6668 (number (mail-header-number (car thread))) | |
6669 score) | |
6670 (if (and | |
6671 (not (memq number gnus-newsgroup-marked)) | |
6672 (or | |
6673 ;; If this article is dormant and has absolutely no visible | |
6674 ;; children, then this article isn't visible. | |
6675 (and (memq number gnus-newsgroup-dormant) | |
6676 (zerop children)) | |
6677 ;; If this is "fetch-old-headered" and there is no | |
6678 ;; visible children, then we don't want this article. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6679 (and (or (eq gnus-fetch-old-headers 'some) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6680 (numberp gnus-fetch-old-headers)) |
17493 | 6681 (gnus-summary-article-ancient-p number) |
6682 (zerop children)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6683 ;; If this is "fetch-old-headered" and `invisible', then |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6684 ;; we don't want this article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6685 (and (eq gnus-fetch-old-headers 'invisible) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6686 (gnus-summary-article-ancient-p number)) |
17493 | 6687 ;; If this is a sparsely inserted article with no children, |
6688 ;; we don't want it. | |
6689 (and (eq gnus-build-sparse-threads 'some) | |
6690 (gnus-summary-article-sparse-p number) | |
6691 (zerop children)) | |
6692 ;; If we use expunging, and this article is really | |
6693 ;; low-scored, then we don't want this article. | |
6694 (when (and gnus-summary-expunge-below | |
6695 (< (setq score | |
6696 (or (cdr (assq number gnus-newsgroup-scored)) | |
6697 gnus-summary-default-score)) | |
6698 gnus-summary-expunge-below)) | |
6699 ;; We increase the expunge-tally here, but that has | |
6700 ;; nothing to do with the limits, really. | |
6701 (incf gnus-newsgroup-expunged-tally) | |
6702 ;; We also mark as read here, if that's wanted. | |
6703 (when (and gnus-summary-mark-below | |
6704 (< score gnus-summary-mark-below)) | |
6705 (setq gnus-newsgroup-unreads | |
6706 (delq number gnus-newsgroup-unreads)) | |
6707 (if gnus-newsgroup-auto-expire | |
6708 (push number gnus-newsgroup-expirable) | |
6709 (push (cons number gnus-low-score-mark) | |
6710 gnus-newsgroup-reads))) | |
6711 t) | |
6712 ;; Check NoCeM things. | |
6713 (if (and gnus-use-nocem | |
6714 (gnus-nocem-unwanted-article-p | |
6715 (mail-header-id (car thread)))) | |
6716 (progn | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6717 (setq gnus-newsgroup-unreads |
17493 | 6718 (delq number gnus-newsgroup-unreads)) |
6719 t)))) | |
6720 ;; Nope, invisible article. | |
6721 0 | |
6722 ;; Ok, this article is to be visible, so we add it to the limit | |
6723 ;; and return 1. | |
6724 (push number gnus-newsgroup-limit) | |
6725 1)))) | |
6726 | |
6727 (defun gnus-expunge-thread (thread) | |
6728 "Mark all articles in THREAD as read." | |
6729 (let* ((number (mail-header-number (car thread)))) | |
6730 (incf gnus-newsgroup-expunged-tally) | |
6731 ;; We also mark as read here, if that's wanted. | |
6732 (setq gnus-newsgroup-unreads | |
6733 (delq number gnus-newsgroup-unreads)) | |
6734 (if gnus-newsgroup-auto-expire | |
6735 (push number gnus-newsgroup-expirable) | |
6736 (push (cons number gnus-low-score-mark) | |
6737 gnus-newsgroup-reads))) | |
6738 ;; Go recursively through all subthreads. | |
6739 (mapcar 'gnus-expunge-thread (cdr thread))) | |
6740 | |
6741 ;; Summary article oriented commands | |
6742 | |
6743 (defun gnus-summary-refer-parent-article (n) | |
6744 "Refer parent article N times. | |
6745 If N is negative, go to ancestor -N instead. | |
6746 The difference between N and the number of articles fetched is returned." | |
6747 (interactive "p") | |
6748 (let ((skip 1) | |
6749 error header ref) | |
6750 (when (not (natnump n)) | |
6751 (setq skip (abs n) | |
6752 n 1)) | |
6753 (while (and (> n 0) | |
6754 (not error)) | |
6755 (setq header (gnus-summary-article-header)) | |
6756 (if (and (eq (mail-header-number header) | |
6757 (cdr gnus-article-current)) | |
6758 (equal gnus-newsgroup-name | |
6759 (car gnus-article-current))) | |
6760 ;; If we try to find the parent of the currently | |
6761 ;; displayed article, then we take a look at the actual | |
6762 ;; References header, since this is slightly more | |
6763 ;; reliable than the References field we got from the | |
6764 ;; server. | |
6765 (save-excursion | |
6766 (set-buffer gnus-original-article-buffer) | |
6767 (nnheader-narrow-to-headers) | |
6768 (unless (setq ref (message-fetch-field "references")) | |
6769 (setq ref (message-fetch-field "in-reply-to"))) | |
6770 (widen)) | |
6771 (setq ref | |
6772 ;; It's not the current article, so we take a bet on | |
6773 ;; the value we got from the server. | |
6774 (mail-header-references header))) | |
6775 (if (and ref | |
6776 (not (equal ref ""))) | |
6777 (unless (gnus-summary-refer-article (gnus-parent-id ref skip)) | |
6778 (gnus-message 1 "Couldn't find parent")) | |
6779 (gnus-message 1 "No references in article %d" | |
6780 (gnus-summary-article-number)) | |
6781 (setq error t)) | |
6782 (decf n)) | |
6783 (gnus-summary-position-point) | |
6784 n)) | |
6785 | |
6786 (defun gnus-summary-refer-references () | |
6787 "Fetch all articles mentioned in the References header. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6788 Return the number of articles fetched." |
17493 | 6789 (interactive) |
6790 (let ((ref (mail-header-references (gnus-summary-article-header))) | |
6791 (current (gnus-summary-article-number)) | |
6792 (n 0)) | |
6793 (if (or (not ref) | |
6794 (equal ref "")) | |
6795 (error "No References in the current article") | |
6796 ;; For each Message-ID in the References header... | |
6797 (while (string-match "<[^>]*>" ref) | |
6798 (incf n) | |
6799 ;; ... fetch that article. | |
6800 (gnus-summary-refer-article | |
6801 (prog1 (match-string 0 ref) | |
6802 (setq ref (substring ref (match-end 0)))))) | |
6803 (gnus-summary-goto-subject current) | |
6804 (gnus-summary-position-point) | |
6805 n))) | |
6806 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6807 (defun gnus-summary-refer-thread (&optional limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6808 "Fetch all articles in the current thread. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6809 If LIMIT (the numerical prefix), fetch that many old headers instead |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6810 of what's specified by the `gnus-refer-thread-limit' variable." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6811 (interactive "P") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6812 (let ((id (mail-header-id (gnus-summary-article-header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6813 (limit (if limit (prefix-numeric-value limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6814 gnus-refer-thread-limit))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6815 ;; We want to fetch LIMIT *old* headers, but we also have to |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6816 ;; re-fetch all the headers in the current buffer, because many of |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6817 ;; them may be undisplayed. So we adjust LIMIT. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6818 (when (numberp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6819 (incf limit (- gnus-newsgroup-end gnus-newsgroup-begin))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6820 (unless (eq gnus-fetch-old-headers 'invisible) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6821 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6822 ;; Retrieve the headers and read them in. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6823 (if (eq (gnus-retrieve-headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6824 (list gnus-newsgroup-end) gnus-newsgroup-name limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6825 'nov) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6826 (gnus-build-all-threads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6827 (error "Can't fetch thread from backends that don't support NOV")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6828 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6829 (gnus-summary-limit-include-thread id))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6830 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6831 (defun gnus-summary-refer-article (message-id) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6832 "Fetch an article specified by MESSAGE-ID." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6833 (interactive "sMessage-ID: ") |
17493 | 6834 (when (and (stringp message-id) |
6835 (not (zerop (length message-id)))) | |
6836 ;; Construct the correct Message-ID if necessary. | |
6837 ;; Suggested by tale@pawl.rpi.edu. | |
6838 (unless (string-match "^<" message-id) | |
6839 (setq message-id (concat "<" message-id))) | |
6840 (unless (string-match ">$" message-id) | |
6841 (setq message-id (concat message-id ">"))) | |
6842 (let* ((header (gnus-id-to-header message-id)) | |
6843 (sparse (and header | |
6844 (gnus-summary-article-sparse-p | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6845 (mail-header-number header)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6846 (memq (mail-header-number header) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6847 gnus-newsgroup-limit))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6848 number) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6849 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6850 ;; If the article is present in the buffer we just go to it. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6851 ((and header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6852 (or (not (gnus-summary-article-sparse-p |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6853 (mail-header-number header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6854 sparse)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6855 (prog1 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6856 (gnus-summary-goto-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6857 (mail-header-number header) nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6858 (when sparse |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6859 (gnus-summary-update-article (mail-header-number header))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6860 (t |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6861 ;; We fetch the article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6862 (catch 'found |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6863 (dolist (gnus-override-method (gnus-refer-article-methods)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6864 (gnus-check-server gnus-override-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6865 ;; Fetch the header, and display the article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6866 (when (setq number (gnus-summary-insert-subject message-id)) |
17493 | 6867 (gnus-summary-select-article nil nil nil number) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6868 (throw 'found t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6869 (gnus-message 3 "Couldn't fetch article %s" message-id))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6870 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6871 (defun gnus-refer-article-methods () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6872 "Return a list of referrable methods." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6873 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6874 ;; No method, so we default to current and native. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6875 ((null gnus-refer-article-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6876 (list gnus-current-select-method gnus-select-method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6877 ;; Current. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6878 ((eq 'current gnus-refer-article-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6879 (list gnus-current-select-method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6880 ;; List of select methods. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6881 ((not (stringp (cadr gnus-refer-article-method))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6882 (let (out) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6883 (dolist (method gnus-refer-article-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6884 (push (if (eq 'current method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6885 gnus-current-select-method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6886 method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6887 out)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6888 (nreverse out))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6889 ;; One single select method. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6890 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6891 (list gnus-refer-article-method)))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6892 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6893 (defun gnus-summary-edit-parameters () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6894 "Edit the group parameters of the current group." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6895 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6896 (gnus-group-edit-group gnus-newsgroup-name 'params)) |
17493 | 6897 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6898 (defun gnus-summary-customize-parameters () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6899 "Customize the group parameters of the current group." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6900 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6901 (gnus-group-customize gnus-newsgroup-name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6902 |
17493 | 6903 (defun gnus-summary-enter-digest-group (&optional force) |
6904 "Enter an nndoc group based on the current article. | |
6905 If FORCE, force a digest interpretation. If not, try | |
6906 to guess what the document format is." | |
6907 (interactive "P") | |
6908 (let ((conf gnus-current-window-configuration)) | |
6909 (save-excursion | |
6910 (gnus-summary-select-article)) | |
6911 (setq gnus-current-window-configuration conf) | |
6912 (let* ((name (format "%s-%d" | |
6913 (gnus-group-prefixed-name | |
6914 gnus-newsgroup-name (list 'nndoc "")) | |
6915 (save-excursion | |
6916 (set-buffer gnus-summary-buffer) | |
6917 gnus-current-article))) | |
6918 (ogroup gnus-newsgroup-name) | |
6919 (params (append (gnus-info-params (gnus-get-info ogroup)) | |
6920 (list (cons 'to-group ogroup)) | |
6921 (list (cons 'save-article-group ogroup)))) | |
6922 (case-fold-search t) | |
6923 (buf (current-buffer)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6924 dig to-address) |
17493 | 6925 (save-excursion |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6926 (set-buffer gnus-original-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6927 ;; Have the digest group inherit the main mail address of |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6928 ;; the parent article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6929 (when (setq to-address (or (message-fetch-field "reply-to") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6930 (message-fetch-field "from"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6931 (setq params (append (list (cons 'to-address to-address))))) |
17493 | 6932 (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*")) |
6933 (insert-buffer-substring gnus-original-article-buffer) | |
6934 ;; Remove lines that may lead nndoc to misinterpret the | |
6935 ;; document type. | |
6936 (narrow-to-region | |
6937 (goto-char (point-min)) | |
6938 (or (search-forward "\n\n" nil t) (point))) | |
6939 (goto-char (point-min)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6940 (delete-matching-lines "^Path:\\|^From ") |
17493 | 6941 (widen)) |
6942 (unwind-protect | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6943 (if (let ((gnus-newsgroup-ephemeral-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6944 (gnus-newsgroup-ephemeral-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6945 gnus-newsgroup-ignored-charsets)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6946 (gnus-group-read-ephemeral-group |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6947 name `(nndoc ,name (nndoc-address ,(get-buffer dig)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6948 (nndoc-article-type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6949 ,(if force 'mbox 'guess))) t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6950 ;; Make all postings to this group go to the parent group. |
17493 | 6951 (nconc (gnus-info-params (gnus-get-info name)) |
6952 params) | |
6953 ;; Couldn't select this doc group. | |
6954 (switch-to-buffer buf) | |
6955 (gnus-set-global-variables) | |
6956 (gnus-configure-windows 'summary) | |
6957 (gnus-message 3 "Article couldn't be entered?")) | |
6958 (kill-buffer dig))))) | |
6959 | |
6960 (defun gnus-summary-read-document (n) | |
6961 "Open a new group based on the current article(s). | |
6962 This will allow you to read digests and other similar | |
6963 documents as newsgroups. | |
6964 Obeys the standard process/prefix convention." | |
6965 (interactive "P") | |
6966 (let* ((articles (gnus-summary-work-articles n)) | |
6967 (ogroup gnus-newsgroup-name) | |
6968 (params (append (gnus-info-params (gnus-get-info ogroup)) | |
6969 (list (cons 'to-group ogroup)))) | |
6970 article group egroup groups vgroup) | |
6971 (while (setq article (pop articles)) | |
6972 (setq group (format "%s-%d" gnus-newsgroup-name article)) | |
6973 (gnus-summary-remove-process-mark article) | |
6974 (when (gnus-summary-display-article article) | |
6975 (save-excursion | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6976 (with-temp-buffer |
17493 | 6977 (insert-buffer-substring gnus-original-article-buffer) |
6978 ;; Remove some headers that may lead nndoc to make | |
6979 ;; the wrong guess. | |
6980 (message-narrow-to-head) | |
6981 (goto-char (point-min)) | |
6982 (delete-matching-lines "^\\(Path\\):\\|^From ") | |
6983 (widen) | |
6984 (if (setq egroup | |
6985 (gnus-group-read-ephemeral-group | |
6986 group `(nndoc ,group (nndoc-address ,(current-buffer)) | |
6987 (nndoc-article-type guess)) | |
6988 t nil t)) | |
6989 (progn | |
6990 ;; Make all postings to this group go to the parent group. | |
6991 (nconc (gnus-info-params (gnus-get-info egroup)) | |
6992 params) | |
6993 (push egroup groups)) | |
6994 ;; Couldn't select this doc group. | |
6995 (gnus-error 3 "Article couldn't be entered")))))) | |
6996 ;; Now we have selected all the documents. | |
6997 (cond | |
6998 ((not groups) | |
6999 (error "None of the articles could be interpreted as documents")) | |
7000 ((gnus-group-read-ephemeral-group | |
7001 (setq vgroup (format | |
7002 "nnvirtual:%s-%s" gnus-newsgroup-name | |
7003 (format-time-string "%Y%m%dT%H%M%S" (current-time)))) | |
7004 `(nnvirtual ,vgroup (nnvirtual-component-groups ,groups)) | |
7005 t | |
7006 (cons (current-buffer) 'summary))) | |
7007 (t | |
7008 (error "Couldn't select virtual nndoc group"))))) | |
7009 | |
7010 (defun gnus-summary-isearch-article (&optional regexp-p) | |
7011 "Do incremental search forward on the current article. | |
7012 If REGEXP-P (the prefix) is non-nil, do regexp isearch." | |
7013 (interactive "P") | |
7014 (gnus-summary-select-article) | |
7015 (gnus-configure-windows 'article) | |
7016 (gnus-eval-in-buffer-window gnus-article-buffer | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7017 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7018 (widen) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7019 (isearch-forward regexp-p)))) |
17493 | 7020 |
7021 (defun gnus-summary-search-article-forward (regexp &optional backward) | |
7022 "Search for an article containing REGEXP forward. | |
7023 If BACKWARD, search backward instead." | |
7024 (interactive | |
7025 (list (read-string | |
7026 (format "Search article %s (regexp%s): " | |
7027 (if current-prefix-arg "backward" "forward") | |
7028 (if gnus-last-search-regexp | |
7029 (concat ", default " gnus-last-search-regexp) | |
7030 ""))) | |
7031 current-prefix-arg)) | |
7032 (if (string-equal regexp "") | |
7033 (setq regexp (or gnus-last-search-regexp "")) | |
7034 (setq gnus-last-search-regexp regexp)) | |
7035 (if (gnus-summary-search-article regexp backward) | |
7036 (gnus-summary-show-thread) | |
7037 (error "Search failed: \"%s\"" regexp))) | |
7038 | |
7039 (defun gnus-summary-search-article-backward (regexp) | |
7040 "Search for an article containing REGEXP backward." | |
7041 (interactive | |
7042 (list (read-string | |
7043 (format "Search article backward (regexp%s): " | |
7044 (if gnus-last-search-regexp | |
7045 (concat ", default " gnus-last-search-regexp) | |
7046 ""))))) | |
7047 (gnus-summary-search-article-forward regexp 'backward)) | |
7048 | |
7049 (defun gnus-summary-search-article (regexp &optional backward) | |
7050 "Search for an article containing REGEXP. | |
7051 Optional argument BACKWARD means do search for backward. | |
7052 `gnus-select-article-hook' is not called during the search." | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7053 ;; We have to require this here to make sure that the following |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7054 ;; dynamic binding isn't shadowed by autoloading. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7055 (require 'gnus-async) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7056 (require 'gnus-art) |
17493 | 7057 (let ((gnus-select-article-hook nil) ;Disable hook. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7058 (gnus-article-prepare-hook nil) |
17493 | 7059 (gnus-mark-article-hook nil) ;Inhibit marking as read. |
7060 (gnus-use-article-prefetch nil) | |
7061 (gnus-xmas-force-redisplay nil) ;Inhibit XEmacs redisplay. | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7062 (gnus-use-trees nil) ;Inhibit updating tree buffer. |
17493 | 7063 (sum (current-buffer)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7064 (gnus-display-mime-function nil) |
17493 | 7065 (found nil) |
7066 point) | |
7067 (gnus-save-hidden-threads | |
7068 (gnus-summary-select-article) | |
7069 (set-buffer gnus-article-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7070 (goto-char (window-point (get-buffer-window (current-buffer)))) |
17493 | 7071 (when backward |
7072 (forward-line -1)) | |
7073 (while (not found) | |
7074 (gnus-message 7 "Searching article: %d..." (cdr gnus-article-current)) | |
7075 (if (if backward | |
7076 (re-search-backward regexp nil t) | |
7077 (re-search-forward regexp nil t)) | |
7078 ;; We found the regexp. | |
7079 (progn | |
7080 (setq found 'found) | |
7081 (beginning-of-line) | |
7082 (set-window-start | |
7083 (get-buffer-window (current-buffer)) | |
7084 (point)) | |
7085 (forward-line 1) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7086 (set-window-point |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7087 (get-buffer-window (current-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7088 (point)) |
17493 | 7089 (set-buffer sum) |
7090 (setq point (point))) | |
7091 ;; We didn't find it, so we go to the next article. | |
7092 (set-buffer sum) | |
7093 (setq found 'not) | |
7094 (while (eq found 'not) | |
7095 (if (not (if backward (gnus-summary-find-prev) | |
7096 (gnus-summary-find-next))) | |
7097 ;; No more articles. | |
7098 (setq found t) | |
7099 ;; Select the next article and adjust point. | |
7100 (unless (gnus-summary-article-sparse-p | |
7101 (gnus-summary-article-number)) | |
7102 (setq found nil) | |
7103 (gnus-summary-select-article) | |
7104 (set-buffer gnus-article-buffer) | |
7105 (widen) | |
7106 (goto-char (if backward (point-max) (point-min)))))))) | |
7107 (gnus-message 7 "")) | |
7108 ;; Return whether we found the regexp. | |
7109 (when (eq found 'found) | |
7110 (goto-char point) | |
7111 (gnus-summary-show-thread) | |
7112 (gnus-summary-goto-subject gnus-current-article) | |
7113 (gnus-summary-position-point) | |
7114 t))) | |
7115 | |
7116 (defun gnus-summary-find-matching (header regexp &optional backward unread | |
7117 not-case-fold) | |
7118 "Return a list of all articles that match REGEXP on HEADER. | |
7119 The search stars on the current article and goes forwards unless | |
7120 BACKWARD is non-nil. If BACKWARD is `all', do all articles. | |
7121 If UNREAD is non-nil, only unread articles will | |
7122 be taken into consideration. If NOT-CASE-FOLD, case won't be folded | |
7123 in the comparisons." | |
7124 (let ((data (if (eq backward 'all) gnus-newsgroup-data | |
7125 (gnus-data-find-list | |
7126 (gnus-summary-article-number) (gnus-data-list backward)))) | |
7127 (case-fold-search (not not-case-fold)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7128 articles d func) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7129 (if (consp header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7130 (if (eq (car header) 'extra) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7131 (setq func |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7132 `(lambda (h) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7133 (or (cdr (assq ',(cdr header) (mail-header-extra h))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7134 ""))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7135 (error "%s is an invalid header" header)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7136 (unless (fboundp (intern (concat "mail-header-" header))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7137 (error "%s is not a valid header" header)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7138 (setq func `(lambda (h) (,(intern (concat "mail-header-" header)) h)))) |
17493 | 7139 (while data |
7140 (setq d (car data)) | |
7141 (and (or (not unread) ; We want all articles... | |
7142 (gnus-data-unread-p d)) ; Or just unreads. | |
7143 (vectorp (gnus-data-header d)) ; It's not a pseudo. | |
7144 (string-match regexp (funcall func (gnus-data-header d))) ; Match. | |
7145 (push (gnus-data-number d) articles)) ; Success! | |
7146 (setq data (cdr data))) | |
7147 (nreverse articles))) | |
7148 | |
7149 (defun gnus-summary-execute-command (header regexp command &optional backward) | |
7150 "Search forward for an article whose HEADER matches REGEXP and execute COMMAND. | |
7151 If HEADER is an empty string (or nil), the match is done on the entire | |
7152 article. If BACKWARD (the prefix) is non-nil, search backward instead." | |
7153 (interactive | |
7154 (list (let ((completion-ignore-case t)) | |
7155 (completing-read | |
7156 "Header name: " | |
7157 (mapcar (lambda (string) (list string)) | |
7158 '("Number" "Subject" "From" "Lines" "Date" | |
7159 "Message-ID" "Xref" "References" "Body")) | |
7160 nil 'require-match)) | |
7161 (read-string "Regexp: ") | |
7162 (read-key-sequence "Command: ") | |
7163 current-prefix-arg)) | |
7164 (when (equal header "Body") | |
7165 (setq header "")) | |
7166 ;; Hidden thread subtrees must be searched as well. | |
7167 (gnus-summary-show-all-threads) | |
7168 ;; We don't want to change current point nor window configuration. | |
7169 (save-excursion | |
7170 (save-window-excursion | |
7171 (gnus-message 6 "Executing %s..." (key-description command)) | |
7172 ;; We'd like to execute COMMAND interactively so as to give arguments. | |
7173 (gnus-execute header regexp | |
7174 `(call-interactively ',(key-binding command)) | |
7175 backward) | |
7176 (gnus-message 6 "Executing %s...done" (key-description command))))) | |
7177 | |
7178 (defun gnus-summary-beginning-of-article () | |
7179 "Scroll the article back to the beginning." | |
7180 (interactive) | |
7181 (gnus-summary-select-article) | |
7182 (gnus-configure-windows 'article) | |
7183 (gnus-eval-in-buffer-window gnus-article-buffer | |
7184 (widen) | |
7185 (goto-char (point-min)) | |
7186 (when gnus-page-broken | |
7187 (gnus-narrow-to-page)))) | |
7188 | |
7189 (defun gnus-summary-end-of-article () | |
7190 "Scroll to the end of the article." | |
7191 (interactive) | |
7192 (gnus-summary-select-article) | |
7193 (gnus-configure-windows 'article) | |
7194 (gnus-eval-in-buffer-window gnus-article-buffer | |
7195 (widen) | |
7196 (goto-char (point-max)) | |
7197 (recenter -3) | |
7198 (when gnus-page-broken | |
7199 (gnus-narrow-to-page)))) | |
7200 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7201 (defun gnus-summary-print-article (&optional filename n) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7202 "Generate and print a PostScript image of the N next (mail) articles. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7203 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7204 If N is negative, print the N previous articles. If N is nil and articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7205 have been marked with the process mark, print these instead. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7206 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7207 If the optional first argument FILENAME is nil, send the image to the |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7208 printer. If FILENAME is a string, save the PostScript image in a file with |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7209 that name. If FILENAME is a number, prompt the user for the name of the file |
17493 | 7210 to save in." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7211 (interactive (list (ps-print-preprint current-prefix-arg) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7212 current-prefix-arg)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7213 (dolist (article (gnus-summary-work-articles n)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7214 (gnus-summary-select-article nil nil 'pseudo article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7215 (gnus-eval-in-buffer-window gnus-article-buffer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7216 (let ((buffer (generate-new-buffer " *print*"))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7217 (unwind-protect |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7218 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7219 (copy-to-buffer buffer (point-min) (point-max)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7220 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7221 (gnus-article-delete-invisible-text) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7222 (let ((ps-left-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7223 (list |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7224 (concat "(" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7225 (mail-header-subject gnus-current-headers) ")") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7226 (concat "(" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7227 (mail-header-from gnus-current-headers) ")"))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7228 (ps-right-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7229 (list |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7230 "/pagenumberstring load" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7231 (concat "(" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7232 (mail-header-date gnus-current-headers) ")")))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7233 (gnus-run-hooks 'gnus-ps-print-hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7234 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7235 (ps-print-buffer-with-faces filename)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7236 (kill-buffer buffer)))))) |
17493 | 7237 |
7238 (defun gnus-summary-show-article (&optional arg) | |
7239 "Force re-fetching of the current article. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7240 If ARG (the prefix) is a number, show the article with the charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7241 defined in `gnus-summary-show-article-charset-alist', or the charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7242 inputed. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7243 If ARG (the prefix) is non-nil and not a number, show the raw article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7244 without any article massaging functions being run." |
17493 | 7245 (interactive "P") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7246 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7247 ((numberp arg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7248 (let ((gnus-newsgroup-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7249 (or (cdr (assq arg gnus-summary-show-article-charset-alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7250 (read-coding-system "Charset: "))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7251 (gnus-newsgroup-ignored-charsets 'gnus-all)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7252 (gnus-summary-select-article nil 'force))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7253 ((not arg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7254 ;; Select the article the normal way. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7255 (gnus-summary-select-article nil 'force)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7256 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7257 ;; We have to require this here to make sure that the following |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7258 ;; dynamic binding isn't shadowed by autoloading. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7259 (require 'gnus-async) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7260 (require 'gnus-art) |
17493 | 7261 ;; Bind the article treatment functions to nil. |
7262 (let ((gnus-have-all-headers t) | |
7263 gnus-article-prepare-hook | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7264 gnus-article-decode-hook |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7265 gnus-display-mime-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7266 gnus-break-pages) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7267 ;; Destroy any MIME parts. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7268 (when (gnus-buffer-live-p gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7269 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7270 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7271 (mm-destroy-parts gnus-article-mime-handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7272 ;; Set it to nil for safety reason. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7273 (setq gnus-article-mime-handle-alist nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7274 (setq gnus-article-mime-handles nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7275 (gnus-summary-select-article nil 'force)))) |
17493 | 7276 (gnus-summary-goto-subject gnus-current-article) |
7277 (gnus-summary-position-point)) | |
7278 | |
7279 (defun gnus-summary-verbose-headers (&optional arg) | |
7280 "Toggle permanent full header display. | |
7281 If ARG is a positive number, turn header display on. | |
7282 If ARG is a negative number, turn header display off." | |
7283 (interactive "P") | |
7284 (setq gnus-show-all-headers | |
7285 (cond ((or (not (numberp arg)) | |
7286 (zerop arg)) | |
7287 (not gnus-show-all-headers)) | |
7288 ((natnump arg) | |
7289 t))) | |
7290 (gnus-summary-show-article)) | |
7291 | |
7292 (defun gnus-summary-toggle-header (&optional arg) | |
7293 "Show the headers if they are hidden, or hide them if they are shown. | |
7294 If ARG is a positive number, show the entire header. | |
7295 If ARG is a negative number, hide the unwanted header lines." | |
7296 (interactive "P") | |
7297 (save-excursion | |
7298 (set-buffer gnus-article-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7299 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7300 (let* ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7301 (inhibit-point-motion-hooks t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7302 hidden e) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7303 (setq hidden |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7304 (if (numberp arg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7305 (>= arg 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7306 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7307 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7308 (gnus-article-hidden-text-p 'headers)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7309 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7310 (when (search-forward "\n\n" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7311 (delete-region (point-min) (1- (point)))) |
17493 | 7312 (goto-char (point-min)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7313 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7314 (set-buffer gnus-original-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7315 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7316 (setq e (1- (or (search-forward "\n\n" nil t) (point-max))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7317 (insert-buffer-substring gnus-original-article-buffer 1 e) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7318 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7319 (narrow-to-region (point-min) (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7320 (article-decode-encoded-words) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7321 (if hidden |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7322 (let ((gnus-treat-hide-headers nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7323 (gnus-treat-hide-boring-headers nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7324 (setq gnus-article-wash-types |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7325 (delq 'headers gnus-article-wash-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7326 (gnus-treat-article 'head)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7327 (gnus-treat-article 'head))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7328 (gnus-set-mode-line 'article))))) |
17493 | 7329 |
7330 (defun gnus-summary-show-all-headers () | |
7331 "Make all header lines visible." | |
7332 (interactive) | |
7333 (gnus-article-show-all-headers)) | |
7334 | |
7335 (defun gnus-summary-caesar-message (&optional arg) | |
7336 "Caesar rotate the current article by 13. | |
7337 The numerical prefix specifies how many places to rotate each letter | |
7338 forward." | |
7339 (interactive "P") | |
7340 (gnus-summary-select-article) | |
7341 (let ((mail-header-separator "")) | |
7342 (gnus-eval-in-buffer-window gnus-article-buffer | |
7343 (save-restriction | |
7344 (widen) | |
7345 (let ((start (window-start)) | |
7346 buffer-read-only) | |
7347 (message-caesar-buffer-body arg) | |
7348 (set-window-start (get-buffer-window (current-buffer)) start)))))) | |
7349 | |
7350 (defun gnus-summary-stop-page-breaking () | |
7351 "Stop page breaking in the current article." | |
7352 (interactive) | |
7353 (gnus-summary-select-article) | |
7354 (gnus-eval-in-buffer-window gnus-article-buffer | |
7355 (widen) | |
7356 (when (gnus-visual-p 'page-marker) | |
7357 (let ((buffer-read-only nil)) | |
7358 (gnus-remove-text-with-property 'gnus-prev) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7359 (gnus-remove-text-with-property 'gnus-next)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7360 (setq gnus-page-broken nil)))) |
17493 | 7361 |
7362 (defun gnus-summary-move-article (&optional n to-newsgroup | |
7363 select-method action) | |
7364 "Move the current article to a different newsgroup. | |
7365 If N is a positive number, move the N next articles. | |
7366 If N is a negative number, move the N previous articles. | |
7367 If N is nil and any articles have been marked with the process mark, | |
7368 move those articles instead. | |
7369 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to. | |
7370 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but | |
7371 re-spool using this method. | |
7372 | |
7373 For this function to work, both the current newsgroup and the | |
7374 newsgroup that you want to move to have to support the `request-move' | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7375 and `request-accept' functions. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7376 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7377 ACTION can be either `move' (the default), `crosspost' or `copy'." |
17493 | 7378 (interactive "P") |
7379 (unless action | |
7380 (setq action 'move)) | |
7381 ;; Disable marking as read. | |
7382 (let (gnus-mark-article-hook) | |
7383 (save-window-excursion | |
7384 (gnus-summary-select-article))) | |
7385 ;; Check whether the source group supports the required functions. | |
7386 (cond ((and (eq action 'move) | |
7387 (not (gnus-check-backend-function | |
7388 'request-move-article gnus-newsgroup-name))) | |
7389 (error "The current group does not support article moving")) | |
7390 ((and (eq action 'crosspost) | |
7391 (not (gnus-check-backend-function | |
7392 'request-replace-article gnus-newsgroup-name))) | |
7393 (error "The current group does not support article editing"))) | |
7394 (let ((articles (gnus-summary-work-articles n)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7395 (prefix (if (gnus-check-backend-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7396 'request-move-article gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7397 (gnus-group-real-prefix gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7398 "")) |
17493 | 7399 (names '((move "Move" "Moving") |
7400 (copy "Copy" "Copying") | |
7401 (crosspost "Crosspost" "Crossposting"))) | |
7402 (copy-buf (save-excursion | |
7403 (nnheader-set-temp-buffer " *copy article*"))) | |
7404 art-group to-method new-xref article to-groups) | |
7405 (unless (assq action names) | |
7406 (error "Unknown action %s" action)) | |
7407 ;; Read the newsgroup name. | |
7408 (when (and (not to-newsgroup) | |
7409 (not select-method)) | |
7410 (setq to-newsgroup | |
7411 (gnus-read-move-group-name | |
7412 (cadr (assq action names)) | |
7413 (symbol-value (intern (format "gnus-current-%s-group" action))) | |
7414 articles prefix)) | |
7415 (set (intern (format "gnus-current-%s-group" action)) to-newsgroup)) | |
7416 (setq to-method (or select-method | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7417 (gnus-server-to-method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7418 (gnus-group-method to-newsgroup)))) |
17493 | 7419 ;; Check the method we are to move this article to... |
7420 (unless (gnus-check-backend-function | |
7421 'request-accept-article (car to-method)) | |
7422 (error "%s does not support article copying" (car to-method))) | |
7423 (unless (gnus-check-server to-method) | |
7424 (error "Can't open server %s" (car to-method))) | |
7425 (gnus-message 6 "%s to %s: %s..." | |
7426 (caddr (assq action names)) | |
7427 (or (car select-method) to-newsgroup) articles) | |
7428 (while articles | |
7429 (setq article (pop articles)) | |
7430 (setq | |
7431 art-group | |
7432 (cond | |
7433 ;; Move the article. | |
7434 ((eq action 'move) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7435 ;; Remove this article from future suppression. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7436 (gnus-dup-unsuppress-article article) |
17493 | 7437 (gnus-request-move-article |
7438 article ; Article to move | |
7439 gnus-newsgroup-name ; From newsgroup | |
7440 (nth 1 (gnus-find-method-for-group | |
7441 gnus-newsgroup-name)) ; Server | |
7442 (list 'gnus-request-accept-article | |
7443 to-newsgroup (list 'quote select-method) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7444 (not articles) t) ; Accept form |
17493 | 7445 (not articles))) ; Only save nov last time |
7446 ;; Copy the article. | |
7447 ((eq action 'copy) | |
7448 (save-excursion | |
7449 (set-buffer copy-buf) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7450 (when (gnus-request-article-this-buffer article gnus-newsgroup-name) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7451 (gnus-request-accept-article |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7452 to-newsgroup select-method (not articles) t)))) |
17493 | 7453 ;; Crosspost the article. |
7454 ((eq action 'crosspost) | |
7455 (let ((xref (message-tokenize-header | |
7456 (mail-header-xref (gnus-summary-article-header article)) | |
7457 " "))) | |
7458 (setq new-xref (concat (gnus-group-real-name gnus-newsgroup-name) | |
7459 ":" article)) | |
7460 (unless xref | |
7461 (setq xref (list (system-name)))) | |
7462 (setq new-xref | |
7463 (concat | |
7464 (mapconcat 'identity | |
7465 (delete "Xref:" (delete new-xref xref)) | |
7466 " ") | |
7467 " " new-xref)) | |
7468 (save-excursion | |
7469 (set-buffer copy-buf) | |
7470 ;; First put the article in the destination group. | |
7471 (gnus-request-article-this-buffer article gnus-newsgroup-name) | |
7472 (when (consp (setq art-group | |
7473 (gnus-request-accept-article | |
7474 to-newsgroup select-method (not articles)))) | |
7475 (setq new-xref (concat new-xref " " (car art-group) | |
7476 ":" (cdr art-group))) | |
7477 ;; Now we have the new Xrefs header, so we insert | |
7478 ;; it and replace the new article. | |
7479 (nnheader-replace-header "Xref" new-xref) | |
7480 (gnus-request-replace-article | |
7481 (cdr art-group) to-newsgroup (current-buffer)) | |
7482 art-group)))))) | |
7483 (cond | |
7484 ((not art-group) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7485 (gnus-message 1 "Couldn't %s article %s: %s" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7486 (cadr (assq action names)) article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7487 (nnheader-get-report (car to-method)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7488 ((eq art-group 'junk) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7489 (when (eq action 'move) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7490 (gnus-summary-mark-article article gnus-canceled-mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7491 (gnus-message 4 "Deleted article %s" article))) |
17493 | 7492 (t |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7493 (let* ((pto-group (gnus-group-prefixed-name |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7494 (car art-group) to-method)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7495 (entry |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7496 (gnus-gethash pto-group gnus-newsrc-hashtb)) |
17493 | 7497 (info (nth 2 entry)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7498 (to-group (gnus-info-group info)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7499 to-marks) |
17493 | 7500 ;; Update the group that has been moved to. |
7501 (when (and info | |
7502 (memq action '(move copy))) | |
7503 (unless (member to-group to-groups) | |
7504 (push to-group to-groups)) | |
7505 | |
7506 (unless (memq article gnus-newsgroup-unreads) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7507 (push 'read to-marks) |
17493 | 7508 (gnus-info-set-read |
7509 info (gnus-add-to-range (gnus-info-read info) | |
7510 (list (cdr art-group))))) | |
7511 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7512 ;; See whether the article is to be put in the cache. |
17493 | 7513 (let ((marks gnus-article-mark-lists) |
7514 (to-article (cdr art-group))) | |
7515 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7516 ;; Enter the article into the cache in the new group, |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7517 ;; if that is required. |
17493 | 7518 (when gnus-use-cache |
7519 (gnus-cache-possibly-enter-article | |
7520 to-group to-article | |
7521 (memq article gnus-newsgroup-marked) | |
7522 (memq article gnus-newsgroup-dormant) | |
7523 (memq article gnus-newsgroup-unreads))) | |
7524 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7525 (when gnus-preserve-marks |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7526 ;; Copy any marks over to the new group. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7527 (when (and (equal to-group gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7528 (not (memq article gnus-newsgroup-unreads))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7529 ;; Mark this article as read in this group. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7530 (push (cons to-article gnus-read-mark) gnus-newsgroup-reads) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7531 (setcdr (gnus-active to-group) to-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7532 (setcdr gnus-newsgroup-active to-article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7533 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7534 (while marks |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7535 (when (memq article (symbol-value |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7536 (intern (format "gnus-newsgroup-%s" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7537 (caar marks))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7538 (push (cdar marks) to-marks) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7539 ;; If the other group is the same as this group, |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7540 ;; then we have to add the mark to the list. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7541 (when (equal to-group gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7542 (set (intern (format "gnus-newsgroup-%s" (caar marks))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7543 (cons to-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7544 (symbol-value |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7545 (intern (format "gnus-newsgroup-%s" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7546 (caar marks))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7547 ;; Copy the marks to other group. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7548 (gnus-add-marked-articles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7549 to-group (cdar marks) (list to-article) info)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7550 (setq marks (cdr marks))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7551 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7552 (gnus-request-set-mark to-group (list (list (list to-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7553 'set |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7554 to-marks)))) |
17493 | 7555 |
7556 (gnus-dribble-enter | |
7557 (concat "(gnus-group-set-info '" | |
7558 (gnus-prin1-to-string (gnus-get-info to-group)) | |
7559 ")")))) | |
7560 | |
7561 ;; Update the Xref header in this article to point to | |
7562 ;; the new crossposted article we have just created. | |
7563 (when (eq action 'crosspost) | |
7564 (save-excursion | |
7565 (set-buffer copy-buf) | |
7566 (gnus-request-article-this-buffer article gnus-newsgroup-name) | |
7567 (nnheader-replace-header "Xref" new-xref) | |
7568 (gnus-request-replace-article | |
7569 article gnus-newsgroup-name (current-buffer))))) | |
7570 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7571 ;;;!!!Why is this necessary? |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7572 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7573 |
17493 | 7574 (gnus-summary-goto-subject article) |
7575 (when (eq action 'move) | |
7576 (gnus-summary-mark-article article gnus-canceled-mark)))) | |
7577 (gnus-summary-remove-process-mark article)) | |
7578 ;; Re-activate all groups that have been moved to. | |
7579 (while to-groups | |
7580 (save-excursion | |
7581 (set-buffer gnus-group-buffer) | |
7582 (when (gnus-group-goto-group (car to-groups) t) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7583 (gnus-group-get-new-news-this-group 1 t)) |
17493 | 7584 (pop to-groups))) |
7585 | |
7586 (gnus-kill-buffer copy-buf) | |
7587 (gnus-summary-position-point) | |
7588 (gnus-set-mode-line 'summary))) | |
7589 | |
7590 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method) | |
7591 "Move the current article to a different newsgroup. | |
7592 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to. | |
7593 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but | |
7594 re-spool using this method." | |
7595 (interactive "P") | |
7596 (gnus-summary-move-article n to-newsgroup select-method 'copy)) | |
7597 | |
7598 (defun gnus-summary-crosspost-article (&optional n) | |
7599 "Crosspost the current article to some other group." | |
7600 (interactive "P") | |
7601 (gnus-summary-move-article n nil nil 'crosspost)) | |
7602 | |
7603 (defcustom gnus-summary-respool-default-method nil | |
7604 "Default method for respooling an article. | |
7605 If nil, use to the current newsgroup method." | |
23363
41843e16f6ac
(gnus-summary-respool-default-method): Fix type.
Karl Heuer <kwzh@gnu.org>
parents:
20117
diff
changeset
|
7606 :type '(choice (gnus-select-method :value (nnml "")) |
41843e16f6ac
(gnus-summary-respool-default-method): Fix type.
Karl Heuer <kwzh@gnu.org>
parents:
20117
diff
changeset
|
7607 (const nil)) |
17493 | 7608 :group 'gnus-summary-mail) |
7609 | |
7610 (defun gnus-summary-respool-article (&optional n method) | |
7611 "Respool the current article. | |
7612 The article will be squeezed through the mail spooling process again, | |
7613 which means that it will be put in some mail newsgroup or other | |
7614 depending on `nnmail-split-methods'. | |
7615 If N is a positive number, respool the N next articles. | |
7616 If N is a negative number, respool the N previous articles. | |
7617 If N is nil and any articles have been marked with the process mark, | |
7618 respool those articles instead. | |
7619 | |
7620 Respooling can be done both from mail groups and \"real\" newsgroups. | |
7621 In the former case, the articles in question will be moved from the | |
7622 current group into whatever groups they are destined to. In the | |
7623 latter case, they will be copied into the relevant groups." | |
7624 (interactive | |
7625 (list current-prefix-arg | |
7626 (let* ((methods (gnus-methods-using 'respool)) | |
7627 (methname | |
7628 (symbol-name (or gnus-summary-respool-default-method | |
7629 (car (gnus-find-method-for-group | |
7630 gnus-newsgroup-name))))) | |
7631 (method | |
7632 (gnus-completing-read | |
7633 methname "What backend do you want to use when respooling?" | |
7634 methods nil t nil 'gnus-mail-method-history)) | |
7635 ms) | |
7636 (cond | |
7637 ((zerop (length (setq ms (gnus-servers-using-backend | |
7638 (intern method))))) | |
7639 (list (intern method) "")) | |
7640 ((= 1 (length ms)) | |
7641 (car ms)) | |
7642 (t | |
7643 (let ((ms-alist (mapcar (lambda (m) (cons (cadr m) m)) ms))) | |
7644 (cdr (assoc (completing-read "Server name: " ms-alist nil t) | |
7645 ms-alist)))))))) | |
7646 (unless method | |
7647 (error "No method given for respooling")) | |
7648 (if (assoc (symbol-name | |
7649 (car (gnus-find-method-for-group gnus-newsgroup-name))) | |
7650 (gnus-methods-using 'respool)) | |
7651 (gnus-summary-move-article n nil method) | |
7652 (gnus-summary-copy-article n nil method))) | |
7653 | |
7654 (defun gnus-summary-import-article (file) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7655 "Import an arbitrary file into a mail newsgroup." |
17493 | 7656 (interactive "fImport file: ") |
7657 (let ((group gnus-newsgroup-name) | |
7658 (now (current-time)) | |
7659 atts lines) | |
7660 (unless (gnus-check-backend-function 'request-accept-article group) | |
7661 (error "%s does not support article importing" group)) | |
7662 (or (file-readable-p file) | |
7663 (not (file-regular-p file)) | |
7664 (error "Can't read %s" file)) | |
7665 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7666 (set-buffer (gnus-get-buffer-create " *import file*")) |
17493 | 7667 (erase-buffer) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7668 (nnheader-insert-file-contents file) |
17493 | 7669 (goto-char (point-min)) |
7670 (unless (nnheader-article-p) | |
7671 ;; This doesn't look like an article, so we fudge some headers. | |
7672 (setq atts (file-attributes file) | |
7673 lines (count-lines (point-min) (point-max))) | |
7674 (insert "From: " (read-string "From: ") "\n" | |
7675 "Subject: " (read-string "Subject: ") "\n" | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7676 "Date: " (message-make-date (nth 5 atts)) |
17493 | 7677 "\n" |
7678 "Message-ID: " (message-make-message-id) "\n" | |
7679 "Lines: " (int-to-string lines) "\n" | |
7680 "Chars: " (int-to-string (nth 7 atts)) "\n\n")) | |
7681 (gnus-request-accept-article group nil t) | |
7682 (kill-buffer (current-buffer))))) | |
7683 | |
7684 (defun gnus-summary-article-posted-p () | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7685 "Say whether the current (mail) article is available from news as well. |
17493 | 7686 This will be the case if the article has both been mailed and posted." |
7687 (interactive) | |
7688 (let ((id (mail-header-references (gnus-summary-article-header))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7689 (gnus-override-method (car (gnus-refer-article-methods)))) |
17493 | 7690 (if (gnus-request-head id "") |
7691 (gnus-message 2 "The current message was found on %s" | |
7692 gnus-override-method) | |
7693 (gnus-message 2 "The current message couldn't be found on %s" | |
7694 gnus-override-method) | |
7695 nil))) | |
7696 | |
7697 (defun gnus-summary-expire-articles (&optional now) | |
7698 "Expire all articles that are marked as expirable in the current group." | |
7699 (interactive) | |
7700 (when (gnus-check-backend-function | |
7701 'request-expire-articles gnus-newsgroup-name) | |
7702 ;; This backend supports expiry. | |
7703 (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name)) | |
7704 (expirable (if total | |
7705 (progn | |
7706 ;; We need to update the info for | |
7707 ;; this group for `gnus-list-of-read-articles' | |
7708 ;; to give us the right answer. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7709 (gnus-run-hooks 'gnus-exit-group-hook) |
17493 | 7710 (gnus-summary-update-info) |
7711 (gnus-list-of-read-articles gnus-newsgroup-name)) | |
7712 (setq gnus-newsgroup-expirable | |
7713 (sort gnus-newsgroup-expirable '<)))) | |
7714 (expiry-wait (if now 'immediate | |
7715 (gnus-group-find-parameter | |
7716 gnus-newsgroup-name 'expiry-wait))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7717 (nnmail-expiry-target |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7718 (or (gnus-group-find-parameter gnus-newsgroup-name 'expiry-target) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7719 nnmail-expiry-target)) |
17493 | 7720 es) |
7721 (when expirable | |
7722 ;; There are expirable articles in this group, so we run them | |
7723 ;; through the expiry process. | |
7724 (gnus-message 6 "Expiring articles...") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7725 (unless (gnus-check-group gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7726 (error "Can't open server for %s" gnus-newsgroup-name)) |
17493 | 7727 ;; The list of articles that weren't expired is returned. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7728 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7729 (if expiry-wait |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7730 (let ((nnmail-expiry-wait-function nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7731 (nnmail-expiry-wait expiry-wait)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7732 (setq es (gnus-request-expire-articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7733 expirable gnus-newsgroup-name))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7734 (setq es (gnus-request-expire-articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7735 expirable gnus-newsgroup-name)))) |
17493 | 7736 (unless total |
7737 (setq gnus-newsgroup-expirable es)) | |
7738 ;; We go through the old list of expirable, and mark all | |
7739 ;; really expired articles as nonexistent. | |
7740 (unless (eq es expirable) ;If nothing was expired, we don't mark. | |
7741 (let ((gnus-use-cache nil)) | |
7742 (while expirable | |
7743 (unless (memq (car expirable) es) | |
7744 (when (gnus-data-find (car expirable)) | |
7745 (gnus-summary-mark-article | |
7746 (car expirable) gnus-canceled-mark))) | |
7747 (setq expirable (cdr expirable))))) | |
7748 (gnus-message 6 "Expiring articles...done"))))) | |
7749 | |
7750 (defun gnus-summary-expire-articles-now () | |
7751 "Expunge all expirable articles in the current group. | |
7752 This means that *all* articles that are marked as expirable will be | |
7753 deleted forever, right now." | |
7754 (interactive) | |
7755 (or gnus-expert-user | |
7756 (gnus-yes-or-no-p | |
7757 "Are you really, really, really sure you want to delete all these messages? ") | |
7758 (error "Phew!")) | |
7759 (gnus-summary-expire-articles t)) | |
7760 | |
7761 ;; Suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>. | |
7762 (defun gnus-summary-delete-article (&optional n) | |
7763 "Delete the N next (mail) articles. | |
7764 This command actually deletes articles. This is not a marking | |
7765 command. The article will disappear forever from your life, never to | |
7766 return. | |
7767 If N is negative, delete backwards. | |
7768 If N is nil and articles have been marked with the process mark, | |
7769 delete these instead." | |
7770 (interactive "P") | |
7771 (unless (gnus-check-backend-function 'request-expire-articles | |
7772 gnus-newsgroup-name) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7773 (error "The current newsgroup does not support article deletion")) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7774 (unless (gnus-check-server (gnus-find-method-for-group gnus-newsgroup-name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7775 (error "Couldn't open server")) |
17493 | 7776 ;; Compute the list of articles to delete. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7777 (let ((articles (sort (copy-sequence (gnus-summary-work-articles n)) '<)) |
17493 | 7778 not-deleted) |
7779 (if (and gnus-novice-user | |
7780 (not (gnus-yes-or-no-p | |
7781 (format "Do you really want to delete %s forever? " | |
7782 (if (> (length articles) 1) | |
7783 (format "these %s articles" (length articles)) | |
7784 "this article"))))) | |
7785 () | |
7786 ;; Delete the articles. | |
7787 (setq not-deleted (gnus-request-expire-articles | |
7788 articles gnus-newsgroup-name 'force)) | |
7789 (while articles | |
7790 (gnus-summary-remove-process-mark (car articles)) | |
7791 ;; The backend might not have been able to delete the article | |
7792 ;; after all. | |
7793 (unless (memq (car articles) not-deleted) | |
7794 (gnus-summary-mark-article (car articles) gnus-canceled-mark)) | |
7795 (setq articles (cdr articles))) | |
7796 (when not-deleted | |
7797 (gnus-message 4 "Couldn't delete articles %s" not-deleted))) | |
7798 (gnus-summary-position-point) | |
7799 (gnus-set-mode-line 'summary) | |
7800 not-deleted)) | |
7801 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7802 (defun gnus-summary-edit-article (&optional arg) |
17493 | 7803 "Edit the current article. |
7804 This will have permanent effect only in mail groups. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7805 If ARG is nil, edit the decoded articles. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7806 If ARG is 1, edit the raw articles. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7807 If ARG is 2, edit the raw articles even in read-only groups. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7808 Otherwise, allow editing of articles even in read-only |
17493 | 7809 groups." |
7810 (interactive "P") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7811 (let (force raw) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7812 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7813 ((null arg)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7814 ((eq arg 1) (setq raw t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7815 ((eq arg 2) (setq raw t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7816 force t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7817 (t (setq force t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7818 (if (and raw (not force) (equal gnus-newsgroup-name "nndraft:drafts")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7819 (error "Can't edit the raw article in group nndraft:drafts.")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7820 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7821 (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7822 (let ((mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7823 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7824 (gnus-set-global-variables) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7825 (when (and (not force) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7826 (gnus-group-read-only-p)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7827 (error "The current newsgroup does not support article editing")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7828 (gnus-summary-show-article t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7829 (when (and (not raw) (gnus-buffer-live-p gnus-article-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7830 (with-current-buffer gnus-article-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7831 (mm-enable-multibyte))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7832 (if (equal gnus-newsgroup-name "nndraft:drafts") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7833 (setq raw t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7834 (gnus-article-edit-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7835 (if raw 'ignore |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7836 #'(lambda () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7837 (let ((mbl mml-buffer-list)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7838 (setq mml-buffer-list nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7839 (mime-to-mml) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7840 (make-local-hook 'kill-buffer-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7841 (let ((mml-buffer-list mml-buffer-list)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7842 (setq mml-buffer-list mbl) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7843 (make-local-variable 'mml-buffer-list)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7844 (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7845 `(lambda (no-highlight) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7846 (let ((mail-parse-charset ',gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7847 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7848 ',gnus-newsgroup-ignored-charsets)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7849 ,(if (not raw) '(progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7850 (mml-to-mime) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7851 (mml-destroy-buffers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7852 (remove-hook 'kill-buffer-hook |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7853 'mml-destroy-buffers t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7854 (kill-local-variable 'mml-buffer-list))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7855 (gnus-summary-edit-article-done |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7856 ,(or (mail-header-references gnus-current-headers) "") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7857 ,(gnus-group-read-only-p) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7858 ,gnus-summary-buffer no-highlight)))))))) |
17493 | 7859 |
7860 (defalias 'gnus-summary-edit-article-postpone 'gnus-article-edit-exit) | |
7861 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7862 (defun gnus-summary-edit-article-done (&optional references read-only buffer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7863 no-highlight) |
17493 | 7864 "Make edits to the current article permanent." |
7865 (interactive) | |
7866 ;; Replace the article. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7867 (let ((buf (current-buffer))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7868 (with-temp-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7869 (insert-buffer-substring buf) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7870 (if (and (not read-only) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7871 (not (gnus-request-replace-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7872 (cdr gnus-article-current) (car gnus-article-current) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7873 (current-buffer) t))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7874 (error "Couldn't replace article") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7875 ;; Update the summary buffer. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7876 (if (and references |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7877 (equal (message-tokenize-header references " ") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7878 (message-tokenize-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7879 (or (message-fetch-field "references") "") " "))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7880 ;; We only have to update this line. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7881 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7882 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7883 (message-narrow-to-head) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7884 (let ((head (buffer-string)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7885 header) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7886 (with-temp-buffer |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7887 (insert (format "211 %d Article retrieved.\n" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7888 (cdr gnus-article-current))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7889 (insert head) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7890 (insert ".\n") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7891 (let ((nntp-server-buffer (current-buffer))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7892 (setq header (car (gnus-get-newsgroup-headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7893 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7894 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7895 gnus-newsgroup-dependencies) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7896 t)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7897 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7898 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7899 (gnus-data-set-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7900 (gnus-data-find (cdr gnus-article-current)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7901 header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7902 (gnus-summary-update-article-line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7903 (cdr gnus-article-current) header)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7904 ;; Update threads. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7905 (set-buffer (or buffer gnus-summary-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7906 (gnus-summary-update-article (cdr gnus-article-current))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7907 ;; Prettify the article buffer again. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7908 (unless no-highlight |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7909 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7910 (set-buffer gnus-article-buffer) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7911 ;;;!!! Fix this -- article should be rehighlighted. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7912 ;;;(gnus-run-hooks 'gnus-article-display-hook) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7913 (set-buffer gnus-original-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7914 (gnus-request-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7915 (cdr gnus-article-current) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7916 (car gnus-article-current) (current-buffer)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7917 ;; Prettify the summary buffer line. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7918 (when (gnus-visual-p 'summary-highlight 'highlight) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7919 (gnus-run-hooks 'gnus-visual-mark-article-hook)))))) |
17493 | 7920 |
7921 (defun gnus-summary-edit-wash (key) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7922 "Perform editing command KEY in the article buffer." |
17493 | 7923 (interactive |
7924 (list | |
7925 (progn | |
7926 (message "%s" (concat (this-command-keys) "- ")) | |
7927 (read-char)))) | |
7928 (message "") | |
7929 (gnus-summary-edit-article) | |
7930 (execute-kbd-macro (concat (this-command-keys) key)) | |
7931 (gnus-article-edit-done)) | |
7932 | |
7933 ;;; Respooling | |
7934 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7935 (defun gnus-summary-respool-query (&optional silent trace) |
17493 | 7936 "Query where the respool algorithm would put this article." |
7937 (interactive) | |
7938 (let (gnus-mark-article-hook) | |
7939 (gnus-summary-select-article) | |
7940 (save-excursion | |
7941 (set-buffer gnus-original-article-buffer) | |
7942 (save-restriction | |
7943 (message-narrow-to-head) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7944 (let ((groups (nnmail-article-group 'identity trace))) |
17493 | 7945 (unless silent |
7946 (if groups | |
7947 (message "This message would go to %s" | |
7948 (mapconcat 'car groups ", ")) | |
7949 (message "This message would go to no groups")) | |
7950 groups)))))) | |
7951 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7952 (defun gnus-summary-respool-trace () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7953 "Trace where the respool algorithm would put this article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7954 Display a buffer showing all fancy splitting patterns which matched." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7955 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7956 (gnus-summary-respool-query nil t)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7957 |
17493 | 7958 ;; Summary marking commands. |
7959 | |
7960 (defun gnus-summary-kill-same-subject-and-select (&optional unmark) | |
7961 "Mark articles which has the same subject as read, and then select the next. | |
7962 If UNMARK is positive, remove any kind of mark. | |
7963 If UNMARK is negative, tick articles." | |
7964 (interactive "P") | |
7965 (when unmark | |
7966 (setq unmark (prefix-numeric-value unmark))) | |
7967 (let ((count | |
7968 (gnus-summary-mark-same-subject | |
7969 (gnus-summary-article-subject) unmark))) | |
7970 ;; Select next unread article. If auto-select-same mode, should | |
7971 ;; select the first unread article. | |
7972 (gnus-summary-next-article t (and gnus-auto-select-same | |
7973 (gnus-summary-article-subject))) | |
7974 (gnus-message 7 "%d article%s marked as %s" | |
7975 count (if (= count 1) " is" "s are") | |
7976 (if unmark "unread" "read")))) | |
7977 | |
7978 (defun gnus-summary-kill-same-subject (&optional unmark) | |
7979 "Mark articles which has the same subject as read. | |
7980 If UNMARK is positive, remove any kind of mark. | |
7981 If UNMARK is negative, tick articles." | |
7982 (interactive "P") | |
7983 (when unmark | |
7984 (setq unmark (prefix-numeric-value unmark))) | |
7985 (let ((count | |
7986 (gnus-summary-mark-same-subject | |
7987 (gnus-summary-article-subject) unmark))) | |
7988 ;; If marked as read, go to next unread subject. | |
7989 (when (null unmark) | |
7990 ;; Go to next unread subject. | |
7991 (gnus-summary-next-subject 1 t)) | |
7992 (gnus-message 7 "%d articles are marked as %s" | |
7993 count (if unmark "unread" "read")))) | |
7994 | |
7995 (defun gnus-summary-mark-same-subject (subject &optional unmark) | |
7996 "Mark articles with same SUBJECT as read, and return marked number. | |
7997 If optional argument UNMARK is positive, remove any kinds of marks. | |
7998 If optional argument UNMARK is negative, mark articles as unread instead." | |
7999 (let ((count 1)) | |
8000 (save-excursion | |
8001 (cond | |
8002 ((null unmark) ; Mark as read. | |
8003 (while (and | |
8004 (progn | |
8005 (gnus-summary-mark-article-as-read gnus-killed-mark) | |
8006 (gnus-summary-show-thread) t) | |
8007 (gnus-summary-find-subject subject)) | |
8008 (setq count (1+ count)))) | |
8009 ((> unmark 0) ; Tick. | |
8010 (while (and | |
8011 (progn | |
8012 (gnus-summary-mark-article-as-unread gnus-ticked-mark) | |
8013 (gnus-summary-show-thread) t) | |
8014 (gnus-summary-find-subject subject)) | |
8015 (setq count (1+ count)))) | |
8016 (t ; Mark as unread. | |
8017 (while (and | |
8018 (progn | |
8019 (gnus-summary-mark-article-as-unread gnus-unread-mark) | |
8020 (gnus-summary-show-thread) t) | |
8021 (gnus-summary-find-subject subject)) | |
8022 (setq count (1+ count))))) | |
8023 (gnus-set-mode-line 'summary) | |
8024 ;; Return the number of marked articles. | |
8025 count))) | |
8026 | |
8027 (defun gnus-summary-mark-as-processable (n &optional unmark) | |
8028 "Set the process mark on the next N articles. | |
8029 If N is negative, mark backward instead. If UNMARK is non-nil, remove | |
8030 the process mark instead. The difference between N and the actual | |
8031 number of articles marked is returned." | |
8032 (interactive "p") | |
8033 (let ((backward (< n 0)) | |
8034 (n (abs n))) | |
8035 (while (and | |
8036 (> n 0) | |
8037 (if unmark | |
8038 (gnus-summary-remove-process-mark | |
8039 (gnus-summary-article-number)) | |
8040 (gnus-summary-set-process-mark (gnus-summary-article-number))) | |
8041 (zerop (gnus-summary-next-subject (if backward -1 1) nil t))) | |
8042 (setq n (1- n))) | |
8043 (when (/= 0 n) | |
8044 (gnus-message 7 "No more articles")) | |
8045 (gnus-summary-recenter) | |
8046 (gnus-summary-position-point) | |
8047 n)) | |
8048 | |
8049 (defun gnus-summary-unmark-as-processable (n) | |
8050 "Remove the process mark from the next N articles. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8051 If N is negative, unmark backward instead. The difference between N and |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8052 the actual number of articles unmarked is returned." |
17493 | 8053 (interactive "p") |
8054 (gnus-summary-mark-as-processable n t)) | |
8055 | |
8056 (defun gnus-summary-unmark-all-processable () | |
8057 "Remove the process mark from all articles." | |
8058 (interactive) | |
8059 (save-excursion | |
8060 (while gnus-newsgroup-processable | |
8061 (gnus-summary-remove-process-mark (car gnus-newsgroup-processable)))) | |
8062 (gnus-summary-position-point)) | |
8063 | |
8064 (defun gnus-summary-mark-as-expirable (n) | |
8065 "Mark N articles forward as expirable. | |
8066 If N is negative, mark backward instead. The difference between N and | |
8067 the actual number of articles marked is returned." | |
8068 (interactive "p") | |
8069 (gnus-summary-mark-forward n gnus-expirable-mark)) | |
8070 | |
8071 (defun gnus-summary-mark-article-as-replied (article) | |
8072 "Mark ARTICLE replied and update the summary line." | |
8073 (push article gnus-newsgroup-replied) | |
8074 (let ((buffer-read-only nil)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8075 (when (gnus-summary-goto-subject article nil t) |
17493 | 8076 (gnus-summary-update-secondary-mark article)))) |
8077 | |
8078 (defun gnus-summary-set-bookmark (article) | |
8079 "Set a bookmark in current article." | |
8080 (interactive (list (gnus-summary-article-number))) | |
8081 (when (or (not (get-buffer gnus-article-buffer)) | |
8082 (not gnus-current-article) | |
8083 (not gnus-article-current) | |
8084 (not (equal gnus-newsgroup-name (car gnus-article-current)))) | |
8085 (error "No current article selected")) | |
8086 ;; Remove old bookmark, if one exists. | |
8087 (let ((old (assq article gnus-newsgroup-bookmarks))) | |
8088 (when old | |
8089 (setq gnus-newsgroup-bookmarks | |
8090 (delq old gnus-newsgroup-bookmarks)))) | |
8091 ;; Set the new bookmark, which is on the form | |
8092 ;; (article-number . line-number-in-body). | |
8093 (push | |
8094 (cons article | |
8095 (save-excursion | |
8096 (set-buffer gnus-article-buffer) | |
8097 (count-lines | |
8098 (min (point) | |
8099 (save-excursion | |
8100 (goto-char (point-min)) | |
8101 (search-forward "\n\n" nil t) | |
8102 (point))) | |
8103 (point)))) | |
8104 gnus-newsgroup-bookmarks) | |
8105 (gnus-message 6 "A bookmark has been added to the current article.")) | |
8106 | |
8107 (defun gnus-summary-remove-bookmark (article) | |
8108 "Remove the bookmark from the current article." | |
8109 (interactive (list (gnus-summary-article-number))) | |
8110 ;; Remove old bookmark, if one exists. | |
8111 (let ((old (assq article gnus-newsgroup-bookmarks))) | |
8112 (if old | |
8113 (progn | |
8114 (setq gnus-newsgroup-bookmarks | |
8115 (delq old gnus-newsgroup-bookmarks)) | |
8116 (gnus-message 6 "Removed bookmark.")) | |
8117 (gnus-message 6 "No bookmark in current article.")))) | |
8118 | |
8119 ;; Suggested by Daniel Quinlan <quinlan@best.com>. | |
8120 (defun gnus-summary-mark-as-dormant (n) | |
8121 "Mark N articles forward as dormant. | |
8122 If N is negative, mark backward instead. The difference between N and | |
8123 the actual number of articles marked is returned." | |
8124 (interactive "p") | |
8125 (gnus-summary-mark-forward n gnus-dormant-mark)) | |
8126 | |
8127 (defun gnus-summary-set-process-mark (article) | |
8128 "Set the process mark on ARTICLE and update the summary line." | |
8129 (setq gnus-newsgroup-processable | |
8130 (cons article | |
8131 (delq article gnus-newsgroup-processable))) | |
8132 (when (gnus-summary-goto-subject article) | |
8133 (gnus-summary-show-thread) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8134 (gnus-summary-goto-subject article) |
17493 | 8135 (gnus-summary-update-secondary-mark article))) |
8136 | |
8137 (defun gnus-summary-remove-process-mark (article) | |
8138 "Remove the process mark from ARTICLE and update the summary line." | |
8139 (setq gnus-newsgroup-processable (delq article gnus-newsgroup-processable)) | |
8140 (when (gnus-summary-goto-subject article) | |
8141 (gnus-summary-show-thread) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8142 (gnus-summary-goto-subject article) |
17493 | 8143 (gnus-summary-update-secondary-mark article))) |
8144 | |
8145 (defun gnus-summary-set-saved-mark (article) | |
8146 "Set the process mark on ARTICLE and update the summary line." | |
8147 (push article gnus-newsgroup-saved) | |
8148 (when (gnus-summary-goto-subject article) | |
8149 (gnus-summary-update-secondary-mark article))) | |
8150 | |
8151 (defun gnus-summary-mark-forward (n &optional mark no-expire) | |
8152 "Mark N articles as read forwards. | |
8153 If N is negative, mark backwards instead. Mark with MARK, ?r by default. | |
8154 The difference between N and the actual number of articles marked is | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8155 returned. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8156 Iff NO-EXPIRE, auto-expiry will be inhibited." |
17493 | 8157 (interactive "p") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8158 (gnus-summary-show-thread) |
17493 | 8159 (let ((backward (< n 0)) |
8160 (gnus-summary-goto-unread | |
8161 (and gnus-summary-goto-unread | |
8162 (not (eq gnus-summary-goto-unread 'never)) | |
8163 (not (memq mark (list gnus-unread-mark | |
8164 gnus-ticked-mark gnus-dormant-mark))))) | |
8165 (n (abs n)) | |
8166 (mark (or mark gnus-del-mark))) | |
8167 (while (and (> n 0) | |
8168 (gnus-summary-mark-article nil mark no-expire) | |
8169 (zerop (gnus-summary-next-subject | |
8170 (if backward -1 1) | |
8171 (and gnus-summary-goto-unread | |
8172 (not (eq gnus-summary-goto-unread 'never))) | |
8173 t))) | |
8174 (setq n (1- n))) | |
8175 (when (/= 0 n) | |
8176 (gnus-message 7 "No more %sarticles" (if mark "" "unread "))) | |
8177 (gnus-summary-recenter) | |
8178 (gnus-summary-position-point) | |
8179 (gnus-set-mode-line 'summary) | |
8180 n)) | |
8181 | |
8182 (defun gnus-summary-mark-article-as-read (mark) | |
8183 "Mark the current article quickly as read with MARK." | |
8184 (let ((article (gnus-summary-article-number))) | |
8185 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) | |
8186 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) | |
8187 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) | |
8188 (push (cons article mark) gnus-newsgroup-reads) | |
8189 ;; Possibly remove from cache, if that is used. | |
8190 (when gnus-use-cache | |
8191 (gnus-cache-enter-remove-article article)) | |
8192 ;; Allow the backend to change the mark. | |
8193 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) | |
8194 ;; Check for auto-expiry. | |
8195 (when (and gnus-newsgroup-auto-expire | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8196 (memq mark gnus-auto-expirable-marks)) |
17493 | 8197 (setq mark gnus-expirable-mark) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8198 ;; Let the backend know about the mark change. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8199 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) |
17493 | 8200 (push article gnus-newsgroup-expirable)) |
8201 ;; Set the mark in the buffer. | |
8202 (gnus-summary-update-mark mark 'unread) | |
8203 t)) | |
8204 | |
8205 (defun gnus-summary-mark-article-as-unread (mark) | |
8206 "Mark the current article quickly as unread with MARK." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8207 (let* ((article (gnus-summary-article-number)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8208 (old-mark (gnus-summary-article-mark article))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8209 ;; Allow the backend to change the mark. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8210 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8211 (if (eq mark old-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8212 t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8213 (if (<= article 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8214 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8215 (gnus-error 1 "Can't mark negative article numbers") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8216 nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8217 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8218 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8219 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8220 (setq gnus-newsgroup-reads (delq article gnus-newsgroup-reads)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8221 (cond ((= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8222 (push article gnus-newsgroup-marked)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8223 ((= mark gnus-dormant-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8224 (push article gnus-newsgroup-dormant)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8225 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8226 (push article gnus-newsgroup-unreads))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8227 (gnus-pull article gnus-newsgroup-reads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8228 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8229 ;; See whether the article is to be put in the cache. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8230 (and gnus-use-cache |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8231 (vectorp (gnus-summary-article-header article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8232 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8233 (gnus-cache-possibly-enter-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8234 gnus-newsgroup-name article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8235 (= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8236 (= mark gnus-dormant-mark) (= mark gnus-unread-mark)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8237 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8238 ;; Fix the mark. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8239 (gnus-summary-update-mark mark 'unread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8240 t)))) |
17493 | 8241 |
8242 (defun gnus-summary-mark-article (&optional article mark no-expire) | |
8243 "Mark ARTICLE with MARK. MARK can be any character. | |
8244 Four MARK strings are reserved: `? ' (unread), `?!' (ticked), | |
8245 `??' (dormant) and `?E' (expirable). | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8246 If MARK is nil, then the default character `?r' is used. |
17493 | 8247 If ARTICLE is nil, then the article on the current line will be |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8248 marked. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8249 Iff NO-EXPIRE, auto-expiry will be inhibited." |
17493 | 8250 ;; The mark might be a string. |
8251 (when (stringp mark) | |
8252 (setq mark (aref mark 0))) | |
8253 ;; If no mark is given, then we check auto-expiring. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8254 (when (null mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8255 (setq mark gnus-del-mark)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8256 (when (and (not no-expire) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8257 gnus-newsgroup-auto-expire |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8258 (memq mark gnus-auto-expirable-marks)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8259 (setq mark gnus-expirable-mark)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8260 (let ((article (or article (gnus-summary-article-number))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8261 (old-mark (gnus-summary-article-mark article))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8262 ;; Allow the backend to change the mark. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8263 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8264 (if (eq mark old-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8265 t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8266 (unless article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8267 (error "No article on current line")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8268 (if (not (if (or (= mark gnus-unread-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8269 (= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8270 (= mark gnus-dormant-mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8271 (gnus-mark-article-as-unread article mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8272 (gnus-mark-article-as-read article mark))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8273 t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8274 ;; See whether the article is to be put in the cache. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8275 (and gnus-use-cache |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8276 (not (= mark gnus-canceled-mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8277 (vectorp (gnus-summary-article-header article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8278 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8279 (gnus-cache-possibly-enter-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8280 gnus-newsgroup-name article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8281 (= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8282 (= mark gnus-dormant-mark) (= mark gnus-unread-mark)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8283 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8284 (when (gnus-summary-goto-subject article nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8285 (let ((buffer-read-only nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8286 (gnus-summary-show-thread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8287 ;; Fix the mark. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8288 (gnus-summary-update-mark mark 'unread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8289 t)))))) |
17493 | 8290 |
8291 (defun gnus-summary-update-secondary-mark (article) | |
8292 "Update the secondary (read, process, cache) mark." | |
8293 (gnus-summary-update-mark | |
8294 (cond ((memq article gnus-newsgroup-processable) | |
8295 gnus-process-mark) | |
8296 ((memq article gnus-newsgroup-cached) | |
8297 gnus-cached-mark) | |
8298 ((memq article gnus-newsgroup-replied) | |
8299 gnus-replied-mark) | |
8300 ((memq article gnus-newsgroup-saved) | |
8301 gnus-saved-mark) | |
8302 (t gnus-unread-mark)) | |
8303 'replied) | |
8304 (when (gnus-visual-p 'summary-highlight 'highlight) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8305 (gnus-run-hooks 'gnus-summary-update-hook)) |
17493 | 8306 t) |
8307 | |
8308 (defun gnus-summary-update-mark (mark type) | |
8309 (let ((forward (cdr (assq type gnus-summary-mark-positions))) | |
8310 (buffer-read-only nil)) | |
8311 (re-search-backward "[\n\r]" (gnus-point-at-bol) 'move-to-limit) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8312 (when forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8313 (when (looking-at "\r") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8314 (incf forward)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8315 (when (<= (+ forward (point)) (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8316 ;; Go to the right position on the line. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8317 (goto-char (+ forward (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8318 ;; Replace the old mark with the new mark. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8319 (subst-char-in-region (point) (1+ (point)) (char-after) mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8320 ;; Optionally update the marks by some user rule. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8321 (when (eq type 'unread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8322 (gnus-data-set-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8323 (gnus-data-find (gnus-summary-article-number)) mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8324 (gnus-summary-update-line (eq mark gnus-unread-mark))))))) |
17493 | 8325 |
8326 (defun gnus-mark-article-as-read (article &optional mark) | |
8327 "Enter ARTICLE in the pertinent lists and remove it from others." | |
8328 ;; Make the article expirable. | |
8329 (let ((mark (or mark gnus-del-mark))) | |
8330 (if (= mark gnus-expirable-mark) | |
8331 (push article gnus-newsgroup-expirable) | |
8332 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))) | |
8333 ;; Remove from unread and marked lists. | |
8334 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) | |
8335 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) | |
8336 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) | |
8337 (push (cons article mark) gnus-newsgroup-reads) | |
8338 ;; Possibly remove from cache, if that is used. | |
8339 (when gnus-use-cache | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8340 (gnus-cache-enter-remove-article article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8341 t)) |
17493 | 8342 |
8343 (defun gnus-mark-article-as-unread (article &optional mark) | |
8344 "Enter ARTICLE in the pertinent lists and remove it from others." | |
8345 (let ((mark (or mark gnus-ticked-mark))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8346 (if (<= article 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8347 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8348 (gnus-error 1 "Can't mark negative article numbers") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8349 nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8350 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8351 gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8352 gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8353 gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8354 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8355 ;; Unsuppress duplicates? |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8356 (when gnus-suppress-duplicates |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8357 (gnus-dup-unsuppress-article article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8358 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8359 (cond ((= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8360 (push article gnus-newsgroup-marked)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8361 ((= mark gnus-dormant-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8362 (push article gnus-newsgroup-dormant)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8363 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8364 (push article gnus-newsgroup-unreads))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8365 (gnus-pull article gnus-newsgroup-reads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8366 t))) |
17493 | 8367 |
8368 (defalias 'gnus-summary-mark-as-unread-forward | |
8369 'gnus-summary-tick-article-forward) | |
8370 (make-obsolete 'gnus-summary-mark-as-unread-forward | |
8371 'gnus-summary-tick-article-forward) | |
8372 (defun gnus-summary-tick-article-forward (n) | |
8373 "Tick N articles forwards. | |
8374 If N is negative, tick backwards instead. | |
8375 The difference between N and the number of articles ticked is returned." | |
8376 (interactive "p") | |
8377 (gnus-summary-mark-forward n gnus-ticked-mark)) | |
8378 | |
8379 (defalias 'gnus-summary-mark-as-unread-backward | |
8380 'gnus-summary-tick-article-backward) | |
8381 (make-obsolete 'gnus-summary-mark-as-unread-backward | |
8382 'gnus-summary-tick-article-backward) | |
8383 (defun gnus-summary-tick-article-backward (n) | |
8384 "Tick N articles backwards. | |
8385 The difference between N and the number of articles ticked is returned." | |
8386 (interactive "p") | |
8387 (gnus-summary-mark-forward (- n) gnus-ticked-mark)) | |
8388 | |
8389 (defalias 'gnus-summary-mark-as-unread 'gnus-summary-tick-article) | |
8390 (make-obsolete 'gnus-summary-mark-as-unread 'gnus-summary-tick-article) | |
8391 (defun gnus-summary-tick-article (&optional article clear-mark) | |
8392 "Mark current article as unread. | |
8393 Optional 1st argument ARTICLE specifies article number to be marked as unread. | |
8394 Optional 2nd argument CLEAR-MARK remove any kinds of mark." | |
8395 (interactive) | |
8396 (gnus-summary-mark-article article (if clear-mark gnus-unread-mark | |
8397 gnus-ticked-mark))) | |
8398 | |
8399 (defun gnus-summary-mark-as-read-forward (n) | |
8400 "Mark N articles as read forwards. | |
8401 If N is negative, mark backwards instead. | |
8402 The difference between N and the actual number of articles marked is | |
8403 returned." | |
8404 (interactive "p") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8405 (gnus-summary-mark-forward n gnus-del-mark gnus-inhibit-user-auto-expire)) |
17493 | 8406 |
8407 (defun gnus-summary-mark-as-read-backward (n) | |
8408 "Mark the N articles as read backwards. | |
8409 The difference between N and the actual number of articles marked is | |
8410 returned." | |
8411 (interactive "p") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8412 (gnus-summary-mark-forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8413 (- n) gnus-del-mark gnus-inhibit-user-auto-expire)) |
17493 | 8414 |
8415 (defun gnus-summary-mark-as-read (&optional article mark) | |
8416 "Mark current article as read. | |
8417 ARTICLE specifies the article to be marked as read. | |
8418 MARK specifies a string to be inserted at the beginning of the line." | |
8419 (gnus-summary-mark-article article mark)) | |
8420 | |
8421 (defun gnus-summary-clear-mark-forward (n) | |
8422 "Clear marks from N articles forward. | |
8423 If N is negative, clear backward instead. | |
8424 The difference between N and the number of marks cleared is returned." | |
8425 (interactive "p") | |
8426 (gnus-summary-mark-forward n gnus-unread-mark)) | |
8427 | |
8428 (defun gnus-summary-clear-mark-backward (n) | |
8429 "Clear marks from N articles backward. | |
8430 The difference between N and the number of marks cleared is returned." | |
8431 (interactive "p") | |
8432 (gnus-summary-mark-forward (- n) gnus-unread-mark)) | |
8433 | |
8434 (defun gnus-summary-mark-unread-as-read () | |
8435 "Intended to be used by `gnus-summary-mark-article-hook'." | |
8436 (when (memq gnus-current-article gnus-newsgroup-unreads) | |
8437 (gnus-summary-mark-article gnus-current-article gnus-read-mark))) | |
8438 | |
8439 (defun gnus-summary-mark-read-and-unread-as-read () | |
8440 "Intended to be used by `gnus-summary-mark-article-hook'." | |
8441 (let ((mark (gnus-summary-article-mark))) | |
8442 (when (or (gnus-unread-mark-p mark) | |
8443 (gnus-read-mark-p mark)) | |
8444 (gnus-summary-mark-article gnus-current-article gnus-read-mark)))) | |
8445 | |
8446 (defun gnus-summary-mark-region-as-read (point mark all) | |
8447 "Mark all unread articles between point and mark as read. | |
8448 If given a prefix, mark all articles between point and mark as read, | |
8449 even ticked and dormant ones." | |
8450 (interactive "r\nP") | |
8451 (save-excursion | |
8452 (let (article) | |
8453 (goto-char point) | |
8454 (beginning-of-line) | |
8455 (while (and | |
8456 (< (point) mark) | |
8457 (progn | |
8458 (when (or all | |
8459 (memq (setq article (gnus-summary-article-number)) | |
8460 gnus-newsgroup-unreads)) | |
8461 (gnus-summary-mark-article article gnus-del-mark)) | |
8462 t) | |
8463 (gnus-summary-find-next)))))) | |
8464 | |
8465 (defun gnus-summary-mark-below (score mark) | |
8466 "Mark articles with score less than SCORE with MARK." | |
8467 (interactive "P\ncMark: ") | |
8468 (setq score (if score | |
8469 (prefix-numeric-value score) | |
8470 (or gnus-summary-default-score 0))) | |
8471 (save-excursion | |
8472 (set-buffer gnus-summary-buffer) | |
8473 (goto-char (point-min)) | |
8474 (while | |
8475 (progn | |
8476 (and (< (gnus-summary-article-score) score) | |
8477 (gnus-summary-mark-article nil mark)) | |
8478 (gnus-summary-find-next))))) | |
8479 | |
8480 (defun gnus-summary-kill-below (&optional score) | |
8481 "Mark articles with score below SCORE as read." | |
8482 (interactive "P") | |
8483 (gnus-summary-mark-below score gnus-killed-mark)) | |
8484 | |
8485 (defun gnus-summary-clear-above (&optional score) | |
8486 "Clear all marks from articles with score above SCORE." | |
8487 (interactive "P") | |
8488 (gnus-summary-mark-above score gnus-unread-mark)) | |
8489 | |
8490 (defun gnus-summary-tick-above (&optional score) | |
8491 "Tick all articles with score above SCORE." | |
8492 (interactive "P") | |
8493 (gnus-summary-mark-above score gnus-ticked-mark)) | |
8494 | |
8495 (defun gnus-summary-mark-above (score mark) | |
8496 "Mark articles with score over SCORE with MARK." | |
8497 (interactive "P\ncMark: ") | |
8498 (setq score (if score | |
8499 (prefix-numeric-value score) | |
8500 (or gnus-summary-default-score 0))) | |
8501 (save-excursion | |
8502 (set-buffer gnus-summary-buffer) | |
8503 (goto-char (point-min)) | |
8504 (while (and (progn | |
8505 (when (> (gnus-summary-article-score) score) | |
8506 (gnus-summary-mark-article nil mark)) | |
8507 t) | |
8508 (gnus-summary-find-next))))) | |
8509 | |
8510 ;; Suggested by Daniel Quinlan <quinlan@best.com>. | |
8511 (defalias 'gnus-summary-show-all-expunged 'gnus-summary-limit-include-expunged) | |
8512 (defun gnus-summary-limit-include-expunged (&optional no-error) | |
8513 "Display all the hidden articles that were expunged for low scores." | |
8514 (interactive) | |
8515 (let ((buffer-read-only nil)) | |
8516 (let ((scored gnus-newsgroup-scored) | |
8517 headers h) | |
8518 (while scored | |
8519 (unless (gnus-summary-goto-subject (caar scored)) | |
8520 (and (setq h (gnus-summary-article-header (caar scored))) | |
8521 (< (cdar scored) gnus-summary-expunge-below) | |
8522 (push h headers))) | |
8523 (setq scored (cdr scored))) | |
8524 (if (not headers) | |
8525 (when (not no-error) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8526 (error "No expunged articles hidden")) |
17493 | 8527 (goto-char (point-min)) |
8528 (gnus-summary-prepare-unthreaded (nreverse headers)) | |
8529 (goto-char (point-min)) | |
8530 (gnus-summary-position-point) | |
8531 t)))) | |
8532 | |
8533 (defun gnus-summary-catchup (&optional all quietly to-here not-mark) | |
8534 "Mark all unread articles in this newsgroup as read. | |
8535 If prefix argument ALL is non-nil, ticked and dormant articles will | |
8536 also be marked as read. | |
8537 If QUIETLY is non-nil, no questions will be asked. | |
8538 If TO-HERE is non-nil, it should be a point in the buffer. All | |
8539 articles before this point will be marked as read. | |
8540 Note that this function will only catch up the unread article | |
8541 in the current summary buffer limitation. | |
8542 The number of articles marked as read is returned." | |
8543 (interactive "P") | |
8544 (prog1 | |
8545 (save-excursion | |
8546 (when (or quietly | |
8547 (not gnus-interactive-catchup) ;Without confirmation? | |
8548 gnus-expert-user | |
8549 (gnus-y-or-n-p | |
8550 (if all | |
8551 "Mark absolutely all articles as read? " | |
8552 "Mark all unread articles as read? "))) | |
8553 (if (and not-mark | |
8554 (not gnus-newsgroup-adaptive) | |
8555 (not gnus-newsgroup-auto-expire) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8556 (not gnus-suppress-duplicates) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8557 (or (not gnus-use-cache) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8558 (eq gnus-use-cache 'passive))) |
17493 | 8559 (progn |
8560 (when all | |
8561 (setq gnus-newsgroup-marked nil | |
8562 gnus-newsgroup-dormant nil)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8563 (setq gnus-newsgroup-unreads gnus-newsgroup-downloadable)) |
17493 | 8564 ;; We actually mark all articles as canceled, which we |
8565 ;; have to do when using auto-expiry or adaptive scoring. | |
8566 (gnus-summary-show-all-threads) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8567 (when (gnus-summary-first-subject (not all) t) |
17493 | 8568 (while (and |
8569 (if to-here (< (point) to-here) t) | |
8570 (gnus-summary-mark-article-as-read gnus-catchup-mark) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8571 (gnus-summary-find-next (not all) nil nil t)))) |
17493 | 8572 (gnus-set-mode-line 'summary)) |
8573 t)) | |
8574 (gnus-summary-position-point))) | |
8575 | |
8576 (defun gnus-summary-catchup-to-here (&optional all) | |
8577 "Mark all unticked articles before the current one as read. | |
8578 If ALL is non-nil, also mark ticked and dormant articles as read." | |
8579 (interactive "P") | |
8580 (save-excursion | |
8581 (gnus-save-hidden-threads | |
8582 (let ((beg (point))) | |
8583 ;; We check that there are unread articles. | |
8584 (when (or all (gnus-summary-find-prev)) | |
8585 (gnus-summary-catchup all t beg))))) | |
8586 (gnus-summary-position-point)) | |
8587 | |
8588 (defun gnus-summary-catchup-all (&optional quietly) | |
8589 "Mark all articles in this newsgroup as read." | |
8590 (interactive "P") | |
8591 (gnus-summary-catchup t quietly)) | |
8592 | |
8593 (defun gnus-summary-catchup-and-exit (&optional all quietly) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8594 "Mark all unread articles in this group as read, then exit. |
17493 | 8595 If prefix argument ALL is non-nil, all articles are marked as read." |
8596 (interactive "P") | |
8597 (when (gnus-summary-catchup all quietly nil 'fast) | |
8598 ;; Select next newsgroup or exit. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8599 (if (and (not (gnus-group-quit-config gnus-newsgroup-name)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8600 (eq gnus-auto-select-next 'quietly)) |
17493 | 8601 (gnus-summary-next-group nil) |
8602 (gnus-summary-exit)))) | |
8603 | |
8604 (defun gnus-summary-catchup-all-and-exit (&optional quietly) | |
8605 "Mark all articles in this newsgroup as read, and then exit." | |
8606 (interactive "P") | |
8607 (gnus-summary-catchup-and-exit t quietly)) | |
8608 | |
8609 (defun gnus-summary-catchup-and-goto-next-group (&optional all) | |
8610 "Mark all articles in this group as read and select the next group. | |
8611 If given a prefix, mark all articles, unread as well as ticked, as | |
8612 read." | |
8613 (interactive "P") | |
8614 (save-excursion | |
8615 (gnus-summary-catchup all)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8616 (gnus-summary-next-group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8617 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8618 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8619 ;;; with article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8620 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8621 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8622 (defmacro gnus-with-article (article &rest forms) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8623 "Select ARTICLE and perform FORMS in the original article buffer. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8624 Then replace the article with the result." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8625 `(progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8626 ;; We don't want the article to be marked as read. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8627 (let (gnus-mark-article-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8628 (gnus-summary-select-article t t nil ,article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8629 (set-buffer gnus-original-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8630 ,@forms |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8631 (if (not (gnus-check-backend-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8632 'request-replace-article (car gnus-article-current))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8633 (gnus-message 5 "Read-only group; not replacing") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8634 (unless (gnus-request-replace-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8635 ,article (car gnus-article-current) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8636 (current-buffer) t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8637 (error "Couldn't replace article"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8638 ;; The cache and backlog have to be flushed somewhat. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8639 (when gnus-keep-backlog |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8640 (gnus-backlog-remove-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8641 (car gnus-article-current) (cdr gnus-article-current))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8642 (when gnus-use-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8643 (gnus-cache-update-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8644 (car gnus-article-current) (cdr gnus-article-current))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8645 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8646 (put 'gnus-with-article 'lisp-indent-function 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8647 (put 'gnus-with-article 'edebug-form-spec '(form body)) |
17493 | 8648 |
8649 ;; Thread-based commands. | |
8650 | |
8651 (defun gnus-summary-articles-in-thread (&optional article) | |
8652 "Return a list of all articles in the current thread. | |
8653 If ARTICLE is non-nil, return all articles in the thread that starts | |
8654 with that article." | |
8655 (let* ((article (or article (gnus-summary-article-number))) | |
8656 (data (gnus-data-find-list article)) | |
8657 (top-level (gnus-data-level (car data))) | |
8658 (top-subject | |
8659 (cond ((null gnus-thread-operation-ignore-subject) | |
8660 (gnus-simplify-subject-re | |
8661 (mail-header-subject (gnus-data-header (car data))))) | |
8662 ((eq gnus-thread-operation-ignore-subject 'fuzzy) | |
8663 (gnus-simplify-subject-fuzzy | |
8664 (mail-header-subject (gnus-data-header (car data))))) | |
8665 (t nil))) | |
8666 (end-point (save-excursion | |
8667 (if (gnus-summary-go-to-next-thread) | |
8668 (point) (point-max)))) | |
8669 articles) | |
8670 (while (and data | |
8671 (< (gnus-data-pos (car data)) end-point)) | |
8672 (when (or (not top-subject) | |
8673 (string= top-subject | |
8674 (if (eq gnus-thread-operation-ignore-subject 'fuzzy) | |
8675 (gnus-simplify-subject-fuzzy | |
8676 (mail-header-subject | |
8677 (gnus-data-header (car data)))) | |
8678 (gnus-simplify-subject-re | |
8679 (mail-header-subject | |
8680 (gnus-data-header (car data))))))) | |
8681 (push (gnus-data-number (car data)) articles)) | |
8682 (unless (and (setq data (cdr data)) | |
8683 (> (gnus-data-level (car data)) top-level)) | |
8684 (setq data nil))) | |
8685 ;; Return the list of articles. | |
8686 (nreverse articles))) | |
8687 | |
8688 (defun gnus-summary-rethread-current () | |
8689 "Rethread the thread the current article is part of." | |
8690 (interactive) | |
8691 (let* ((gnus-show-threads t) | |
8692 (article (gnus-summary-article-number)) | |
8693 (id (mail-header-id (gnus-summary-article-header))) | |
8694 (gnus-newsgroup-threads (list (gnus-id-to-thread (gnus-root-id id))))) | |
8695 (unless id | |
8696 (error "No article on the current line")) | |
8697 (gnus-rebuild-thread id) | |
8698 (gnus-summary-goto-subject article))) | |
8699 | |
8700 (defun gnus-summary-reparent-thread () | |
8701 "Make the current article child of the marked (or previous) article. | |
8702 | |
8703 Note that the re-threading will only work if `gnus-thread-ignore-subject' | |
8704 is non-nil or the Subject: of both articles are the same." | |
8705 (interactive) | |
8706 (unless (not (gnus-group-read-only-p)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8707 (error "The current newsgroup does not support article editing")) |
17493 | 8708 (unless (<= (length gnus-newsgroup-processable) 1) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8709 (error "No more than one article may be marked")) |
17493 | 8710 (save-window-excursion |
8711 (let ((gnus-article-buffer " *reparent*") | |
8712 (current-article (gnus-summary-article-number)) | |
8713 ;; First grab the marked article, otherwise one line up. | |
8714 (parent-article (if (not (null gnus-newsgroup-processable)) | |
8715 (car gnus-newsgroup-processable) | |
8716 (save-excursion | |
8717 (if (eq (forward-line -1) 0) | |
8718 (gnus-summary-article-number) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8719 (error "Beginning of summary buffer")))))) |
17493 | 8720 (unless (not (eq current-article parent-article)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8721 (error "An article may not be self-referential")) |
17493 | 8722 (let ((message-id (mail-header-id |
8723 (gnus-summary-article-header parent-article)))) | |
8724 (unless (and message-id (not (equal message-id ""))) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8725 (error "No message-id in desired parent")) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8726 (gnus-with-article current-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8727 (save-restriction |
17493 | 8728 (goto-char (point-min)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8729 (message-narrow-to-head) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8730 (if (re-search-forward "^References: " nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8731 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8732 (re-search-forward "^[^ \t]" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8733 (forward-line -1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8734 (end-of-line) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8735 (insert " " message-id)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8736 (insert "References: " message-id "\n")))) |
17493 | 8737 (set-buffer gnus-summary-buffer) |
8738 (gnus-summary-unmark-all-processable) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8739 (gnus-summary-update-article current-article) |
17493 | 8740 (gnus-summary-rethread-current) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8741 (gnus-message 3 "Article %d is now the child of article %d" |
17493 | 8742 current-article parent-article))))) |
8743 | |
8744 (defun gnus-summary-toggle-threads (&optional arg) | |
8745 "Toggle showing conversation threads. | |
8746 If ARG is positive number, turn showing conversation threads on." | |
8747 (interactive "P") | |
8748 (let ((current (or (gnus-summary-article-number) gnus-newsgroup-end))) | |
8749 (setq gnus-show-threads | |
8750 (if (null arg) (not gnus-show-threads) | |
8751 (> (prefix-numeric-value arg) 0))) | |
8752 (gnus-summary-prepare) | |
8753 (gnus-summary-goto-subject current) | |
8754 (gnus-message 6 "Threading is now %s" (if gnus-show-threads "on" "off")) | |
8755 (gnus-summary-position-point))) | |
8756 | |
8757 (defun gnus-summary-show-all-threads () | |
8758 "Show all threads." | |
8759 (interactive) | |
8760 (save-excursion | |
8761 (let ((buffer-read-only nil)) | |
8762 (subst-char-in-region (point-min) (point-max) ?\^M ?\n t))) | |
8763 (gnus-summary-position-point)) | |
8764 | |
8765 (defun gnus-summary-show-thread () | |
8766 "Show thread subtrees. | |
8767 Returns nil if no thread was there to be shown." | |
8768 (interactive) | |
8769 (let ((buffer-read-only nil) | |
8770 (orig (point)) | |
8771 ;; first goto end then to beg, to have point at beg after let | |
8772 (end (progn (end-of-line) (point))) | |
8773 (beg (progn (beginning-of-line) (point)))) | |
8774 (prog1 | |
8775 ;; Any hidden lines here? | |
8776 (search-forward "\r" end t) | |
8777 (subst-char-in-region beg end ?\^M ?\n t) | |
8778 (goto-char orig) | |
8779 (gnus-summary-position-point)))) | |
8780 | |
8781 (defun gnus-summary-hide-all-threads () | |
8782 "Hide all thread subtrees." | |
8783 (interactive) | |
8784 (save-excursion | |
8785 (goto-char (point-min)) | |
8786 (gnus-summary-hide-thread) | |
8787 (while (zerop (gnus-summary-next-thread 1 t)) | |
8788 (gnus-summary-hide-thread))) | |
8789 (gnus-summary-position-point)) | |
8790 | |
8791 (defun gnus-summary-hide-thread () | |
8792 "Hide thread subtrees. | |
8793 Returns nil if no threads were there to be hidden." | |
8794 (interactive) | |
8795 (let ((buffer-read-only nil) | |
8796 (start (point)) | |
8797 (article (gnus-summary-article-number))) | |
8798 (goto-char start) | |
8799 ;; Go forward until either the buffer ends or the subthread | |
8800 ;; ends. | |
8801 (when (and (not (eobp)) | |
8802 (or (zerop (gnus-summary-next-thread 1 t)) | |
8803 (goto-char (point-max)))) | |
8804 (prog1 | |
8805 (if (and (> (point) start) | |
8806 (search-backward "\n" start t)) | |
8807 (progn | |
8808 (subst-char-in-region start (point) ?\n ?\^M) | |
8809 (gnus-summary-goto-subject article)) | |
8810 (goto-char start) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8811 nil))))) |
17493 | 8812 |
8813 (defun gnus-summary-go-to-next-thread (&optional previous) | |
8814 "Go to the same level (or less) next thread. | |
8815 If PREVIOUS is non-nil, go to previous thread instead. | |
8816 Return the article number moved to, or nil if moving was impossible." | |
8817 (let ((level (gnus-summary-thread-level)) | |
8818 (way (if previous -1 1)) | |
8819 (beg (point))) | |
8820 (forward-line way) | |
8821 (while (and (not (eobp)) | |
8822 (< level (gnus-summary-thread-level))) | |
8823 (forward-line way)) | |
8824 (if (eobp) | |
8825 (progn | |
8826 (goto-char beg) | |
8827 nil) | |
8828 (setq beg (point)) | |
8829 (prog1 | |
8830 (gnus-summary-article-number) | |
8831 (goto-char beg))))) | |
8832 | |
8833 (defun gnus-summary-next-thread (n &optional silent) | |
8834 "Go to the same level next N'th thread. | |
8835 If N is negative, search backward instead. | |
8836 Returns the difference between N and the number of skips actually | |
8837 done. | |
8838 | |
8839 If SILENT, don't output messages." | |
8840 (interactive "p") | |
8841 (let ((backward (< n 0)) | |
8842 (n (abs n))) | |
8843 (while (and (> n 0) | |
8844 (gnus-summary-go-to-next-thread backward)) | |
8845 (decf n)) | |
8846 (unless silent | |
8847 (gnus-summary-position-point)) | |
8848 (when (and (not silent) (/= 0 n)) | |
8849 (gnus-message 7 "No more threads")) | |
8850 n)) | |
8851 | |
8852 (defun gnus-summary-prev-thread (n) | |
8853 "Go to the same level previous N'th thread. | |
8854 Returns the difference between N and the number of skips actually | |
8855 done." | |
8856 (interactive "p") | |
8857 (gnus-summary-next-thread (- n))) | |
8858 | |
8859 (defun gnus-summary-go-down-thread () | |
8860 "Go down one level in the current thread." | |
8861 (let ((children (gnus-summary-article-children))) | |
8862 (when children | |
8863 (gnus-summary-goto-subject (car children))))) | |
8864 | |
8865 (defun gnus-summary-go-up-thread () | |
8866 "Go up one level in the current thread." | |
8867 (let ((parent (gnus-summary-article-parent))) | |
8868 (when parent | |
8869 (gnus-summary-goto-subject parent)))) | |
8870 | |
8871 (defun gnus-summary-down-thread (n) | |
8872 "Go down thread N steps. | |
8873 If N is negative, go up instead. | |
8874 Returns the difference between N and how many steps down that were | |
8875 taken." | |
8876 (interactive "p") | |
8877 (let ((up (< n 0)) | |
8878 (n (abs n))) | |
8879 (while (and (> n 0) | |
8880 (if up (gnus-summary-go-up-thread) | |
8881 (gnus-summary-go-down-thread))) | |
8882 (setq n (1- n))) | |
8883 (gnus-summary-position-point) | |
8884 (when (/= 0 n) | |
8885 (gnus-message 7 "Can't go further")) | |
8886 n)) | |
8887 | |
8888 (defun gnus-summary-up-thread (n) | |
8889 "Go up thread N steps. | |
8890 If N is negative, go up instead. | |
8891 Returns the difference between N and how many steps down that were | |
8892 taken." | |
8893 (interactive "p") | |
8894 (gnus-summary-down-thread (- n))) | |
8895 | |
8896 (defun gnus-summary-top-thread () | |
8897 "Go to the top of the thread." | |
8898 (interactive) | |
8899 (while (gnus-summary-go-up-thread)) | |
8900 (gnus-summary-article-number)) | |
8901 | |
8902 (defun gnus-summary-kill-thread (&optional unmark) | |
8903 "Mark articles under current thread as read. | |
8904 If the prefix argument is positive, remove any kinds of marks. | |
8905 If the prefix argument is negative, tick articles instead." | |
8906 (interactive "P") | |
8907 (when unmark | |
8908 (setq unmark (prefix-numeric-value unmark))) | |
8909 (let ((articles (gnus-summary-articles-in-thread))) | |
8910 (save-excursion | |
8911 ;; Expand the thread. | |
8912 (gnus-summary-show-thread) | |
8913 ;; Mark all the articles. | |
8914 (while articles | |
8915 (gnus-summary-goto-subject (car articles)) | |
8916 (cond ((null unmark) | |
8917 (gnus-summary-mark-article-as-read gnus-killed-mark)) | |
8918 ((> unmark 0) | |
8919 (gnus-summary-mark-article-as-unread gnus-unread-mark)) | |
8920 (t | |
8921 (gnus-summary-mark-article-as-unread gnus-ticked-mark))) | |
8922 (setq articles (cdr articles)))) | |
8923 ;; Hide killed subtrees. | |
8924 (and (null unmark) | |
8925 gnus-thread-hide-killed | |
8926 (gnus-summary-hide-thread)) | |
8927 ;; If marked as read, go to next unread subject. | |
8928 (when (null unmark) | |
8929 ;; Go to next unread subject. | |
8930 (gnus-summary-next-subject 1 t))) | |
8931 (gnus-set-mode-line 'summary)) | |
8932 | |
8933 ;; Summary sorting commands | |
8934 | |
8935 (defun gnus-summary-sort-by-number (&optional reverse) | |
8936 "Sort the summary buffer by article number. | |
8937 Argument REVERSE means reverse order." | |
8938 (interactive "P") | |
8939 (gnus-summary-sort 'number reverse)) | |
8940 | |
8941 (defun gnus-summary-sort-by-author (&optional reverse) | |
8942 "Sort the summary buffer by author name alphabetically. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8943 If `case-fold-search' is non-nil, case of letters is ignored. |
17493 | 8944 Argument REVERSE means reverse order." |
8945 (interactive "P") | |
8946 (gnus-summary-sort 'author reverse)) | |
8947 | |
8948 (defun gnus-summary-sort-by-subject (&optional reverse) | |
8949 "Sort the summary buffer by subject alphabetically. `Re:'s are ignored. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8950 If `case-fold-search' is non-nil, case of letters is ignored. |
17493 | 8951 Argument REVERSE means reverse order." |
8952 (interactive "P") | |
8953 (gnus-summary-sort 'subject reverse)) | |
8954 | |
8955 (defun gnus-summary-sort-by-date (&optional reverse) | |
8956 "Sort the summary buffer by date. | |
8957 Argument REVERSE means reverse order." | |
8958 (interactive "P") | |
8959 (gnus-summary-sort 'date reverse)) | |
8960 | |
8961 (defun gnus-summary-sort-by-score (&optional reverse) | |
8962 "Sort the summary buffer by score. | |
8963 Argument REVERSE means reverse order." | |
8964 (interactive "P") | |
8965 (gnus-summary-sort 'score reverse)) | |
8966 | |
8967 (defun gnus-summary-sort-by-lines (&optional reverse) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8968 "Sort the summary buffer by the number of lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8969 Argument REVERSE means reverse order." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8970 (interactive "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8971 (gnus-summary-sort 'lines reverse)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8972 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8973 (defun gnus-summary-sort-by-chars (&optional reverse) |
17493 | 8974 "Sort the summary buffer by article length. |
8975 Argument REVERSE means reverse order." | |
8976 (interactive "P") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8977 (gnus-summary-sort 'chars reverse)) |
17493 | 8978 |
8979 (defun gnus-summary-sort (predicate reverse) | |
8980 "Sort summary buffer by PREDICATE. REVERSE means reverse order." | |
8981 (let* ((thread (intern (format "gnus-thread-sort-by-%s" predicate))) | |
8982 (article (intern (format "gnus-article-sort-by-%s" predicate))) | |
8983 (gnus-thread-sort-functions | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8984 (if (not reverse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8985 thread |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8986 `(lambda (t1 t2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8987 (,thread t2 t1)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8988 (gnus-sort-gathered-threads-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8989 gnus-thread-sort-functions) |
17493 | 8990 (gnus-article-sort-functions |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8991 (if (not reverse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8992 article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8993 `(lambda (t1 t2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8994 (,article t2 t1)))) |
17493 | 8995 (buffer-read-only) |
8996 (gnus-summary-prepare-hook nil)) | |
8997 ;; We do the sorting by regenerating the threads. | |
8998 (gnus-summary-prepare) | |
8999 ;; Hide subthreads if needed. | |
9000 (when (and gnus-show-threads gnus-thread-hide-subtree) | |
9001 (gnus-summary-hide-all-threads)))) | |
9002 | |
9003 ;; Summary saving commands. | |
9004 | |
9005 (defun gnus-summary-save-article (&optional n not-saved) | |
9006 "Save the current article using the default saver function. | |
9007 If N is a positive number, save the N next articles. | |
9008 If N is a negative number, save the N previous articles. | |
9009 If N is nil and any articles have been marked with the process mark, | |
9010 save those articles instead. | |
9011 The variable `gnus-default-article-saver' specifies the saver function." | |
9012 (interactive "P") | |
9013 (let* ((articles (gnus-summary-work-articles n)) | |
9014 (save-buffer (save-excursion | |
9015 (nnheader-set-temp-buffer " *Gnus Save*"))) | |
9016 (num (length articles)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9017 header file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9018 (dolist (article articles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9019 (setq header (gnus-summary-article-header article)) |
17493 | 9020 (if (not (vectorp header)) |
9021 ;; This is a pseudo-article. | |
9022 (if (assq 'name header) | |
9023 (gnus-copy-file (cdr (assq 'name header))) | |
9024 (gnus-message 1 "Article %d is unsaveable" article)) | |
9025 ;; This is a real article. | |
9026 (save-window-excursion | |
9027 (gnus-summary-select-article t nil nil article)) | |
9028 (save-excursion | |
9029 (set-buffer save-buffer) | |
9030 (erase-buffer) | |
9031 (insert-buffer-substring gnus-original-article-buffer)) | |
9032 (setq file (gnus-article-save save-buffer file num)) | |
9033 (gnus-summary-remove-process-mark article) | |
9034 (unless not-saved | |
9035 (gnus-summary-set-saved-mark article)))) | |
9036 (gnus-kill-buffer save-buffer) | |
9037 (gnus-summary-position-point) | |
9038 (gnus-set-mode-line 'summary) | |
9039 n)) | |
9040 | |
9041 (defun gnus-summary-pipe-output (&optional arg) | |
9042 "Pipe the current article to a subprocess. | |
9043 If N is a positive number, pipe the N next articles. | |
9044 If N is a negative number, pipe the N previous articles. | |
9045 If N is nil and any articles have been marked with the process mark, | |
9046 pipe those articles instead." | |
9047 (interactive "P") | |
9048 (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe)) | |
9049 (gnus-summary-save-article arg t)) | |
9050 (gnus-configure-windows 'pipe)) | |
9051 | |
9052 (defun gnus-summary-save-article-mail (&optional arg) | |
9053 "Append the current article to an mail file. | |
9054 If N is a positive number, save the N next articles. | |
9055 If N is a negative number, save the N previous articles. | |
9056 If N is nil and any articles have been marked with the process mark, | |
9057 save those articles instead." | |
9058 (interactive "P") | |
9059 (let ((gnus-default-article-saver 'gnus-summary-save-in-mail)) | |
9060 (gnus-summary-save-article arg))) | |
9061 | |
9062 (defun gnus-summary-save-article-rmail (&optional arg) | |
9063 "Append the current article to an rmail file. | |
9064 If N is a positive number, save the N next articles. | |
9065 If N is a negative number, save the N previous articles. | |
9066 If N is nil and any articles have been marked with the process mark, | |
9067 save those articles instead." | |
9068 (interactive "P") | |
9069 (let ((gnus-default-article-saver 'gnus-summary-save-in-rmail)) | |
9070 (gnus-summary-save-article arg))) | |
9071 | |
9072 (defun gnus-summary-save-article-file (&optional arg) | |
9073 "Append the current article to a file. | |
9074 If N is a positive number, save the N next articles. | |
9075 If N is a negative number, save the N previous articles. | |
9076 If N is nil and any articles have been marked with the process mark, | |
9077 save those articles instead." | |
9078 (interactive "P") | |
9079 (let ((gnus-default-article-saver 'gnus-summary-save-in-file)) | |
9080 (gnus-summary-save-article arg))) | |
9081 | |
9082 (defun gnus-summary-write-article-file (&optional arg) | |
9083 "Write the current article to a file, deleting the previous file. | |
9084 If N is a positive number, save the N next articles. | |
9085 If N is a negative number, save the N previous articles. | |
9086 If N is nil and any articles have been marked with the process mark, | |
9087 save those articles instead." | |
9088 (interactive "P") | |
9089 (let ((gnus-default-article-saver 'gnus-summary-write-to-file)) | |
9090 (gnus-summary-save-article arg))) | |
9091 | |
9092 (defun gnus-summary-save-article-body-file (&optional arg) | |
9093 "Append the current article body to a file. | |
9094 If N is a positive number, save the N next articles. | |
9095 If N is a negative number, save the N previous articles. | |
9096 If N is nil and any articles have been marked with the process mark, | |
9097 save those articles instead." | |
9098 (interactive "P") | |
9099 (let ((gnus-default-article-saver 'gnus-summary-save-body-in-file)) | |
9100 (gnus-summary-save-article arg))) | |
9101 | |
9102 (defun gnus-summary-pipe-message (program) | |
9103 "Pipe the current article through PROGRAM." | |
9104 (interactive "sProgram: ") | |
9105 (gnus-summary-select-article) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9106 (let ((mail-header-separator "")) |
17493 | 9107 (gnus-eval-in-buffer-window gnus-article-buffer |
9108 (save-restriction | |
9109 (widen) | |
9110 (let ((start (window-start)) | |
9111 buffer-read-only) | |
9112 (message-pipe-buffer-body program) | |
9113 (set-window-start (get-buffer-window (current-buffer)) start)))))) | |
9114 | |
9115 (defun gnus-get-split-value (methods) | |
9116 "Return a value based on the split METHODS." | |
9117 (let (split-name method result match) | |
9118 (when methods | |
9119 (save-excursion | |
9120 (set-buffer gnus-original-article-buffer) | |
9121 (save-restriction | |
9122 (nnheader-narrow-to-headers) | |
9123 (while methods | |
9124 (goto-char (point-min)) | |
9125 (setq method (pop methods)) | |
9126 (setq match (car method)) | |
9127 (when (cond | |
9128 ((stringp match) | |
9129 ;; Regular expression. | |
9130 (ignore-errors | |
9131 (re-search-forward match nil t))) | |
9132 ((gnus-functionp match) | |
9133 ;; Function. | |
9134 (save-restriction | |
9135 (widen) | |
9136 (setq result (funcall match gnus-newsgroup-name)))) | |
9137 ((consp match) | |
9138 ;; Form. | |
9139 (save-restriction | |
9140 (widen) | |
9141 (setq result (eval match))))) | |
9142 (setq split-name (append (cdr method) split-name)) | |
9143 (cond ((stringp result) | |
9144 (push (expand-file-name | |
9145 result gnus-article-save-directory) | |
9146 split-name)) | |
9147 ((consp result) | |
9148 (setq split-name (append result split-name))))))))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9149 (nreverse split-name))) |
17493 | 9150 |
9151 (defun gnus-valid-move-group-p (group) | |
9152 (and (boundp group) | |
9153 (symbol-name group) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9154 (symbol-value group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9155 (gnus-get-function (gnus-find-method-for-group |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9156 (symbol-name group)) 'request-accept-article t))) |
17493 | 9157 |
9158 (defun gnus-read-move-group-name (prompt default articles prefix) | |
9159 "Read a group name." | |
9160 (let* ((split-name (gnus-get-split-value gnus-move-split-methods)) | |
9161 (minibuffer-confirm-incomplete nil) ; XEmacs | |
9162 (prom | |
9163 (format "%s %s to:" | |
9164 prompt | |
9165 (if (> (length articles) 1) | |
9166 (format "these %d articles" (length articles)) | |
9167 "this article"))) | |
9168 (to-newsgroup | |
9169 (cond | |
9170 ((null split-name) | |
9171 (gnus-completing-read default prom | |
9172 gnus-active-hashtb | |
9173 'gnus-valid-move-group-p | |
9174 nil prefix | |
9175 'gnus-group-history)) | |
9176 ((= 1 (length split-name)) | |
9177 (gnus-completing-read (car split-name) prom | |
9178 gnus-active-hashtb | |
9179 'gnus-valid-move-group-p | |
9180 nil nil | |
9181 'gnus-group-history)) | |
9182 (t | |
9183 (gnus-completing-read nil prom | |
9184 (mapcar (lambda (el) (list el)) | |
9185 (nreverse split-name)) | |
9186 nil nil nil | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9187 'gnus-group-history)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9188 (to-method (gnus-server-to-method (gnus-group-method to-newsgroup)))) |
17493 | 9189 (when to-newsgroup |
9190 (if (or (string= to-newsgroup "") | |
9191 (string= to-newsgroup prefix)) | |
9192 (setq to-newsgroup default)) | |
9193 (unless to-newsgroup | |
9194 (error "No group name entered")) | |
9195 (or (gnus-active to-newsgroup) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9196 (gnus-activate-group to-newsgroup nil nil to-method) |
17493 | 9197 (if (gnus-y-or-n-p (format "No such group: %s. Create it? " |
9198 to-newsgroup)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9199 (or (and (gnus-request-create-group to-newsgroup to-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9200 (gnus-activate-group |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9201 to-newsgroup nil nil to-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9202 (gnus-subscribe-group to-newsgroup)) |
17493 | 9203 (error "Couldn't create group %s" to-newsgroup))) |
9204 (error "No such group: %s" to-newsgroup))) | |
9205 to-newsgroup)) | |
9206 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9207 (defun gnus-summary-save-parts (type dir n &optional reverse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9208 "Save parts matching TYPE to DIR. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9209 If REVERSE, save parts that do not match TYPE." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9210 (interactive |
31785 | 9211 (list (read-string "Save parts of type: " |
9212 (or (car gnus-summary-save-parts-type-history) | |
9213 gnus-summary-save-parts-default-mime) | |
9214 'gnus-summary-save-parts-type-history) | |
9215 (setq gnus-summary-save-parts-last-directory | |
9216 (read-file-name "Save to directory: " | |
9217 gnus-summary-save-parts-last-directory | |
9218 nil t)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9219 current-prefix-arg)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9220 (gnus-summary-iterate n |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9221 (let ((gnus-display-mime-function nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9222 (gnus-inhibit-treatment t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9223 (gnus-summary-select-article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9224 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9225 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9226 (let ((handles (or gnus-article-mime-handles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9227 (mm-dissect-buffer) (mm-uu-dissect)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9228 (when handles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9229 (gnus-summary-save-parts-1 type dir handles reverse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9230 (unless gnus-article-mime-handles ;; Don't destroy this case. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9231 (mm-destroy-parts handles))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9232 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9233 (defun gnus-summary-save-parts-1 (type dir handle reverse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9234 (if (stringp (car handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9235 (mapcar (lambda (h) (gnus-summary-save-parts-1 type dir h reverse)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9236 (cdr handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9237 (when (if reverse |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9238 (not (string-match type (mm-handle-media-type handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9239 (string-match type (mm-handle-media-type handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9240 (let ((file (expand-file-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9241 (file-name-nondirectory |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9242 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9243 (mail-content-type-get |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9244 (mm-handle-disposition handle) 'filename) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9245 (concat gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9246 "." (number-to-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9247 (cdr gnus-article-current))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9248 dir))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9249 (unless (file-exists-p file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9250 (mm-save-part-to-file handle file)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9251 |
17493 | 9252 ;; Summary extract commands |
9253 | |
9254 (defun gnus-summary-insert-pseudos (pslist &optional not-view) | |
9255 (let ((buffer-read-only nil) | |
9256 (article (gnus-summary-article-number)) | |
9257 after-article b e) | |
9258 (unless (gnus-summary-goto-subject article) | |
9259 (error "No such article: %d" article)) | |
9260 (gnus-summary-position-point) | |
9261 ;; If all commands are to be bunched up on one line, we collect | |
9262 ;; them here. | |
9263 (unless gnus-view-pseudos-separately | |
9264 (let ((ps (setq pslist (sort pslist 'gnus-pseudos<))) | |
9265 files action) | |
9266 (while ps | |
9267 (setq action (cdr (assq 'action (car ps)))) | |
9268 (setq files (list (cdr (assq 'name (car ps))))) | |
9269 (while (and ps (cdr ps) | |
9270 (string= (or action "1") | |
9271 (or (cdr (assq 'action (cadr ps))) "2"))) | |
9272 (push (cdr (assq 'name (cadr ps))) files) | |
9273 (setcdr ps (cddr ps))) | |
9274 (when files | |
9275 (when (not (string-match "%s" action)) | |
9276 (push " " files)) | |
9277 (push " " files) | |
9278 (when (assq 'execute (car ps)) | |
9279 (setcdr (assq 'execute (car ps)) | |
9280 (funcall (if (string-match "%s" action) | |
9281 'format 'concat) | |
9282 action | |
9283 (mapconcat | |
9284 (lambda (f) | |
9285 (if (equal f " ") | |
9286 f | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9287 (mm-quote-arg f))) |
17493 | 9288 files " "))))) |
9289 (setq ps (cdr ps))))) | |
9290 (if (and gnus-view-pseudos (not not-view)) | |
9291 (while pslist | |
9292 (when (assq 'execute (car pslist)) | |
9293 (gnus-execute-command (cdr (assq 'execute (car pslist))) | |
9294 (eq gnus-view-pseudos 'not-confirm))) | |
9295 (setq pslist (cdr pslist))) | |
9296 (save-excursion | |
9297 (while pslist | |
9298 (setq after-article (or (cdr (assq 'article (car pslist))) | |
9299 (gnus-summary-article-number))) | |
9300 (gnus-summary-goto-subject after-article) | |
9301 (forward-line 1) | |
9302 (setq b (point)) | |
9303 (insert " " (file-name-nondirectory | |
9304 (cdr (assq 'name (car pslist)))) | |
9305 ": " (or (cdr (assq 'execute (car pslist))) "") "\n") | |
9306 (setq e (point)) | |
9307 (forward-line -1) ; back to `b' | |
9308 (gnus-add-text-properties | |
9309 b (1- e) (list 'gnus-number gnus-reffed-article-number | |
9310 gnus-mouse-face-prop gnus-mouse-face)) | |
9311 (gnus-data-enter | |
9312 after-article gnus-reffed-article-number | |
9313 gnus-unread-mark b (car pslist) 0 (- e b)) | |
9314 (push gnus-reffed-article-number gnus-newsgroup-unreads) | |
9315 (setq gnus-reffed-article-number (1- gnus-reffed-article-number)) | |
9316 (setq pslist (cdr pslist))))))) | |
9317 | |
9318 (defun gnus-pseudos< (p1 p2) | |
9319 (let ((c1 (cdr (assq 'action p1))) | |
9320 (c2 (cdr (assq 'action p2)))) | |
9321 (and c1 c2 (string< c1 c2)))) | |
9322 | |
9323 (defun gnus-request-pseudo-article (props) | |
9324 (cond ((assq 'execute props) | |
9325 (gnus-execute-command (cdr (assq 'execute props))))) | |
9326 (let ((gnus-current-article (gnus-summary-article-number))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9327 (gnus-run-hooks 'gnus-mark-article-hook))) |
17493 | 9328 |
9329 (defun gnus-execute-command (command &optional automatic) | |
9330 (save-excursion | |
9331 (gnus-article-setup-buffer) | |
9332 (set-buffer gnus-article-buffer) | |
9333 (setq buffer-read-only nil) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
9334 (let ((command (if automatic command |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
9335 (read-string "Command: " (cons command 0))))) |
17493 | 9336 (erase-buffer) |
9337 (insert "$ " command "\n\n") | |
9338 (if gnus-view-pseudo-asynchronously | |
9339 (start-process "gnus-execute" (current-buffer) shell-file-name | |
9340 shell-command-switch command) | |
9341 (call-process shell-file-name nil t nil | |
9342 shell-command-switch command))))) | |
9343 | |
9344 ;; Summary kill commands. | |
9345 | |
9346 (defun gnus-summary-edit-global-kill (article) | |
9347 "Edit the \"global\" kill file." | |
9348 (interactive (list (gnus-summary-article-number))) | |
9349 (gnus-group-edit-global-kill article)) | |
9350 | |
9351 (defun gnus-summary-edit-local-kill () | |
9352 "Edit a local kill file applied to the current newsgroup." | |
9353 (interactive) | |
9354 (setq gnus-current-headers (gnus-summary-article-header)) | |
9355 (gnus-group-edit-local-kill | |
9356 (gnus-summary-article-number) gnus-newsgroup-name)) | |
9357 | |
9358 ;;; Header reading. | |
9359 | |
9360 (defun gnus-read-header (id &optional header) | |
9361 "Read the headers of article ID and enter them into the Gnus system." | |
9362 (let ((group gnus-newsgroup-name) | |
9363 (gnus-override-method | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9364 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9365 gnus-override-method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9366 (and (gnus-news-group-p gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9367 (car (gnus-refer-article-methods))))) |
17493 | 9368 where) |
9369 ;; First we check to see whether the header in question is already | |
9370 ;; fetched. | |
9371 (if (stringp id) | |
9372 ;; This is a Message-ID. | |
9373 (setq header (or header (gnus-id-to-header id))) | |
9374 ;; This is an article number. | |
9375 (setq header (or header (gnus-summary-article-header id)))) | |
9376 (if (and header | |
9377 (not (gnus-summary-article-sparse-p (mail-header-number header)))) | |
9378 ;; We have found the header. | |
9379 header | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9380 ;; If this is a sparse article, we have to nix out its |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9381 ;; previous entry in the thread hashtb. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9382 (when (and header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9383 (gnus-summary-article-sparse-p (mail-header-number header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9384 (let* ((parent (gnus-parent-id (mail-header-references header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9385 (thread (and parent (gnus-id-to-thread parent)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9386 (when thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9387 (delq (assq header thread) thread)))) |
17493 | 9388 ;; We have to really fetch the header to this article. |
9389 (save-excursion | |
9390 (set-buffer nntp-server-buffer) | |
9391 (when (setq where (gnus-request-head id group)) | |
9392 (nnheader-fold-continuation-lines) | |
9393 (goto-char (point-max)) | |
9394 (insert ".\n") | |
9395 (goto-char (point-min)) | |
9396 (insert "211 ") | |
9397 (princ (cond | |
9398 ((numberp id) id) | |
9399 ((cdr where) (cdr where)) | |
9400 (header (mail-header-number header)) | |
9401 (t gnus-reffed-article-number)) | |
9402 (current-buffer)) | |
9403 (insert " Article retrieved.\n")) | |
9404 (if (or (not where) | |
9405 (not (setq header (car (gnus-get-newsgroup-headers nil t))))) | |
9406 () ; Malformed head. | |
9407 (unless (gnus-summary-article-sparse-p (mail-header-number header)) | |
9408 (when (and (stringp id) | |
9409 (not (string= (gnus-group-real-name group) | |
9410 (car where)))) | |
9411 ;; If we fetched by Message-ID and the article came | |
9412 ;; from a different group, we fudge some bogus article | |
9413 ;; numbers for this article. | |
9414 (mail-header-set-number header gnus-reffed-article-number)) | |
9415 (save-excursion | |
9416 (set-buffer gnus-summary-buffer) | |
9417 (decf gnus-reffed-article-number) | |
9418 (gnus-remove-header (mail-header-number header)) | |
9419 (push header gnus-newsgroup-headers) | |
9420 (setq gnus-current-headers header) | |
9421 (push (mail-header-number header) gnus-newsgroup-limit))) | |
9422 header))))) | |
9423 | |
9424 (defun gnus-remove-header (number) | |
9425 "Remove header NUMBER from `gnus-newsgroup-headers'." | |
9426 (if (and gnus-newsgroup-headers | |
9427 (= number (mail-header-number (car gnus-newsgroup-headers)))) | |
9428 (pop gnus-newsgroup-headers) | |
9429 (let ((headers gnus-newsgroup-headers)) | |
9430 (while (and (cdr headers) | |
9431 (not (= number (mail-header-number (cadr headers))))) | |
9432 (pop headers)) | |
9433 (when (cdr headers) | |
9434 (setcdr headers (cddr headers)))))) | |
9435 | |
9436 ;;; | |
9437 ;;; summary highlights | |
9438 ;;; | |
9439 | |
9440 (defun gnus-highlight-selected-summary () | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9441 "Highlight selected article in summary buffer." |
17493 | 9442 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>. |
9443 (when gnus-summary-selected-face | |
9444 (save-excursion | |
9445 (let* ((beg (progn (beginning-of-line) (point))) | |
9446 (end (progn (end-of-line) (point))) | |
9447 ;; Fix by Mike Dugan <dugan@bucrf16.bu.edu>. | |
9448 (from (if (get-text-property beg gnus-mouse-face-prop) | |
9449 beg | |
9450 (or (next-single-property-change | |
9451 beg gnus-mouse-face-prop nil end) | |
9452 beg))) | |
9453 (to | |
9454 (if (= from end) | |
9455 (- from 2) | |
9456 (or (next-single-property-change | |
9457 from gnus-mouse-face-prop nil end) | |
9458 end)))) | |
9459 ;; If no mouse-face prop on line we will have to = from = end, | |
9460 ;; so we highlight the entire line instead. | |
9461 (when (= (+ to 2) from) | |
9462 (setq from beg) | |
9463 (setq to end)) | |
9464 (if gnus-newsgroup-selected-overlay | |
9465 ;; Move old overlay. | |
9466 (gnus-move-overlay | |
9467 gnus-newsgroup-selected-overlay from to (current-buffer)) | |
9468 ;; Create new overlay. | |
9469 (gnus-overlay-put | |
9470 (setq gnus-newsgroup-selected-overlay (gnus-make-overlay from to)) | |
9471 'face gnus-summary-selected-face)))))) | |
9472 | |
9473 ;; New implementation by Christian Limpach <Christian.Limpach@nice.ch>. | |
9474 (defun gnus-summary-highlight-line () | |
9475 "Highlight current line according to `gnus-summary-highlight'." | |
9476 (let* ((list gnus-summary-highlight) | |
9477 (p (point)) | |
9478 (end (progn (end-of-line) (point))) | |
9479 ;; now find out where the line starts and leave point there. | |
9480 (beg (progn (beginning-of-line) (point))) | |
9481 (article (gnus-summary-article-number)) | |
9482 (score (or (cdr (assq (or article gnus-current-article) | |
9483 gnus-newsgroup-scored)) | |
9484 gnus-summary-default-score 0)) | |
9485 (mark (or (gnus-summary-article-mark) gnus-unread-mark)) | |
9486 (inhibit-read-only t)) | |
9487 ;; Eval the cars of the lists until we find a match. | |
9488 (let ((default gnus-summary-default-score)) | |
9489 (while (and list | |
9490 (not (eval (caar list)))) | |
9491 (setq list (cdr list)))) | |
9492 (let ((face (cdar list))) | |
9493 (unless (eq face (get-text-property beg 'face)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9494 (gnus-put-text-property-excluding-characters-with-faces |
17493 | 9495 beg end 'face |
9496 (setq face (if (boundp face) (symbol-value face) face))) | |
9497 (when gnus-summary-highlight-line-function | |
9498 (funcall gnus-summary-highlight-line-function article face)))) | |
9499 (goto-char p))) | |
9500 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9501 (defun gnus-update-read-articles (group unread &optional compute) |
17493 | 9502 "Update the list of read articles in GROUP." |
9503 (let* ((active (or gnus-newsgroup-active (gnus-active group))) | |
9504 (entry (gnus-gethash group gnus-newsrc-hashtb)) | |
9505 (info (nth 2 entry)) | |
9506 (prev 1) | |
9507 (unread (sort (copy-sequence unread) '<)) | |
9508 read) | |
9509 (if (or (not info) (not active)) | |
9510 ;; There is no info on this group if it was, in fact, | |
9511 ;; killed. Gnus stores no information on killed groups, so | |
9512 ;; there's nothing to be done. | |
9513 ;; One could store the information somewhere temporarily, | |
9514 ;; perhaps... Hmmm... | |
9515 () | |
9516 ;; Remove any negative articles numbers. | |
9517 (while (and unread (< (car unread) 0)) | |
9518 (setq unread (cdr unread))) | |
9519 ;; Remove any expired article numbers | |
9520 (while (and unread (< (car unread) (car active))) | |
9521 (setq unread (cdr unread))) | |
9522 ;; Compute the ranges of read articles by looking at the list of | |
9523 ;; unread articles. | |
9524 (while unread | |
9525 (when (/= (car unread) prev) | |
9526 (push (if (= prev (1- (car unread))) prev | |
9527 (cons prev (1- (car unread)))) | |
9528 read)) | |
9529 (setq prev (1+ (car unread))) | |
9530 (setq unread (cdr unread))) | |
9531 (when (<= prev (cdr active)) | |
9532 (push (cons prev (cdr active)) read)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9533 (setq read (if (> (length read) 1) (nreverse read) read)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9534 (if compute |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9535 read |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9536 (save-excursion |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9537 (let (setmarkundo) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9538 ;; Propagate the read marks to the backend. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9539 (when (gnus-check-backend-function 'request-set-mark group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9540 (let ((del (gnus-remove-from-range (gnus-info-read info) read)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9541 (add (gnus-remove-from-range read (gnus-info-read info)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9542 (when (or add del) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9543 (unless (gnus-check-group group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9544 (error "Can't open server for %s" group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9545 (gnus-request-set-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9546 group (delq nil (list (if add (list add 'add '(read))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9547 (if del (list del 'del '(read)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9548 (setq setmarkundo |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9549 `(gnus-request-set-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9550 ,group |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9551 ',(delq nil (list |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9552 (if del (list del 'add '(read))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9553 (if add (list add 'del '(read)))))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9554 (set-buffer gnus-group-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9555 (gnus-undo-register |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9556 `(progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9557 (gnus-info-set-marks ',info ',(gnus-info-marks info) t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9558 (gnus-info-set-read ',info ',(gnus-info-read info)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9559 (gnus-get-unread-articles-in-group ',info |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9560 (gnus-active ,group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9561 (gnus-group-update-group ,group t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9562 ,setmarkundo)))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9563 ;; Enter this list into the group info. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9564 (gnus-info-set-read info read) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9565 ;; Set the number of unread articles in gnus-newsrc-hashtb. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9566 (gnus-get-unread-articles-in-group info (gnus-active group)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9567 t)))) |
17493 | 9568 |
9569 (defun gnus-offer-save-summaries () | |
9570 "Offer to save all active summary buffers." | |
9571 (save-excursion | |
9572 (let ((buflist (buffer-list)) | |
9573 buffers bufname) | |
9574 ;; Go through all buffers and find all summaries. | |
9575 (while buflist | |
9576 (and (setq bufname (buffer-name (car buflist))) | |
9577 (string-match "Summary" bufname) | |
9578 (save-excursion | |
9579 (set-buffer bufname) | |
9580 ;; We check that this is, indeed, a summary buffer. | |
9581 (and (eq major-mode 'gnus-summary-mode) | |
9582 ;; Also make sure this isn't bogus. | |
9583 gnus-newsgroup-prepared | |
9584 ;; Also make sure that this isn't a dead summary buffer. | |
9585 (not gnus-dead-summary-mode))) | |
9586 (push bufname buffers)) | |
9587 (setq buflist (cdr buflist))) | |
9588 ;; Go through all these summary buffers and offer to save them. | |
9589 (when buffers | |
9590 (map-y-or-n-p | |
9591 "Update summary buffer %s? " | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9592 (lambda (buf) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9593 (switch-to-buffer buf) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9594 (gnus-summary-exit)) |
17493 | 9595 buffers))))) |
9596 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9597 (defun gnus-summary-setup-default-charset () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9598 "Setup newsgroup default charset." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9599 (if (equal gnus-newsgroup-name "nndraft:drafts") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9600 (setq gnus-newsgroup-charset nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9601 (let* ((name (and gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9602 (gnus-group-real-name gnus-newsgroup-name))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9603 (ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9604 (or gnus-newsgroup-ephemeral-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9605 (append |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9606 (and gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9607 (or (gnus-group-find-parameter gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9608 'ignored-charsets t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9609 (let ((alist gnus-group-ignored-charsets-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9610 elem (charsets nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9611 (while (setq elem (pop alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9612 (when (and name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9613 (string-match (car elem) name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9614 (setq alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9615 charsets (cdr elem)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9616 charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9617 gnus-newsgroup-ignored-charsets)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9618 (setq gnus-newsgroup-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9619 (or gnus-newsgroup-ephemeral-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9620 (and gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9621 (or (gnus-group-find-parameter gnus-newsgroup-name 'charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9622 (let ((alist gnus-group-charset-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9623 elem charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9624 (while (setq elem (pop alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9625 (when (and name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9626 (string-match (car elem) name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9627 (setq alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9628 charset (cadr elem)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9629 charset))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9630 gnus-default-charset)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9631 (set (make-local-variable 'gnus-newsgroup-ignored-charsets) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9632 ignored-charsets)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9633 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9634 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9635 ;;; Mime Commands |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9636 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9637 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9638 (defun gnus-summary-display-buttonized (&optional show-all-parts) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9639 "Display the current article buffer fully MIME-buttonized. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9640 If SHOW-ALL-PARTS (the prefix) is non-nil, all multipart/* parts are |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9641 treated as multipart/mixed." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9642 (interactive "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9643 (require 'gnus-art) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9644 (let ((gnus-unbuttonized-mime-types nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9645 (gnus-mime-display-multipart-as-mixed show-all-parts)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9646 (gnus-summary-show-article))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9647 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9648 (defun gnus-summary-repair-multipart (article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9649 "Add a Content-Type header to a multipart article without one." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9650 (interactive (list (gnus-summary-article-number))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9651 (gnus-with-article article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9652 (message-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9653 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9654 (widen) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9655 (when (search-forward "\n--" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9656 (let ((separator (buffer-substring (point) (gnus-point-at-eol)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9657 (message-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9658 (message-remove-header "Mime-Version") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9659 (message-remove-header "Content-Type") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9660 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9661 (insert (format "Content-Type: multipart/mixed; boundary=\"%s\"\n" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9662 separator)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9663 (insert "Mime-Version: 1.0\n") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9664 (widen)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9665 (let (gnus-mark-article-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9666 (gnus-summary-select-article t t nil article))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9667 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9668 (defun gnus-summary-toggle-display-buttonized () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9669 "Toggle the buttonizing of the article buffer." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9670 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9671 (require 'gnus-art) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9672 (if (setq gnus-inhibit-mime-unbuttonizing |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9673 (not gnus-inhibit-mime-unbuttonizing)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9674 (let ((gnus-unbuttonized-mime-types nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9675 (gnus-summary-show-article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9676 (gnus-summary-show-article))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9677 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9678 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9679 ;;; Generic summary marking commands |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9680 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9681 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9682 (defvar gnus-summary-marking-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9683 '((read gnus-del-mark "d") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9684 (unread gnus-unread-mark "u") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9685 (ticked gnus-ticked-mark "!") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9686 (dormant gnus-dormant-mark "?") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9687 (expirable gnus-expirable-mark "e")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9688 "An alist of names/marks/keystrokes.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9689 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9690 (defvar gnus-summary-generic-mark-map (make-sparse-keymap)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9691 (defvar gnus-summary-mark-map) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9692 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9693 (defun gnus-summary-make-all-marking-commands () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9694 (define-key gnus-summary-mark-map "M" gnus-summary-generic-mark-map) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9695 (dolist (elem gnus-summary-marking-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9696 (apply 'gnus-summary-make-marking-command elem))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9697 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9698 (defun gnus-summary-make-marking-command (name mark keystroke) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9699 (let ((map (make-sparse-keymap))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9700 (define-key gnus-summary-generic-mark-map keystroke map) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9701 (dolist (lway `((next "next" next nil "n") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9702 (next-unread "next unread" next t "N") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9703 (prev "previous" prev nil "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9704 (prev-unread "previous unread" prev t "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9705 (nomove "" nil nil ,keystroke))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9706 (let ((func (gnus-summary-make-marking-command-1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9707 mark (car lway) lway name))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9708 (setq func (eval func)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9709 (define-key map (nth 4 lway) func))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9710 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9711 (defun gnus-summary-make-marking-command-1 (mark way lway name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9712 `(defun ,(intern |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9713 (format "gnus-summary-put-mark-as-%s%s" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9714 name (if (eq way 'nomove) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9715 "" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9716 (concat "-" (symbol-name way))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9717 (n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9718 ,(format |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9719 "Mark the current article as %s%s. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9720 If N, the prefix, then repeat N times. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9721 If N is negative, move in reverse order. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9722 The difference between N and the actual number of articles marked is |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9723 returned." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9724 name (cadr lway)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9725 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9726 (gnus-summary-generic-mark n ,mark ',(nth 2 lway) ,(nth 3 lway)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9727 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9728 (defun gnus-summary-generic-mark (n mark move unread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9729 "Mark N articles with MARK." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9730 (unless (eq major-mode 'gnus-summary-mode) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9731 (error "This command can only be used in the summary buffer")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9732 (gnus-summary-show-thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9733 (let ((nummove |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9734 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9735 ((eq move 'next) 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9736 ((eq move 'prev) -1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9737 (t 0)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9738 (if (zerop nummove) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9739 (setq n 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9740 (when (< n 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9741 (setq n (abs n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9742 nummove (* -1 nummove)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9743 (while (and (> n 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9744 (gnus-summary-mark-article nil mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9745 (zerop (gnus-summary-next-subject nummove unread t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9746 (setq n (1- n))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9747 (when (/= 0 n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9748 (gnus-message 7 "No more %sarticles" (if mark "" "unread "))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9749 (gnus-summary-recenter) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9750 (gnus-summary-position-point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9751 (gnus-set-mode-line 'summary) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9752 n)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9753 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9754 (gnus-summary-make-all-marking-commands) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9755 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
9756 (gnus-ems-redefine) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
9757 |
17493 | 9758 (provide 'gnus-sum) |
9759 | |
9760 (run-hooks 'gnus-sum-load-hook) | |
9761 | |
9762 ;;; gnus-sum.el ends here |