Mercurial > emacs
annotate lisp/gnus/gnus-sum.el @ 24526:a70f2306f60b
(tcl-using-emacs-19-23): Recognize Emacs 20.
author | Tom Tromey <tromey@redhat.com> |
---|---|
date | Mon, 29 Mar 1999 07:35:55 +0000 |
parents | 15fc6acbae7a |
children | ccf2939fc5ec |
rev | line source |
---|---|
17493 | 1 ;;; gnus-sum.el --- summary mode commands for Gnus |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2 ;; Copyright (C) 1996,97,98 Free Software Foundation, Inc. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 5 ;; Keywords: news |
6 | |
7 ;; This file is part of GNU Emacs. | |
8 | |
9 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
10 ;; it under the terms of the GNU General Public License as published by | |
11 ;; the Free Software Foundation; either version 2, or (at your option) | |
12 ;; any later version. | |
13 | |
14 ;; GNU Emacs is distributed in the hope that it will be useful, | |
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 ;; GNU General Public License for more details. | |
18 | |
19 ;; You should have received a copy of the GNU General Public License | |
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
22 ;; Boston, MA 02111-1307, USA. | |
23 | |
24 ;;; Commentary: | |
25 | |
26 ;;; Code: | |
27 | |
19521
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
28 (eval-when-compile (require 'cl)) |
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
29 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
30 (eval-when-compile (require 'cl)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
31 |
17493 | 32 (require 'gnus) |
33 (require 'gnus-group) | |
34 (require 'gnus-spec) | |
35 (require 'gnus-range) | |
36 (require 'gnus-int) | |
37 (require 'gnus-undo) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
38 (require 'gnus-util) |
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 | |
172 "*If t, marking commands will go to the next unread article. | |
173 If `never', commands that usually go to the next unread article, will | |
174 go to the next article, whether it is read or not. | |
175 If nil, only the marking commands will go to the next (un)read article." | |
176 :group 'gnus-summary-marks | |
177 :link '(custom-manual "(gnus)Setting Marks") | |
178 :type '(choice (const :tag "off" nil) | |
179 (const never) | |
180 (sexp :menu-tag "on" t))) | |
181 | |
182 (defcustom gnus-summary-default-score 0 | |
183 "*Default article score level. | |
184 All scores generated by the score files will be added to this score. | |
185 If this variable is nil, scoring will be disabled." | |
186 :group 'gnus-score-default | |
187 :type '(choice (const :tag "disable") | |
188 integer)) | |
189 | |
190 (defcustom gnus-summary-zcore-fuzz 0 | |
191 "*Fuzziness factor for the zcore in the summary buffer. | |
192 Articles with scores closer than this to `gnus-summary-default-score' | |
193 will not be marked." | |
194 :group 'gnus-summary-format | |
195 :type 'integer) | |
196 | |
197 (defcustom gnus-simplify-subject-fuzzy-regexp nil | |
198 "*Strings to be removed when doing fuzzy matches. | |
199 This can either be a regular expression or list of regular expressions | |
200 that will be removed from subject strings if fuzzy subject | |
201 simplification is selected." | |
202 :group 'gnus-thread | |
203 :type '(repeat regexp)) | |
204 | |
205 (defcustom gnus-show-threads t | |
206 "*If non-nil, display threads in summary mode." | |
207 :group 'gnus-thread | |
208 :type 'boolean) | |
209 | |
210 (defcustom gnus-thread-hide-subtree nil | |
211 "*If non-nil, hide all threads initially. | |
212 If threads are hidden, you have to run the command | |
213 `gnus-summary-show-thread' by hand or use `gnus-select-article-hook' | |
214 to expose hidden threads." | |
215 :group 'gnus-thread | |
216 :type 'boolean) | |
217 | |
218 (defcustom gnus-thread-hide-killed t | |
219 "*If non-nil, hide killed threads automatically." | |
220 :group 'gnus-thread | |
221 :type 'boolean) | |
222 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
223 (defcustom gnus-thread-ignore-subject t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
224 "*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
|
225 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
|
226 start separate threads." |
17493 | 227 :group 'gnus-thread |
228 :type 'boolean) | |
229 | |
230 (defcustom gnus-thread-operation-ignore-subject t | |
231 "*If non-nil, subjects will be ignored when doing thread commands. | |
232 This affects commands like `gnus-summary-kill-thread' and | |
233 `gnus-summary-lower-thread'. | |
234 | |
235 If this variable is nil, articles in the same thread with different | |
236 subjects will not be included in the operation in question. If this | |
237 variable is `fuzzy', only articles that have subjects that are fuzzily | |
238 equal will be included." | |
239 :group 'gnus-thread | |
240 :type '(choice (const :tag "off" nil) | |
241 (const fuzzy) | |
242 (sexp :tag "on" t))) | |
243 | |
244 (defcustom gnus-thread-indent-level 4 | |
245 "*Number that says how much each sub-thread should be indented." | |
246 :group 'gnus-thread | |
247 :type 'integer) | |
248 | |
249 (defcustom gnus-auto-extend-newsgroup t | |
250 "*If non-nil, extend newsgroup forward and backward when requested." | |
251 :group 'gnus-summary-choose | |
252 :type 'boolean) | |
253 | |
254 (defcustom gnus-auto-select-first t | |
255 "*If nil, don't select the first unread article when entering a group. | |
256 If this variable is `best', select the highest-scored unread article | |
257 in the group. If neither nil nor `best', select the first unread | |
258 article. | |
259 | |
260 If you want to prevent automatic selection of the first unread article | |
261 in some newsgroups, set the variable to nil in | |
262 `gnus-select-group-hook'." | |
263 :group 'gnus-group-select | |
264 :type '(choice (const :tag "none" nil) | |
265 (const best) | |
266 (sexp :menu-tag "first" t))) | |
267 | |
268 (defcustom gnus-auto-select-next t | |
269 "*If non-nil, offer to go to the next group from the end of the previous. | |
270 If the value is t and the next newsgroup is empty, Gnus will exit | |
271 summary mode and go back to group mode. If the value is neither nil | |
272 nor t, Gnus will select the following unread newsgroup. In | |
273 particular, if the value is the symbol `quietly', the next unread | |
274 newsgroup will be selected without any confirmation, and if it is | |
275 `almost-quietly', the next group will be selected without any | |
276 confirmation if you are located on the last article in the group. | |
277 Finally, if this variable is `slightly-quietly', the `Z n' command | |
278 will go to the next group without confirmation." | |
279 :group 'gnus-summary-maneuvering | |
280 :type '(choice (const :tag "off" nil) | |
281 (const quietly) | |
282 (const almost-quietly) | |
283 (const slightly-quietly) | |
284 (sexp :menu-tag "on" t))) | |
285 | |
286 (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
|
287 "*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
|
288 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
|
289 the first unread article." |
17493 | 290 :group 'gnus-summary-maneuvering |
291 :type 'boolean) | |
292 | |
293 (defcustom gnus-summary-check-current nil | |
294 "*If non-nil, consider the current article when moving. | |
295 The \"unread\" movement commands will stay on the same line if the | |
296 current article is unread." | |
297 :group 'gnus-summary-maneuvering | |
298 :type 'boolean) | |
299 | |
300 (defcustom gnus-auto-center-summary t | |
301 "*If non-nil, always center the current summary buffer. | |
302 In particular, if `vertical' do only vertical recentering. If non-nil | |
303 and non-`vertical', do both horizontal and vertical recentering." | |
304 :group 'gnus-summary-maneuvering | |
305 :type '(choice (const :tag "none" nil) | |
306 (const vertical) | |
307 (sexp :menu-tag "both" t))) | |
308 | |
309 (defcustom gnus-show-all-headers nil | |
310 "*If non-nil, don't hide any headers." | |
311 :group 'gnus-article-hiding | |
312 :group 'gnus-article-headers | |
313 :type 'boolean) | |
314 | |
315 (defcustom gnus-summary-ignore-duplicates nil | |
316 "*If non-nil, ignore articles with identical Message-ID headers." | |
317 :group 'gnus-summary | |
318 :type 'boolean) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
319 |
17493 | 320 (defcustom gnus-single-article-buffer t |
321 "*If non-nil, display all articles in the same buffer. | |
322 If nil, each group will get its own article buffer." | |
323 :group 'gnus-article-various | |
324 :type 'boolean) | |
325 | |
326 (defcustom gnus-break-pages t | |
327 "*If non-nil, do page breaking on articles. | |
328 The page delimiter is specified by the `gnus-page-delimiter' | |
329 variable." | |
330 :group 'gnus-article-various | |
331 :type 'boolean) | |
332 | |
333 (defcustom gnus-show-mime nil | |
334 "*If non-nil, do mime processing of articles. | |
335 The articles will simply be fed to the function given by | |
336 `gnus-show-mime-method'." | |
337 :group 'gnus-article-mime | |
338 :type 'boolean) | |
339 | |
340 (defcustom gnus-move-split-methods nil | |
341 "*Variable used to suggest where articles are to be moved to. | |
342 It uses the same syntax as the `gnus-split-methods' variable." | |
343 :group 'gnus-summary-mail | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
344 :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
|
345 (cons :value ("" "") regexp (repeat string)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
346 (sexp :value nil)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
347 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
348 (defcustom gnus-unread-mark ? ;space |
17493 | 349 "*Mark used for unread articles." |
350 :group 'gnus-summary-marks | |
351 :type 'character) | |
352 | |
353 (defcustom gnus-ticked-mark ?! | |
354 "*Mark used for ticked articles." | |
355 :group 'gnus-summary-marks | |
356 :type 'character) | |
357 | |
358 (defcustom gnus-dormant-mark ?? | |
359 "*Mark used for dormant articles." | |
360 :group 'gnus-summary-marks | |
361 :type 'character) | |
362 | |
363 (defcustom gnus-del-mark ?r | |
364 "*Mark used for del'd articles." | |
365 :group 'gnus-summary-marks | |
366 :type 'character) | |
367 | |
368 (defcustom gnus-read-mark ?R | |
369 "*Mark used for read articles." | |
370 :group 'gnus-summary-marks | |
371 :type 'character) | |
372 | |
373 (defcustom gnus-expirable-mark ?E | |
374 "*Mark used for expirable articles." | |
375 :group 'gnus-summary-marks | |
376 :type 'character) | |
377 | |
378 (defcustom gnus-killed-mark ?K | |
379 "*Mark used for killed articles." | |
380 :group 'gnus-summary-marks | |
381 :type 'character) | |
382 | |
383 (defcustom gnus-souped-mark ?F | |
384 "*Mark used for killed articles." | |
385 :group 'gnus-summary-marks | |
386 :type 'character) | |
387 | |
388 (defcustom gnus-kill-file-mark ?X | |
389 "*Mark used for articles killed by kill files." | |
390 :group 'gnus-summary-marks | |
391 :type 'character) | |
392 | |
393 (defcustom gnus-low-score-mark ?Y | |
394 "*Mark used for articles with a low score." | |
395 :group 'gnus-summary-marks | |
396 :type 'character) | |
397 | |
398 (defcustom gnus-catchup-mark ?C | |
399 "*Mark used for articles that are caught up." | |
400 :group 'gnus-summary-marks | |
401 :type 'character) | |
402 | |
403 (defcustom gnus-replied-mark ?A | |
404 "*Mark used for articles that have been replied to." | |
405 :group 'gnus-summary-marks | |
406 :type 'character) | |
407 | |
408 (defcustom gnus-cached-mark ?* | |
409 "*Mark used for articles that are in the cache." | |
410 :group 'gnus-summary-marks | |
411 :type 'character) | |
412 | |
413 (defcustom gnus-saved-mark ?S | |
414 "*Mark used for articles that have been saved to." | |
415 :group 'gnus-summary-marks | |
416 :type 'character) | |
417 | |
418 (defcustom gnus-ancient-mark ?O | |
419 "*Mark used for ancient articles." | |
420 :group 'gnus-summary-marks | |
421 :type 'character) | |
422 | |
423 (defcustom gnus-sparse-mark ?Q | |
424 "*Mark used for sparsely reffed articles." | |
425 :group 'gnus-summary-marks | |
426 :type 'character) | |
427 | |
428 (defcustom gnus-canceled-mark ?G | |
429 "*Mark used for canceled articles." | |
430 :group 'gnus-summary-marks | |
431 :type 'character) | |
432 | |
433 (defcustom gnus-duplicate-mark ?M | |
434 "*Mark used for duplicate articles." | |
435 :group 'gnus-summary-marks | |
436 :type 'character) | |
437 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
438 (defcustom gnus-undownloaded-mark ?@ |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
439 "*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
|
440 :group 'gnus-summary-marks |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
441 :type 'character) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
442 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
443 (defcustom gnus-downloadable-mark ?% |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
444 "*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
|
445 :group 'gnus-summary-marks |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
446 :type 'character) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
447 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
448 (defcustom gnus-unsendable-mark ?= |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
449 "*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
|
450 :group 'gnus-summary-marks |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
451 :type 'character) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
452 |
17493 | 453 (defcustom gnus-score-over-mark ?+ |
454 "*Score mark used for articles with high scores." | |
455 :group 'gnus-summary-marks | |
456 :type 'character) | |
457 | |
458 (defcustom gnus-score-below-mark ?- | |
459 "*Score mark used for articles with low scores." | |
460 :group 'gnus-summary-marks | |
461 :type 'character) | |
462 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
463 (defcustom gnus-empty-thread-mark ? ;space |
17493 | 464 "*There is no thread under the article." |
465 :group 'gnus-summary-marks | |
466 :type 'character) | |
467 | |
468 (defcustom gnus-not-empty-thread-mark ?= | |
469 "*There is a thread under the article." | |
470 :group 'gnus-summary-marks | |
471 :type 'character) | |
472 | |
473 (defcustom gnus-view-pseudo-asynchronously nil | |
474 "*If non-nil, Gnus will view pseudo-articles asynchronously." | |
475 :group 'gnus-extract-view | |
476 :type 'boolean) | |
477 | |
478 (defcustom gnus-view-pseudos nil | |
479 "*If `automatic', pseudo-articles will be viewed automatically. | |
480 If `not-confirm', pseudos will be viewed automatically, and the user | |
481 will not be asked to confirm the command." | |
482 :group 'gnus-extract-view | |
483 :type '(choice (const :tag "off" nil) | |
484 (const automatic) | |
485 (const not-confirm))) | |
486 | |
487 (defcustom gnus-view-pseudos-separately t | |
488 "*If non-nil, one pseudo-article will be created for each file to be viewed. | |
489 If nil, all files that use the same viewing command will be given as a | |
490 list of parameters to that command." | |
491 :group 'gnus-extract-view | |
492 :type 'boolean) | |
493 | |
494 (defcustom gnus-insert-pseudo-articles t | |
495 "*If non-nil, insert pseudo-articles when decoding articles." | |
496 :group 'gnus-extract-view | |
497 :type 'boolean) | |
498 | |
499 (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
|
500 " %(: :%) %S\n" |
17493 | 501 "*The format specification for the dummy roots in the summary buffer. |
502 It works along the same lines as a normal formatting string, | |
503 with some simple extensions. | |
504 | |
505 %S The subject" | |
506 :group 'gnus-threading | |
507 :type 'string) | |
508 | |
509 (defcustom gnus-summary-mode-line-format "Gnus: %%b [%A] %Z" | |
510 "*The format specification for the summary mode line. | |
511 It works along the same lines as a normal formatting string, | |
512 with some simple extensions: | |
513 | |
514 %G Group name | |
515 %p Unprefixed group name | |
516 %A Current article number | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
517 %z Current article score |
17493 | 518 %V Gnus version |
519 %U Number of unread articles in the group | |
520 %e Number of unselected articles in the group | |
521 %Z A string with unread/unselected article counts | |
522 %g Shortish group name | |
523 %S Subject of the current article | |
524 %u User-defined spec | |
525 %s Current score file name | |
526 %d Number of dormant articles | |
527 %r Number of articles that have been marked as read in this session | |
528 %E Number of articles expunged by the score files" | |
529 :group 'gnus-summary-format | |
530 :type 'string) | |
531 | |
532 (defcustom gnus-summary-mark-below 0 | |
533 "*Mark all articles with a score below this variable as read. | |
534 This variable is local to each summary buffer and usually set by the | |
535 score file." | |
536 :group 'gnus-score-default | |
537 :type 'integer) | |
538 | |
539 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number) | |
540 "*List of functions used for sorting articles in the summary buffer. | |
541 This variable is only used when not using a threaded display." | |
542 :group 'gnus-summary-sort | |
543 :type '(repeat (choice (function-item gnus-article-sort-by-number) | |
544 (function-item gnus-article-sort-by-author) | |
545 (function-item gnus-article-sort-by-subject) | |
546 (function-item gnus-article-sort-by-date) | |
547 (function-item gnus-article-sort-by-score) | |
548 (function :tag "other")))) | |
549 | |
550 (defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number) | |
551 "*List of functions used for sorting threads in the summary buffer. | |
552 By default, threads are sorted by article number. | |
553 | |
554 Each function takes two threads and return non-nil if the first thread | |
555 should be sorted before the other. If you use more than one function, | |
556 the primary sort function should be the last. You should probably | |
557 always include `gnus-thread-sort-by-number' in the list of sorting | |
558 functions -- preferably first. | |
559 | |
560 Ready-made functions include `gnus-thread-sort-by-number', | |
561 `gnus-thread-sort-by-author', `gnus-thread-sort-by-subject', | |
562 `gnus-thread-sort-by-date', `gnus-thread-sort-by-score' and | |
563 `gnus-thread-sort-by-total-score' (see `gnus-thread-score-function')." | |
564 :group 'gnus-summary-sort | |
565 :type '(repeat (choice (function-item gnus-thread-sort-by-number) | |
566 (function-item gnus-thread-sort-by-author) | |
567 (function-item gnus-thread-sort-by-subject) | |
568 (function-item gnus-thread-sort-by-date) | |
569 (function-item gnus-thread-sort-by-score) | |
570 (function-item gnus-thread-sort-by-total-score) | |
571 (function :tag "other")))) | |
572 | |
573 (defcustom gnus-thread-score-function '+ | |
574 "*Function used for calculating the total score of a thread. | |
575 | |
576 The function is called with the scores of the article and each | |
577 subthread and should then return the score of the thread. | |
578 | |
579 Some functions you can use are `+', `max', or `min'." | |
580 :group 'gnus-summary-sort | |
581 :type 'function) | |
582 | |
583 (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
|
584 "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
|
585 This variable is local to the summary buffers." |
17493 | 586 :group 'gnus-score-default |
587 :type '(choice (const :tag "off" nil) | |
588 integer)) | |
589 | |
590 (defcustom gnus-thread-expunge-below nil | |
591 "All threads that have a total score less than this variable will be expunged. | |
592 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
|
593 \"thread score\" is. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
594 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
595 This variable is local to the summary buffers." |
17493 | 596 :group 'gnus-treading |
597 :group 'gnus-score-default | |
598 :type '(choice (const :tag "off" nil) | |
599 integer)) | |
600 | |
601 (defcustom gnus-summary-mode-hook nil | |
602 "*A hook for Gnus summary mode. | |
603 This hook is run before any variables are set in the summary buffer." | |
604 :group 'gnus-summary-various | |
605 :type 'hook) | |
606 | |
607 (defcustom gnus-summary-menu-hook nil | |
608 "*Hook run after the creation of the summary mode menu." | |
609 :group 'gnus-summary-visual | |
610 :type 'hook) | |
611 | |
612 (defcustom gnus-summary-exit-hook nil | |
613 "*A hook called on exit from the summary buffer. | |
614 It will be called with point in the group buffer." | |
615 :group 'gnus-summary-exit | |
616 :type 'hook) | |
617 | |
618 (defcustom gnus-summary-prepare-hook nil | |
619 "*A hook called after the summary buffer has been generated. | |
620 If you want to modify the summary buffer, you can use this hook." | |
621 :group 'gnus-summary-various | |
622 :type 'hook) | |
623 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
624 (defcustom gnus-summary-prepared-hook nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
625 "*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
|
626 :group 'gnus-summary-various |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
627 :type 'hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
628 |
17493 | 629 (defcustom gnus-summary-generate-hook nil |
630 "*A hook run just before generating the summary buffer. | |
631 This hook is commonly used to customize threading variables and the | |
632 like." | |
633 :group 'gnus-summary-various | |
634 :type 'hook) | |
635 | |
636 (defcustom gnus-select-group-hook nil | |
637 "*A hook called when a newsgroup is selected. | |
638 | |
639 If you'd like to simplify subjects like the | |
640 `gnus-summary-next-same-subject' command does, you can use the | |
641 following hook: | |
642 | |
643 (setq gnus-select-group-hook | |
644 (list | |
645 (lambda () | |
646 (mapcar (lambda (header) | |
647 (mail-header-set-subject | |
648 header | |
649 (gnus-simplify-subject | |
650 (mail-header-subject header) 're-only))) | |
651 gnus-newsgroup-headers))))" | |
652 :group 'gnus-group-select | |
653 :type 'hook) | |
654 | |
655 (defcustom gnus-select-article-hook nil | |
656 "*A hook called when an article is selected." | |
657 :group 'gnus-summary-choose | |
658 :type 'hook) | |
659 | |
660 (defcustom gnus-visual-mark-article-hook | |
661 (list 'gnus-highlight-selected-summary) | |
662 "*Hook run after selecting an article in the summary buffer. | |
663 It is meant to be used for highlighting the article in some way. It | |
664 is not run if `gnus-visual' is nil." | |
665 :group 'gnus-summary-visual | |
666 :type 'hook) | |
667 | |
19989
9049c6de031f
(gnus-structured-field-decoder): If the
Kenichi Handa <handa@m17n.org>
parents:
19969
diff
changeset
|
668 (defcustom gnus-structured-field-decoder |
20117
b84c6ec5f561
(gnus-structured-field-decoder): Pay attention
Kenichi Handa <handa@m17n.org>
parents:
19989
diff
changeset
|
669 (if (and (featurep 'mule) |
b84c6ec5f561
(gnus-structured-field-decoder): Pay attention
Kenichi Handa <handa@m17n.org>
parents:
19989
diff
changeset
|
670 (boundp 'enable-multibyte-characters)) |
19989
9049c6de031f
(gnus-structured-field-decoder): If the
Kenichi Handa <handa@m17n.org>
parents:
19969
diff
changeset
|
671 (lambda (string) |
20117
b84c6ec5f561
(gnus-structured-field-decoder): Pay attention
Kenichi Handa <handa@m17n.org>
parents:
19989
diff
changeset
|
672 (if (and enable-multibyte-characters gnus-mule-coding-system) |
19989
9049c6de031f
(gnus-structured-field-decoder): If the
Kenichi Handa <handa@m17n.org>
parents:
19969
diff
changeset
|
673 (decode-coding-string string gnus-mule-coding-system) |
20117
b84c6ec5f561
(gnus-structured-field-decoder): Pay attention
Kenichi Handa <handa@m17n.org>
parents:
19989
diff
changeset
|
674 string)) |
b84c6ec5f561
(gnus-structured-field-decoder): Pay attention
Kenichi Handa <handa@m17n.org>
parents:
19989
diff
changeset
|
675 'identity) |
19594
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
676 "Function to decode non-ASCII characters in structured field for summary." |
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
677 :group 'gnus-various |
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
678 :type 'function) |
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
679 |
19989
9049c6de031f
(gnus-structured-field-decoder): If the
Kenichi Handa <handa@m17n.org>
parents:
19969
diff
changeset
|
680 (defcustom gnus-unstructured-field-decoder |
20117
b84c6ec5f561
(gnus-structured-field-decoder): Pay attention
Kenichi Handa <handa@m17n.org>
parents:
19989
diff
changeset
|
681 (if (and (featurep 'mule) |
b84c6ec5f561
(gnus-structured-field-decoder): Pay attention
Kenichi Handa <handa@m17n.org>
parents:
19989
diff
changeset
|
682 (boundp 'enable-multibyte-characters)) |
19989
9049c6de031f
(gnus-structured-field-decoder): If the
Kenichi Handa <handa@m17n.org>
parents:
19969
diff
changeset
|
683 (lambda (string) |
20117
b84c6ec5f561
(gnus-structured-field-decoder): Pay attention
Kenichi Handa <handa@m17n.org>
parents:
19989
diff
changeset
|
684 (if (and enable-multibyte-characters gnus-mule-coding-system) |
19989
9049c6de031f
(gnus-structured-field-decoder): If the
Kenichi Handa <handa@m17n.org>
parents:
19969
diff
changeset
|
685 (decode-coding-string string gnus-mule-coding-system) |
20117
b84c6ec5f561
(gnus-structured-field-decoder): Pay attention
Kenichi Handa <handa@m17n.org>
parents:
19989
diff
changeset
|
686 string)) |
b84c6ec5f561
(gnus-structured-field-decoder): Pay attention
Kenichi Handa <handa@m17n.org>
parents:
19989
diff
changeset
|
687 'identity) |
19594
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
688 "Function to decode non-ASCII characters in unstructured field for summary." |
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
689 :group 'gnus-various |
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
690 :type 'function) |
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
691 |
17493 | 692 (defcustom gnus-parse-headers-hook |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
693 (list 'gnus-hack-decode-rfc1522 'gnus-decode-rfc1522) |
17493 | 694 "*A hook called before parsing the headers." |
695 :group 'gnus-various | |
696 :type 'hook) | |
697 | |
698 (defcustom gnus-exit-group-hook nil | |
699 "*A hook called when exiting (not quitting) summary mode." | |
700 :group 'gnus-various | |
701 :type 'hook) | |
702 | |
703 (defcustom gnus-summary-update-hook | |
704 (list 'gnus-summary-highlight-line) | |
705 "*A hook called when a summary line is changed. | |
706 The hook will not be called if `gnus-visual' is nil. | |
707 | |
708 The default function `gnus-summary-highlight-line' will | |
709 highlight the line according to the `gnus-summary-highlight' | |
710 variable." | |
711 :group 'gnus-summary-visual | |
712 :type 'hook) | |
713 | |
714 (defcustom gnus-mark-article-hook '(gnus-summary-mark-read-and-unread-as-read) | |
715 "*A hook called when an article is selected for the first time. | |
716 The hook is intended to mark an article as read (or unread) | |
717 automatically when it is selected." | |
718 :group 'gnus-summary-choose | |
719 :type 'hook) | |
720 | |
721 (defcustom gnus-group-no-more-groups-hook nil | |
722 "*A hook run when returning to group mode having no more (unread) groups." | |
723 :group 'gnus-group-select | |
724 :type 'hook) | |
725 | |
726 (defcustom gnus-ps-print-hook nil | |
727 "*A hook run before ps-printing something from Gnus." | |
728 :group 'gnus-summary | |
729 :type 'hook) | |
730 | |
731 (defcustom gnus-summary-selected-face 'gnus-summary-selected-face | |
732 "Face used for highlighting the current article in the summary buffer." | |
733 :group 'gnus-summary-visual | |
734 :type 'face) | |
735 | |
736 (defcustom gnus-summary-highlight | |
737 '(((= mark gnus-canceled-mark) | |
738 . gnus-summary-cancelled-face) | |
739 ((and (> score default) | |
740 (or (= mark gnus-dormant-mark) | |
741 (= mark gnus-ticked-mark))) | |
742 . gnus-summary-high-ticked-face) | |
743 ((and (< score default) | |
744 (or (= mark gnus-dormant-mark) | |
745 (= mark gnus-ticked-mark))) | |
746 . gnus-summary-low-ticked-face) | |
747 ((or (= mark gnus-dormant-mark) | |
748 (= mark gnus-ticked-mark)) | |
749 . gnus-summary-normal-ticked-face) | |
750 ((and (> score default) (= mark gnus-ancient-mark)) | |
751 . gnus-summary-high-ancient-face) | |
752 ((and (< score default) (= mark gnus-ancient-mark)) | |
753 . gnus-summary-low-ancient-face) | |
754 ((= mark gnus-ancient-mark) | |
755 . gnus-summary-normal-ancient-face) | |
756 ((and (> score default) (= mark gnus-unread-mark)) | |
757 . gnus-summary-high-unread-face) | |
758 ((and (< score default) (= mark gnus-unread-mark)) | |
759 . gnus-summary-low-unread-face) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
760 ((= mark gnus-unread-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
761 . gnus-summary-normal-unread-face) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
762 ((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
|
763 gnus-undownloaded-mark))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
764 . gnus-summary-high-unread-face) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
765 ((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
|
766 gnus-undownloaded-mark))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
767 . gnus-summary-low-unread-face) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
768 ((memq mark (list gnus-downloadable-mark gnus-undownloaded-mark)) |
17493 | 769 . gnus-summary-normal-unread-face) |
770 ((> score default) | |
771 . gnus-summary-high-read-face) | |
772 ((< score default) | |
773 . gnus-summary-low-read-face) | |
774 (t | |
775 . gnus-summary-normal-read-face)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
776 "*Controls the highlighting of summary buffer lines. |
17493 | 777 |
778 A list of (FORM . FACE) pairs. When deciding how a a particular | |
779 summary line should be displayed, each form is evaluated. The content | |
780 of the face field after the first true form is used. You can change | |
781 how those summary lines are displayed, by editing the face field. | |
782 | |
783 You can use the following variables in the FORM field. | |
784 | |
785 score: The articles score | |
786 default: The default article score. | |
787 below: The score below which articles are automatically marked as read. | |
788 mark: The articles mark." | |
789 :group 'gnus-summary-visual | |
790 :type '(repeat (cons (sexp :tag "Form" nil) | |
791 face))) | |
792 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
793 (defcustom gnus-alter-header-function nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
794 "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
|
795 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
|
796 which it may alter in any way.") |
17493 | 797 |
798 ;;; Internal variables | |
799 | |
800 (defvar gnus-scores-exclude-files nil) | |
801 (defvar gnus-page-broken nil) | |
802 | |
803 (defvar gnus-original-article nil) | |
804 (defvar gnus-article-internal-prepare-hook nil) | |
805 (defvar gnus-newsgroup-process-stack nil) | |
806 | |
807 (defvar gnus-thread-indent-array nil) | |
808 (defvar gnus-thread-indent-array-level gnus-thread-indent-level) | |
809 | |
810 ;; Avoid highlighting in kill files. | |
811 (defvar gnus-summary-inhibit-highlight nil) | |
812 (defvar gnus-newsgroup-selected-overlay nil) | |
813 (defvar gnus-inhibit-limiting nil) | |
814 (defvar gnus-newsgroup-adaptive-score-file nil) | |
815 (defvar gnus-current-score-file nil) | |
816 (defvar gnus-current-move-group nil) | |
817 (defvar gnus-current-copy-group nil) | |
818 (defvar gnus-current-crosspost-group nil) | |
819 | |
820 (defvar gnus-newsgroup-dependencies nil) | |
821 (defvar gnus-newsgroup-adaptive nil) | |
822 (defvar gnus-summary-display-article-function nil) | |
823 (defvar gnus-summary-highlight-line-function nil | |
824 "Function called after highlighting a summary line.") | |
825 | |
826 (defvar gnus-summary-line-format-alist | |
827 `((?N ,(macroexpand '(mail-header-number gnus-tmp-header)) ?d) | |
828 (?S ,(macroexpand '(mail-header-subject gnus-tmp-header)) ?s) | |
829 (?s gnus-tmp-subject-or-nil ?s) | |
830 (?n gnus-tmp-name ?s) | |
831 (?A (car (cdr (funcall gnus-extract-address-components gnus-tmp-from))) | |
832 ?s) | |
833 (?a (or (car (funcall gnus-extract-address-components gnus-tmp-from)) | |
834 gnus-tmp-from) ?s) | |
835 (?F gnus-tmp-from ?s) | |
836 (?x ,(macroexpand '(mail-header-xref gnus-tmp-header)) ?s) | |
837 (?D ,(macroexpand '(mail-header-date gnus-tmp-header)) ?s) | |
838 (?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
|
839 (?o (gnus-date-iso8601 (mail-header-date gnus-tmp-header)) ?s) |
17493 | 840 (?M ,(macroexpand '(mail-header-id gnus-tmp-header)) ?s) |
841 (?r ,(macroexpand '(mail-header-references gnus-tmp-header)) ?s) | |
842 (?c (or (mail-header-chars gnus-tmp-header) 0) ?d) | |
843 (?L gnus-tmp-lines ?d) | |
844 (?I gnus-tmp-indentation ?s) | |
845 (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s) | |
846 (?R gnus-tmp-replied ?c) | |
847 (?\[ gnus-tmp-opening-bracket ?c) | |
848 (?\] gnus-tmp-closing-bracket ?c) | |
849 (?\> (make-string gnus-tmp-level ? ) ?s) | |
850 (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s) | |
851 (?i gnus-tmp-score ?d) | |
852 (?z gnus-tmp-score-char ?c) | |
853 (?l (bbb-grouplens-score gnus-tmp-header) ?s) | |
854 (?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d) | |
855 (?U gnus-tmp-unread ?c) | |
856 (?t (gnus-summary-number-of-articles-in-thread | |
857 (and (boundp 'thread) (car thread)) gnus-tmp-level) | |
858 ?d) | |
859 (?e (gnus-summary-number-of-articles-in-thread | |
860 (and (boundp 'thread) (car thread)) gnus-tmp-level t) | |
861 ?c) | |
862 (?u gnus-tmp-user-defined ?s) | |
863 (?P (gnus-pick-line-number) ?d)) | |
864 "An alist of format specifications that can appear in summary lines, | |
865 and what variables they correspond with, along with the type of the | |
866 variable (string, integer, character, etc).") | |
867 | |
868 (defvar gnus-summary-dummy-line-format-alist | |
869 `((?S gnus-tmp-subject ?s) | |
870 (?N gnus-tmp-number ?d) | |
871 (?u gnus-tmp-user-defined ?s))) | |
872 | |
873 (defvar gnus-summary-mode-line-format-alist | |
874 `((?G gnus-tmp-group-name ?s) | |
875 (?g (gnus-short-group-name gnus-tmp-group-name) ?s) | |
876 (?p (gnus-group-real-name gnus-tmp-group-name) ?s) | |
877 (?A gnus-tmp-article-number ?d) | |
878 (?Z gnus-tmp-unread-and-unselected ?s) | |
879 (?V gnus-version ?s) | |
880 (?U gnus-tmp-unread-and-unticked ?d) | |
881 (?S gnus-tmp-subject ?s) | |
882 (?e gnus-tmp-unselected ?d) | |
883 (?u gnus-tmp-user-defined ?s) | |
884 (?d (length gnus-newsgroup-dormant) ?d) | |
885 (?t (length gnus-newsgroup-marked) ?d) | |
886 (?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
|
887 (?z (gnus-summary-article-score gnus-tmp-article-number) ?d) |
17493 | 888 (?E gnus-newsgroup-expunged-tally ?d) |
889 (?s (gnus-current-score-file-nondirectory) ?s))) | |
890 | |
891 (defvar gnus-last-search-regexp nil | |
892 "Default regexp for article search command.") | |
893 | |
894 (defvar gnus-last-shell-command nil | |
895 "Default shell command on article.") | |
896 | |
897 (defvar gnus-newsgroup-begin nil) | |
898 (defvar gnus-newsgroup-end nil) | |
899 (defvar gnus-newsgroup-last-rmail nil) | |
900 (defvar gnus-newsgroup-last-mail nil) | |
901 (defvar gnus-newsgroup-last-folder nil) | |
902 (defvar gnus-newsgroup-last-file nil) | |
903 (defvar gnus-newsgroup-auto-expire nil) | |
904 (defvar gnus-newsgroup-active nil) | |
905 | |
906 (defvar gnus-newsgroup-data nil) | |
907 (defvar gnus-newsgroup-data-reverse nil) | |
908 (defvar gnus-newsgroup-limit nil) | |
909 (defvar gnus-newsgroup-limits nil) | |
910 | |
911 (defvar gnus-newsgroup-unreads nil | |
912 "List of unread articles in the current newsgroup.") | |
913 | |
914 (defvar gnus-newsgroup-unselected nil | |
915 "List of unselected unread articles in the current newsgroup.") | |
916 | |
917 (defvar gnus-newsgroup-reads nil | |
918 "Alist of read articles and article marks in the current newsgroup.") | |
919 | |
920 (defvar gnus-newsgroup-expunged-tally nil) | |
921 | |
922 (defvar gnus-newsgroup-marked nil | |
923 "List of ticked articles in the current newsgroup (a subset of unread art).") | |
924 | |
925 (defvar gnus-newsgroup-killed nil | |
926 "List of ranges of articles that have been through the scoring process.") | |
927 | |
928 (defvar gnus-newsgroup-cached nil | |
929 "List of articles that come from the article cache.") | |
930 | |
931 (defvar gnus-newsgroup-saved nil | |
932 "List of articles that have been saved.") | |
933 | |
934 (defvar gnus-newsgroup-kill-headers nil) | |
935 | |
936 (defvar gnus-newsgroup-replied nil | |
937 "List of articles that have been replied to in the current newsgroup.") | |
938 | |
939 (defvar gnus-newsgroup-expirable nil | |
940 "List of articles in the current newsgroup that can be expired.") | |
941 | |
942 (defvar gnus-newsgroup-processable nil | |
943 "List of articles in the current newsgroup that can be processed.") | |
944 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
945 (defvar gnus-newsgroup-downloadable nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
946 "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
|
947 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
948 (defvar gnus-newsgroup-undownloaded nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
949 "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
|
950 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
951 (defvar gnus-newsgroup-unsendable nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
952 "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
|
953 |
17493 | 954 (defvar gnus-newsgroup-bookmarks nil |
955 "List of articles in the current newsgroup that have bookmarks.") | |
956 | |
957 (defvar gnus-newsgroup-dormant nil | |
958 "List of dormant articles in the current newsgroup.") | |
959 | |
960 (defvar gnus-newsgroup-scored nil | |
961 "List of scored articles in the current newsgroup.") | |
962 | |
963 (defvar gnus-newsgroup-headers nil | |
964 "List of article headers in the current newsgroup.") | |
965 | |
966 (defvar gnus-newsgroup-threads nil) | |
967 | |
968 (defvar gnus-newsgroup-prepared nil | |
969 "Whether the current group has been prepared properly.") | |
970 | |
971 (defvar gnus-newsgroup-ancient nil | |
972 "List of `gnus-fetch-old-headers' articles in the current newsgroup.") | |
973 | |
974 (defvar gnus-newsgroup-sparse nil) | |
975 | |
976 (defvar gnus-current-article nil) | |
977 (defvar gnus-article-current nil) | |
978 (defvar gnus-current-headers nil) | |
979 (defvar gnus-have-all-headers nil) | |
980 (defvar gnus-last-article nil) | |
981 (defvar gnus-newsgroup-history nil) | |
982 | |
983 (defconst gnus-summary-local-variables | |
984 '(gnus-newsgroup-name | |
985 gnus-newsgroup-begin gnus-newsgroup-end | |
986 gnus-newsgroup-last-rmail gnus-newsgroup-last-mail | |
987 gnus-newsgroup-last-folder gnus-newsgroup-last-file | |
988 gnus-newsgroup-auto-expire gnus-newsgroup-unreads | |
989 gnus-newsgroup-unselected gnus-newsgroup-marked | |
990 gnus-newsgroup-reads gnus-newsgroup-saved | |
991 gnus-newsgroup-replied gnus-newsgroup-expirable | |
992 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
|
993 gnus-newsgroup-downloadable gnus-newsgroup-undownloaded |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
994 gnus-newsgroup-unsendable |
17493 | 995 gnus-newsgroup-bookmarks gnus-newsgroup-dormant |
996 gnus-newsgroup-headers gnus-newsgroup-threads | |
997 gnus-newsgroup-prepared gnus-summary-highlight-line-function | |
998 gnus-current-article gnus-current-headers gnus-have-all-headers | |
999 gnus-last-article gnus-article-internal-prepare-hook | |
1000 gnus-newsgroup-dependencies gnus-newsgroup-selected-overlay | |
1001 gnus-newsgroup-scored gnus-newsgroup-kill-headers | |
1002 gnus-thread-expunge-below | |
1003 gnus-score-alist gnus-current-score-file gnus-summary-expunge-below | |
1004 (gnus-summary-mark-below . global) | |
1005 gnus-newsgroup-active gnus-scores-exclude-files | |
1006 gnus-newsgroup-history gnus-newsgroup-ancient | |
1007 gnus-newsgroup-sparse gnus-newsgroup-process-stack | |
1008 (gnus-newsgroup-adaptive . gnus-use-adaptive-scoring) | |
1009 gnus-newsgroup-adaptive-score-file (gnus-reffed-article-number . -1) | |
1010 (gnus-newsgroup-expunged-tally . 0) | |
1011 gnus-cache-removable-articles gnus-newsgroup-cached | |
1012 gnus-newsgroup-data gnus-newsgroup-data-reverse | |
1013 gnus-newsgroup-limit gnus-newsgroup-limits) | |
1014 "Variables that are buffer-local to the summary buffers.") | |
1015 | |
1016 ;; Byte-compiler warning. | |
1017 (defvar gnus-article-mode-map) | |
1018 | |
1019 ;; Subject simplification. | |
1020 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1021 (defun gnus-simplify-whitespace (str) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1022 "Remove excessive whitespace." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1023 (let ((mystr str)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1024 ;; Multiple spaces. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1025 (while (string-match "[ \t][ \t]+" mystr) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1026 (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
|
1027 " " |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1028 (substring mystr (match-end 0))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1029 ;; Leading spaces. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1030 (when (string-match "^[ \t]+" mystr) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1031 (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
|
1032 ;; Trailing spaces. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1033 (when (string-match "[ \t]+$" mystr) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1034 (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
|
1035 mystr)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1036 |
17493 | 1037 (defsubst gnus-simplify-subject-re (subject) |
1038 "Remove \"Re:\" from subject lines." | |
1039 (if (string-match "^[Rr][Ee]: *" subject) | |
1040 (substring subject (match-end 0)) | |
1041 subject)) | |
1042 | |
1043 (defun gnus-simplify-subject (subject &optional re-only) | |
1044 "Remove `Re:' and words in parentheses. | |
1045 If RE-ONLY is non-nil, strip leading `Re:'s only." | |
1046 (let ((case-fold-search t)) ;Ignore case. | |
1047 ;; Remove `Re:', `Re^N:', `Re(n)', and `Re[n]:'. | |
1048 (when (string-match "\\`\\(re\\([[(^][0-9]+[])]?\\)?:[ \t]*\\)+" subject) | |
1049 (setq subject (substring subject (match-end 0)))) | |
1050 ;; Remove uninteresting prefixes. | |
1051 (when (and (not re-only) | |
1052 gnus-simplify-ignored-prefixes | |
1053 (string-match gnus-simplify-ignored-prefixes subject)) | |
1054 (setq subject (substring subject (match-end 0)))) | |
1055 ;; Remove words in parentheses from end. | |
1056 (unless re-only | |
1057 (while (string-match "[ \t\n]*([^()]*)[ \t\n]*\\'" subject) | |
1058 (setq subject (substring subject 0 (match-beginning 0))))) | |
1059 ;; Return subject string. | |
1060 subject)) | |
1061 | |
1062 ;; Remove any leading "re:"s, any trailing paren phrases, and simplify | |
1063 ;; all whitespace. | |
1064 (defsubst gnus-simplify-buffer-fuzzy-step (regexp &optional newtext) | |
1065 (goto-char (point-min)) | |
1066 (while (re-search-forward regexp nil t) | |
1067 (replace-match (or newtext "")))) | |
1068 | |
1069 (defun gnus-simplify-buffer-fuzzy () | |
1070 "Simplify string in the buffer fuzzily. | |
1071 The string in the accessible portion of the current buffer is simplified. | |
1072 It is assumed to be a single-line subject. | |
1073 Whitespace is generally cleaned up, and miscellaneous leading/trailing | |
1074 matter is removed. Additional things can be deleted by setting | |
1075 gnus-simplify-subject-fuzzy-regexp." | |
1076 (let ((case-fold-search t) | |
1077 (modified-tick)) | |
1078 (gnus-simplify-buffer-fuzzy-step "\t" " ") | |
1079 | |
1080 (while (not (eq modified-tick (buffer-modified-tick))) | |
1081 (setq modified-tick (buffer-modified-tick)) | |
1082 (cond | |
1083 ((listp gnus-simplify-subject-fuzzy-regexp) | |
1084 (mapcar 'gnus-simplify-buffer-fuzzy-step | |
1085 gnus-simplify-subject-fuzzy-regexp)) | |
1086 (gnus-simplify-subject-fuzzy-regexp | |
1087 (gnus-simplify-buffer-fuzzy-step gnus-simplify-subject-fuzzy-regexp))) | |
1088 (gnus-simplify-buffer-fuzzy-step "^ *\\[[-+?*!][-+?*!]\\] *") | |
1089 (gnus-simplify-buffer-fuzzy-step | |
1090 "^ *\\(re\\|fw\\|fwd\\)[[{(^0-9]*[])}]?[:;] *") | |
1091 (gnus-simplify-buffer-fuzzy-step "^[[].*:\\( .*\\)[]]$" "\\1")) | |
1092 | |
1093 (gnus-simplify-buffer-fuzzy-step " *[[{(][^()\n]*[]})] *$") | |
1094 (gnus-simplify-buffer-fuzzy-step " +" " ") | |
1095 (gnus-simplify-buffer-fuzzy-step " $") | |
1096 (gnus-simplify-buffer-fuzzy-step "^ +"))) | |
1097 | |
1098 (defun gnus-simplify-subject-fuzzy (subject) | |
1099 "Simplify a subject string fuzzily. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1100 See `gnus-simplify-buffer-fuzzy' for details." |
17493 | 1101 (save-excursion |
1102 (gnus-set-work-buffer) | |
1103 (let ((case-fold-search t)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1104 ;; Remove uninteresting prefixes. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1105 (when (and gnus-simplify-ignored-prefixes |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1106 (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
|
1107 (setq subject (substring subject (match-end 0)))) |
17493 | 1108 (insert subject) |
1109 (inline (gnus-simplify-buffer-fuzzy)) | |
1110 (buffer-string)))) | |
1111 | |
1112 (defsubst gnus-simplify-subject-fully (subject) | |
1113 "Simplify a subject string according to gnus-summary-gather-subject-limit." | |
1114 (cond | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1115 (gnus-simplify-subject-functions |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1116 (gnus-map-function gnus-simplify-subject-functions subject)) |
17493 | 1117 ((null gnus-summary-gather-subject-limit) |
1118 (gnus-simplify-subject-re subject)) | |
1119 ((eq gnus-summary-gather-subject-limit 'fuzzy) | |
1120 (gnus-simplify-subject-fuzzy subject)) | |
1121 ((numberp gnus-summary-gather-subject-limit) | |
1122 (gnus-limit-string (gnus-simplify-subject-re subject) | |
1123 gnus-summary-gather-subject-limit)) | |
1124 (t | |
1125 subject))) | |
1126 | |
1127 (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
|
1128 "Check whether two subjects are equal. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1129 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
|
1130 simplified." |
17493 | 1131 (cond |
1132 ((null simple-first) | |
1133 (equal (gnus-simplify-subject-fully s1) | |
1134 (gnus-simplify-subject-fully s2))) | |
1135 (t | |
1136 (equal s1 | |
1137 (gnus-simplify-subject-fully s2))))) | |
1138 | |
1139 (defun gnus-summary-bubble-group () | |
1140 "Increase the score of the current group. | |
1141 This is a handy function to add to `gnus-summary-exit-hook' to | |
1142 increase the score of each group you read." | |
1143 (gnus-group-add-score gnus-newsgroup-name)) | |
1144 | |
1145 | |
1146 ;;; | |
1147 ;;; Gnus summary mode | |
1148 ;;; | |
1149 | |
1150 (put 'gnus-summary-mode 'mode-class 'special) | |
1151 | |
1152 (when t | |
1153 ;; Non-orthogonal keys | |
1154 | |
1155 (gnus-define-keys gnus-summary-mode-map | |
1156 " " gnus-summary-next-page | |
1157 "\177" gnus-summary-prev-page | |
1158 [delete] gnus-summary-prev-page | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1159 [backspace] gnus-summary-prev-page |
17493 | 1160 "\r" gnus-summary-scroll-up |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1161 "\M-\r" gnus-summary-scroll-down |
17493 | 1162 "n" gnus-summary-next-unread-article |
1163 "p" gnus-summary-prev-unread-article | |
1164 "N" gnus-summary-next-article | |
1165 "P" gnus-summary-prev-article | |
1166 "\M-\C-n" gnus-summary-next-same-subject | |
1167 "\M-\C-p" gnus-summary-prev-same-subject | |
1168 "\M-n" gnus-summary-next-unread-subject | |
1169 "\M-p" gnus-summary-prev-unread-subject | |
1170 "." gnus-summary-first-unread-article | |
1171 "," gnus-summary-best-unread-article | |
1172 "\M-s" gnus-summary-search-article-forward | |
1173 "\M-r" gnus-summary-search-article-backward | |
1174 "<" gnus-summary-beginning-of-article | |
1175 ">" gnus-summary-end-of-article | |
1176 "j" gnus-summary-goto-article | |
1177 "^" gnus-summary-refer-parent-article | |
1178 "\M-^" gnus-summary-refer-article | |
1179 "u" gnus-summary-tick-article-forward | |
1180 "!" gnus-summary-tick-article-forward | |
1181 "U" gnus-summary-tick-article-backward | |
1182 "d" gnus-summary-mark-as-read-forward | |
1183 "D" gnus-summary-mark-as-read-backward | |
1184 "E" gnus-summary-mark-as-expirable | |
1185 "\M-u" gnus-summary-clear-mark-forward | |
1186 "\M-U" gnus-summary-clear-mark-backward | |
1187 "k" gnus-summary-kill-same-subject-and-select | |
1188 "\C-k" gnus-summary-kill-same-subject | |
1189 "\M-\C-k" gnus-summary-kill-thread | |
1190 "\M-\C-l" gnus-summary-lower-thread | |
1191 "e" gnus-summary-edit-article | |
1192 "#" gnus-summary-mark-as-processable | |
1193 "\M-#" gnus-summary-unmark-as-processable | |
1194 "\M-\C-t" gnus-summary-toggle-threads | |
1195 "\M-\C-s" gnus-summary-show-thread | |
1196 "\M-\C-h" gnus-summary-hide-thread | |
1197 "\M-\C-f" gnus-summary-next-thread | |
1198 "\M-\C-b" gnus-summary-prev-thread | |
1199 "\M-\C-u" gnus-summary-up-thread | |
1200 "\M-\C-d" gnus-summary-down-thread | |
1201 "&" gnus-summary-execute-command | |
1202 "c" gnus-summary-catchup-and-exit | |
1203 "\C-w" gnus-summary-mark-region-as-read | |
1204 "\C-t" gnus-summary-toggle-truncation | |
1205 "?" gnus-summary-mark-as-dormant | |
1206 "\C-c\M-\C-s" gnus-summary-limit-include-expunged | |
1207 "\C-c\C-s\C-n" gnus-summary-sort-by-number | |
1208 "\C-c\C-s\C-l" gnus-summary-sort-by-lines | |
1209 "\C-c\C-s\C-a" gnus-summary-sort-by-author | |
1210 "\C-c\C-s\C-s" gnus-summary-sort-by-subject | |
1211 "\C-c\C-s\C-d" gnus-summary-sort-by-date | |
1212 "\C-c\C-s\C-i" gnus-summary-sort-by-score | |
1213 "=" gnus-summary-expand-window | |
1214 "\C-x\C-s" gnus-summary-reselect-current-group | |
1215 "\M-g" gnus-summary-rescan-group | |
1216 "w" gnus-summary-stop-page-breaking | |
1217 "\C-c\C-r" gnus-summary-caesar-message | |
1218 "\M-t" gnus-summary-toggle-mime | |
1219 "f" gnus-summary-followup | |
1220 "F" gnus-summary-followup-with-original | |
1221 "C" gnus-summary-cancel-article | |
1222 "r" gnus-summary-reply | |
1223 "R" gnus-summary-reply-with-original | |
1224 "\C-c\C-f" gnus-summary-mail-forward | |
1225 "o" gnus-summary-save-article | |
1226 "\C-o" gnus-summary-save-article-mail | |
1227 "|" gnus-summary-pipe-output | |
1228 "\M-k" gnus-summary-edit-local-kill | |
1229 "\M-K" gnus-summary-edit-global-kill | |
1230 ;; "V" gnus-version | |
1231 "\C-c\C-d" gnus-summary-describe-group | |
1232 "q" gnus-summary-exit | |
1233 "Q" gnus-summary-exit-no-update | |
1234 "\C-c\C-i" gnus-info-find-node | |
1235 gnus-mouse-2 gnus-mouse-pick-article | |
1236 "m" gnus-summary-mail-other-window | |
1237 "a" gnus-summary-post-news | |
1238 "x" gnus-summary-limit-to-unread | |
1239 "s" gnus-summary-isearch-article | |
1240 "t" gnus-article-hide-headers | |
1241 "g" gnus-summary-show-article | |
1242 "l" gnus-summary-goto-last-article | |
1243 "\C-c\C-v\C-v" gnus-uu-decode-uu-view | |
1244 "\C-d" gnus-summary-enter-digest-group | |
1245 "\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
|
1246 "\M-\C-e" gnus-summary-edit-parameters |
17493 | 1247 "\C-c\C-b" gnus-bug |
1248 "*" gnus-cache-enter-article | |
1249 "\M-*" gnus-cache-remove-article | |
1250 "\M-&" gnus-summary-universal-argument | |
1251 "\C-l" gnus-recenter | |
1252 "I" gnus-summary-increase-score | |
1253 "L" gnus-summary-lower-score | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1254 "\M-i" gnus-symbolic-argument |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1255 "h" gnus-summary-select-article-buffer |
17493 | 1256 |
1257 "V" gnus-summary-score-map | |
1258 "X" gnus-uu-extract-map | |
1259 "S" gnus-summary-send-map) | |
1260 | |
1261 ;; Sort of orthogonal keymap | |
1262 (gnus-define-keys (gnus-summary-mark-map "M" gnus-summary-mode-map) | |
1263 "t" gnus-summary-tick-article-forward | |
1264 "!" gnus-summary-tick-article-forward | |
1265 "d" gnus-summary-mark-as-read-forward | |
1266 "r" gnus-summary-mark-as-read-forward | |
1267 "c" gnus-summary-clear-mark-forward | |
1268 " " gnus-summary-clear-mark-forward | |
1269 "e" gnus-summary-mark-as-expirable | |
1270 "x" gnus-summary-mark-as-expirable | |
1271 "?" gnus-summary-mark-as-dormant | |
1272 "b" gnus-summary-set-bookmark | |
1273 "B" gnus-summary-remove-bookmark | |
1274 "#" gnus-summary-mark-as-processable | |
1275 "\M-#" gnus-summary-unmark-as-processable | |
1276 "S" gnus-summary-limit-include-expunged | |
1277 "C" gnus-summary-catchup | |
1278 "H" gnus-summary-catchup-to-here | |
1279 "\C-c" gnus-summary-catchup-all | |
1280 "k" gnus-summary-kill-same-subject-and-select | |
1281 "K" gnus-summary-kill-same-subject | |
1282 "P" gnus-uu-mark-map) | |
1283 | |
1284 (gnus-define-keys (gnus-summary-mscore-map "V" gnus-summary-mark-map) | |
1285 "c" gnus-summary-clear-above | |
1286 "u" gnus-summary-tick-above | |
1287 "m" gnus-summary-mark-above | |
1288 "k" gnus-summary-kill-below) | |
1289 | |
1290 (gnus-define-keys (gnus-summary-limit-map "/" gnus-summary-mode-map) | |
1291 "/" gnus-summary-limit-to-subject | |
1292 "n" gnus-summary-limit-to-articles | |
1293 "w" gnus-summary-pop-limit | |
1294 "s" gnus-summary-limit-to-subject | |
1295 "a" gnus-summary-limit-to-author | |
1296 "u" gnus-summary-limit-to-unread | |
1297 "m" gnus-summary-limit-to-marks | |
1298 "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
|
1299 "*" gnus-summary-limit-include-cached |
17493 | 1300 "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
|
1301 "T" gnus-summary-limit-include-thread |
17493 | 1302 "d" gnus-summary-limit-exclude-dormant |
1303 "t" gnus-summary-limit-to-age | |
1304 "E" gnus-summary-limit-include-expunged | |
1305 "c" gnus-summary-limit-exclude-childless-dormant | |
1306 "C" gnus-summary-limit-mark-excluded-as-read) | |
1307 | |
1308 (gnus-define-keys (gnus-summary-goto-map "G" gnus-summary-mode-map) | |
1309 "n" gnus-summary-next-unread-article | |
1310 "p" gnus-summary-prev-unread-article | |
1311 "N" gnus-summary-next-article | |
1312 "P" gnus-summary-prev-article | |
1313 "\C-n" gnus-summary-next-same-subject | |
1314 "\C-p" gnus-summary-prev-same-subject | |
1315 "\M-n" gnus-summary-next-unread-subject | |
1316 "\M-p" gnus-summary-prev-unread-subject | |
1317 "f" gnus-summary-first-unread-article | |
1318 "b" gnus-summary-best-unread-article | |
1319 "j" gnus-summary-goto-article | |
1320 "g" gnus-summary-goto-subject | |
1321 "l" gnus-summary-goto-last-article | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
1322 "o" gnus-summary-pop-article) |
17493 | 1323 |
1324 (gnus-define-keys (gnus-summary-thread-map "T" gnus-summary-mode-map) | |
1325 "k" gnus-summary-kill-thread | |
1326 "l" gnus-summary-lower-thread | |
1327 "i" gnus-summary-raise-thread | |
1328 "T" gnus-summary-toggle-threads | |
1329 "t" gnus-summary-rethread-current | |
1330 "^" gnus-summary-reparent-thread | |
1331 "s" gnus-summary-show-thread | |
1332 "S" gnus-summary-show-all-threads | |
1333 "h" gnus-summary-hide-thread | |
1334 "H" gnus-summary-hide-all-threads | |
1335 "n" gnus-summary-next-thread | |
1336 "p" gnus-summary-prev-thread | |
1337 "u" gnus-summary-up-thread | |
1338 "o" gnus-summary-top-thread | |
1339 "d" gnus-summary-down-thread | |
1340 "#" gnus-uu-mark-thread | |
1341 "\M-#" gnus-uu-unmark-thread) | |
1342 | |
1343 (gnus-define-keys (gnus-summary-buffer-map "Y" gnus-summary-mode-map) | |
1344 "g" gnus-summary-prepare | |
1345 "c" gnus-summary-insert-cached-articles) | |
1346 | |
1347 (gnus-define-keys (gnus-summary-exit-map "Z" gnus-summary-mode-map) | |
1348 "c" gnus-summary-catchup-and-exit | |
1349 "C" gnus-summary-catchup-all-and-exit | |
1350 "E" gnus-summary-exit-no-update | |
1351 "Q" gnus-summary-exit | |
1352 "Z" gnus-summary-exit | |
1353 "n" gnus-summary-catchup-and-goto-next-group | |
1354 "R" gnus-summary-reselect-current-group | |
1355 "G" gnus-summary-rescan-group | |
1356 "N" gnus-summary-next-group | |
1357 "s" gnus-summary-save-newsrc | |
1358 "P" gnus-summary-prev-group) | |
1359 | |
1360 (gnus-define-keys (gnus-summary-article-map "A" gnus-summary-mode-map) | |
1361 " " gnus-summary-next-page | |
1362 "n" gnus-summary-next-page | |
1363 "\177" gnus-summary-prev-page | |
1364 [delete] gnus-summary-prev-page | |
1365 "p" gnus-summary-prev-page | |
1366 "\r" gnus-summary-scroll-up | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1367 "\M-\r" gnus-summary-scroll-down |
17493 | 1368 "<" gnus-summary-beginning-of-article |
1369 ">" gnus-summary-end-of-article | |
1370 "b" gnus-summary-beginning-of-article | |
1371 "e" gnus-summary-end-of-article | |
1372 "^" gnus-summary-refer-parent-article | |
1373 "r" gnus-summary-refer-parent-article | |
1374 "R" gnus-summary-refer-references | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1375 "T" gnus-summary-refer-thread |
17493 | 1376 "g" gnus-summary-show-article |
1377 "s" gnus-summary-isearch-article | |
1378 "P" gnus-summary-print-article) | |
1379 | |
1380 (gnus-define-keys (gnus-summary-wash-map "W" gnus-summary-mode-map) | |
1381 "b" gnus-article-add-buttons | |
1382 "B" gnus-article-add-buttons-to-head | |
1383 "o" gnus-article-treat-overstrike | |
1384 "e" gnus-article-emphasize | |
1385 "w" gnus-article-fill-cited-article | |
1386 "c" gnus-article-remove-cr | |
1387 "q" gnus-article-de-quoted-unreadable | |
1388 "f" gnus-article-display-x-face | |
1389 "l" gnus-summary-stop-page-breaking | |
1390 "r" gnus-summary-caesar-message | |
1391 "t" gnus-article-hide-headers | |
1392 "v" gnus-summary-verbose-headers | |
1393 "m" gnus-summary-toggle-mime | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1394 "h" gnus-article-treat-html |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1395 "d" gnus-article-treat-dumbquotes) |
17493 | 1396 |
1397 (gnus-define-keys (gnus-summary-wash-hide-map "W" gnus-summary-wash-map) | |
1398 "a" gnus-article-hide | |
1399 "h" gnus-article-hide-headers | |
1400 "b" gnus-article-hide-boring-headers | |
1401 "s" gnus-article-hide-signature | |
1402 "c" gnus-article-hide-citation | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1403 "C" gnus-article-hide-citation-in-followups |
17493 | 1404 "p" gnus-article-hide-pgp |
1405 "P" gnus-article-hide-pem | |
1406 "\C-c" gnus-article-hide-citation-maybe) | |
1407 | |
1408 (gnus-define-keys (gnus-summary-wash-highlight-map "H" gnus-summary-wash-map) | |
1409 "a" gnus-article-highlight | |
1410 "h" gnus-article-highlight-headers | |
1411 "c" gnus-article-highlight-citation | |
1412 "s" gnus-article-highlight-signature) | |
1413 | |
1414 (gnus-define-keys (gnus-summary-wash-time-map "T" gnus-summary-wash-map) | |
1415 "z" gnus-article-date-ut | |
1416 "u" gnus-article-date-ut | |
1417 "l" gnus-article-date-local | |
1418 "e" gnus-article-date-lapsed | |
1419 "o" gnus-article-date-original | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1420 "i" gnus-article-date-iso8601 |
17493 | 1421 "s" gnus-article-date-user) |
1422 | |
1423 (gnus-define-keys (gnus-summary-wash-empty-map "E" gnus-summary-wash-map) | |
1424 "t" gnus-article-remove-trailing-blank-lines | |
1425 "l" gnus-article-strip-leading-blank-lines | |
1426 "m" gnus-article-strip-multiple-blank-lines | |
1427 "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
|
1428 "A" gnus-article-strip-all-blank-lines |
17493 | 1429 "s" gnus-article-strip-leading-space) |
1430 | |
1431 (gnus-define-keys (gnus-summary-help-map "H" gnus-summary-mode-map) | |
1432 "v" gnus-version | |
1433 "f" gnus-summary-fetch-faq | |
1434 "d" gnus-summary-describe-group | |
1435 "h" gnus-summary-describe-briefly | |
1436 "i" gnus-info-find-node) | |
1437 | |
1438 (gnus-define-keys (gnus-summary-backend-map "B" gnus-summary-mode-map) | |
1439 "e" gnus-summary-expire-articles | |
1440 "\M-\C-e" gnus-summary-expire-articles-now | |
1441 "\177" gnus-summary-delete-article | |
1442 [delete] gnus-summary-delete-article | |
1443 "m" gnus-summary-move-article | |
1444 "r" gnus-summary-respool-article | |
1445 "w" gnus-summary-edit-article | |
1446 "c" gnus-summary-copy-article | |
1447 "B" gnus-summary-crosspost-article | |
1448 "q" gnus-summary-respool-query | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1449 "t" gnus-summary-respool-trace |
17493 | 1450 "i" gnus-summary-import-article |
1451 "p" gnus-summary-article-posted-p) | |
1452 | |
1453 (gnus-define-keys (gnus-summary-save-map "O" gnus-summary-mode-map) | |
1454 "o" gnus-summary-save-article | |
1455 "m" gnus-summary-save-article-mail | |
1456 "F" gnus-summary-write-article-file | |
1457 "r" gnus-summary-save-article-rmail | |
1458 "f" gnus-summary-save-article-file | |
1459 "b" gnus-summary-save-article-body-file | |
1460 "h" gnus-summary-save-article-folder | |
1461 "v" gnus-summary-save-article-vm | |
1462 "p" gnus-summary-pipe-output | |
1463 "s" gnus-soup-add-article)) | |
1464 | |
1465 (defun gnus-summary-make-menu-bar () | |
1466 (gnus-turn-off-edit-menu 'summary) | |
1467 | |
1468 (unless (boundp 'gnus-summary-misc-menu) | |
1469 | |
1470 (easy-menu-define | |
1471 gnus-summary-kill-menu gnus-summary-mode-map "" | |
1472 (cons | |
1473 "Score" | |
1474 (nconc | |
1475 (list | |
1476 ["Enter score..." gnus-summary-score-entry t] | |
1477 ["Customize" gnus-score-customize t]) | |
1478 (gnus-make-score-map 'increase) | |
1479 (gnus-make-score-map 'lower) | |
1480 '(("Mark" | |
1481 ["Kill below" gnus-summary-kill-below t] | |
1482 ["Mark above" gnus-summary-mark-above t] | |
1483 ["Tick above" gnus-summary-tick-above t] | |
1484 ["Clear above" gnus-summary-clear-above t]) | |
1485 ["Current score" gnus-summary-current-score t] | |
1486 ["Set score" gnus-summary-set-score t] | |
1487 ["Switch current score file..." gnus-score-change-score-file t] | |
1488 ["Set mark below..." gnus-score-set-mark-below t] | |
1489 ["Set expunge below..." gnus-score-set-expunge-below t] | |
1490 ["Edit current score file" gnus-score-edit-current-scores t] | |
1491 ["Edit score file" gnus-score-edit-file t] | |
1492 ["Trace score" gnus-score-find-trace t] | |
1493 ["Find words" gnus-score-find-favourite-words t] | |
1494 ["Rescore buffer" gnus-summary-rescore t] | |
1495 ["Increase score..." gnus-summary-increase-score t] | |
1496 ["Lower score..." gnus-summary-lower-score t])))) | |
1497 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1498 ;; 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
|
1499 ;; 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
|
1500 (let ((innards |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1501 '(("Hide" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1502 ["All" gnus-article-hide t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1503 ["Headers" gnus-article-hide-headers t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1504 ["Signature" gnus-article-hide-signature t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1505 ["Citation" gnus-article-hide-citation t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1506 ["PGP" gnus-article-hide-pgp t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1507 ["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
|
1508 ("Highlight" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1509 ["All" gnus-article-highlight t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1510 ["Headers" gnus-article-highlight-headers t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1511 ["Signature" gnus-article-highlight-signature t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1512 ["Citation" gnus-article-highlight-citation t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1513 ("Date" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1514 ["Local" gnus-article-date-local t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1515 ["ISO8601" gnus-article-date-iso8601 t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1516 ["UT" gnus-article-date-ut t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1517 ["Original" gnus-article-date-original t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1518 ["Lapsed" gnus-article-date-lapsed t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1519 ["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
|
1520 ("Washing" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1521 ("Remove Blanks" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1522 ["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
|
1523 ["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
|
1524 ["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
|
1525 ["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
|
1526 ["All" gnus-article-strip-all-blank-lines t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1527 ["Leading space" gnus-article-strip-leading-space t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1528 ["Overstrike" gnus-article-treat-overstrike t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1529 ["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
|
1530 ["Emphasis" gnus-article-emphasize t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1531 ["Word wrap" gnus-article-fill-cited-article t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1532 ["CR" gnus-article-remove-cr t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1533 ["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
|
1534 ["Quoted-Printable" gnus-article-de-quoted-unreadable t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1535 ["UnHTMLize" gnus-article-treat-html t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1536 ["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
|
1537 ["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
|
1538 ["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
|
1539 ["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
|
1540 ["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
|
1541 ["Toggle MIME" gnus-summary-toggle-mime t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1542 ["Verbose header" gnus-summary-verbose-headers t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1543 ["Toggle header" gnus-summary-toggle-header t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1544 ("Output" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1545 ["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
|
1546 ["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
|
1547 ["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
|
1548 ["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
|
1549 ["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
|
1550 ["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
|
1551 ["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
|
1552 ["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
|
1553 ["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
|
1554 ["Print" gnus-summary-print-article t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1555 ("Backend" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1556 ["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
|
1557 ["Move article..." gnus-summary-move-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1558 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1559 'request-move-article gnus-newsgroup-name)] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1560 ["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
|
1561 ["Crosspost article..." gnus-summary-crosspost-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1562 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1563 'request-replace-article gnus-newsgroup-name)] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1564 ["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
|
1565 ["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
|
1566 ["Edit article" gnus-summary-edit-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1567 (not (gnus-group-read-only-p))] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1568 ["Delete article" gnus-summary-delete-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1569 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1570 'request-expire-articles gnus-newsgroup-name)] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1571 ["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
|
1572 ["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
|
1573 ["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
|
1574 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1575 'request-expire-articles gnus-newsgroup-name)]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1576 ("Extract" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1577 ["Uudecode" gnus-uu-decode-uu t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1578 ["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
|
1579 ["Unshar" gnus-uu-decode-unshar t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1580 ["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
|
1581 ["Save" gnus-uu-decode-save t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1582 ["Binhex" gnus-uu-decode-binhex t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1583 ["Postscript" gnus-uu-decode-postscript t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1584 ("Cache" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1585 ["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
|
1586 ["Remove article" gnus-cache-remove-article t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1587 ["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
|
1588 ["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
|
1589 ["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
|
1590 ["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
|
1591 ["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
|
1592 ["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
|
1593 ["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
|
1594 ["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
|
1595 ["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
|
1596 ["Redisplay" gnus-summary-show-article t]))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1597 (easy-menu-define |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1598 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
|
1599 (cons "Article" innards)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1600 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1601 (easy-menu-define |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1602 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
|
1603 (cons "Commands" innards))) |
17493 | 1604 |
1605 (easy-menu-define | |
1606 gnus-summary-thread-menu gnus-summary-mode-map "" | |
1607 '("Threads" | |
1608 ["Toggle threading" gnus-summary-toggle-threads t] | |
1609 ["Hide threads" gnus-summary-hide-all-threads t] | |
1610 ["Show threads" gnus-summary-show-all-threads t] | |
1611 ["Hide thread" gnus-summary-hide-thread t] | |
1612 ["Show thread" gnus-summary-show-thread t] | |
1613 ["Go to next thread" gnus-summary-next-thread t] | |
1614 ["Go to previous thread" gnus-summary-prev-thread t] | |
1615 ["Go down thread" gnus-summary-down-thread t] | |
1616 ["Go up thread" gnus-summary-up-thread t] | |
1617 ["Top of thread" gnus-summary-top-thread t] | |
1618 ["Mark thread as read" gnus-summary-kill-thread t] | |
1619 ["Lower thread score" gnus-summary-lower-thread t] | |
1620 ["Raise thread score" gnus-summary-raise-thread t] | |
1621 ["Rethread current" gnus-summary-rethread-current t] | |
1622 )) | |
1623 | |
1624 (easy-menu-define | |
1625 gnus-summary-post-menu gnus-summary-mode-map "" | |
1626 '("Post" | |
1627 ["Post an article" gnus-summary-post-news t] | |
1628 ["Followup" gnus-summary-followup t] | |
1629 ["Followup and yank" gnus-summary-followup-with-original t] | |
1630 ["Supersede article" gnus-summary-supersede-article t] | |
1631 ["Cancel article" gnus-summary-cancel-article t] | |
1632 ["Reply" gnus-summary-reply t] | |
1633 ["Reply and yank" gnus-summary-reply-with-original t] | |
1634 ["Wide reply" gnus-summary-wide-reply t] | |
1635 ["Wide reply and yank" gnus-summary-wide-reply-with-original t] | |
1636 ["Mail forward" gnus-summary-mail-forward t] | |
1637 ["Post forward" gnus-summary-post-forward t] | |
1638 ["Digest and mail" gnus-uu-digest-mail-forward t] | |
1639 ["Digest and post" gnus-uu-digest-post-forward t] | |
1640 ["Resend message" gnus-summary-resend-message t] | |
1641 ["Send bounced mail" gnus-summary-resend-bounced-mail t] | |
1642 ["Send a mail" gnus-summary-mail-other-window t] | |
1643 ["Uuencode and post" gnus-uu-post-news t] | |
1644 ["Followup via news" gnus-summary-followup-to-mail t] | |
1645 ["Followup via news and yank" | |
1646 gnus-summary-followup-to-mail-with-original t] | |
1647 ;;("Draft" | |
1648 ;;["Send" gnus-summary-send-draft t] | |
1649 ;;["Send bounced" gnus-resend-bounced-mail t]) | |
1650 )) | |
1651 | |
1652 (easy-menu-define | |
1653 gnus-summary-misc-menu gnus-summary-mode-map "" | |
1654 '("Misc" | |
1655 ("Mark Read" | |
1656 ["Mark as read" gnus-summary-mark-as-read-forward t] | |
1657 ["Mark same subject and select" | |
1658 gnus-summary-kill-same-subject-and-select t] | |
1659 ["Mark same subject" gnus-summary-kill-same-subject t] | |
1660 ["Catchup" gnus-summary-catchup t] | |
1661 ["Catchup all" gnus-summary-catchup-all t] | |
1662 ["Catchup to here" gnus-summary-catchup-to-here t] | |
1663 ["Catchup region" gnus-summary-mark-region-as-read t] | |
1664 ["Mark excluded" gnus-summary-limit-mark-excluded-as-read t]) | |
1665 ("Mark Various" | |
1666 ["Tick" gnus-summary-tick-article-forward t] | |
1667 ["Mark as dormant" gnus-summary-mark-as-dormant t] | |
1668 ["Remove marks" gnus-summary-clear-mark-forward t] | |
1669 ["Set expirable mark" gnus-summary-mark-as-expirable t] | |
1670 ["Set bookmark" gnus-summary-set-bookmark t] | |
1671 ["Remove bookmark" gnus-summary-remove-bookmark t]) | |
1672 ("Mark Limit" | |
1673 ["Marks..." gnus-summary-limit-to-marks t] | |
1674 ["Subject..." gnus-summary-limit-to-subject t] | |
1675 ["Author..." gnus-summary-limit-to-author t] | |
1676 ["Age..." gnus-summary-limit-to-age t] | |
1677 ["Score" gnus-summary-limit-to-score t] | |
1678 ["Unread" gnus-summary-limit-to-unread t] | |
1679 ["Non-dormant" gnus-summary-limit-exclude-dormant t] | |
1680 ["Articles" gnus-summary-limit-to-articles t] | |
1681 ["Pop limit" gnus-summary-pop-limit t] | |
1682 ["Show dormant" gnus-summary-limit-include-dormant t] | |
1683 ["Hide childless dormant" | |
1684 gnus-summary-limit-exclude-childless-dormant t] | |
1685 ;;["Hide thread" gnus-summary-limit-exclude-thread t] | |
1686 ["Show expunged" gnus-summary-show-all-expunged t]) | |
1687 ("Process Mark" | |
1688 ["Set mark" gnus-summary-mark-as-processable t] | |
1689 ["Remove mark" gnus-summary-unmark-as-processable t] | |
1690 ["Remove all marks" gnus-summary-unmark-all-processable t] | |
1691 ["Mark above" gnus-uu-mark-over t] | |
1692 ["Mark series" gnus-uu-mark-series t] | |
1693 ["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
|
1694 ["Unmark region" gnus-uu-unmark-region t] |
17493 | 1695 ["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
|
1696 ["Unmark by regexp..." gnus-uu-unmark-by-regexp t] |
17493 | 1697 ["Mark all" gnus-uu-mark-all t] |
1698 ["Mark buffer" gnus-uu-mark-buffer t] | |
1699 ["Mark sparse" gnus-uu-mark-sparse t] | |
1700 ["Mark thread" gnus-uu-mark-thread t] | |
1701 ["Unmark thread" gnus-uu-unmark-thread t] | |
1702 ("Process Mark Sets" | |
1703 ["Kill" gnus-summary-kill-process-mark t] | |
1704 ["Yank" gnus-summary-yank-process-mark | |
1705 gnus-newsgroup-process-stack] | |
1706 ["Save" gnus-summary-save-process-mark t])) | |
1707 ("Scroll article" | |
1708 ["Page forward" gnus-summary-next-page t] | |
1709 ["Page backward" gnus-summary-prev-page t] | |
1710 ["Line forward" gnus-summary-scroll-up t]) | |
1711 ("Move" | |
1712 ["Next unread article" gnus-summary-next-unread-article t] | |
1713 ["Previous unread article" gnus-summary-prev-unread-article t] | |
1714 ["Next article" gnus-summary-next-article t] | |
1715 ["Previous article" gnus-summary-prev-article t] | |
1716 ["Next unread subject" gnus-summary-next-unread-subject t] | |
1717 ["Previous unread subject" gnus-summary-prev-unread-subject t] | |
1718 ["Next article same subject" gnus-summary-next-same-subject t] | |
1719 ["Previous article same subject" gnus-summary-prev-same-subject t] | |
1720 ["First unread article" gnus-summary-first-unread-article t] | |
1721 ["Best unread article" gnus-summary-best-unread-article t] | |
1722 ["Go to subject number..." gnus-summary-goto-subject t] | |
1723 ["Go to article number..." gnus-summary-goto-article t] | |
1724 ["Go to the last article" gnus-summary-goto-last-article t] | |
1725 ["Pop article off history" gnus-summary-pop-article t]) | |
1726 ("Sort" | |
1727 ["Sort by number" gnus-summary-sort-by-number t] | |
1728 ["Sort by author" gnus-summary-sort-by-author t] | |
1729 ["Sort by subject" gnus-summary-sort-by-subject t] | |
1730 ["Sort by date" gnus-summary-sort-by-date t] | |
1731 ["Sort by score" gnus-summary-sort-by-score t] | |
1732 ["Sort by lines" gnus-summary-sort-by-lines t]) | |
1733 ("Help" | |
1734 ["Fetch group FAQ" gnus-summary-fetch-faq t] | |
1735 ["Describe group" gnus-summary-describe-group t] | |
1736 ["Read manual" gnus-info-find-node t]) | |
1737 ("Modes" | |
1738 ["Pick and read" gnus-pick-mode t] | |
1739 ["Binary" gnus-binary-mode t]) | |
1740 ("Regeneration" | |
1741 ["Regenerate" gnus-summary-prepare t] | |
1742 ["Insert cached articles" gnus-summary-insert-cached-articles t] | |
1743 ["Toggle threading" gnus-summary-toggle-threads t]) | |
1744 ["Filter articles..." gnus-summary-execute-command t] | |
1745 ["Run command on subjects..." gnus-summary-universal-argument t] | |
1746 ["Search articles forward..." gnus-summary-search-article-forward t] | |
1747 ["Search articles backward..." gnus-summary-search-article-backward t] | |
1748 ["Toggle line truncation" gnus-summary-toggle-truncation t] | |
1749 ["Expand window" gnus-summary-expand-window t] | |
1750 ["Expire expirable articles" gnus-summary-expire-articles | |
1751 (gnus-check-backend-function | |
1752 'request-expire-articles gnus-newsgroup-name)] | |
1753 ["Edit local kill file" gnus-summary-edit-local-kill t] | |
1754 ["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
|
1755 ["Edit group parameters" gnus-summary-edit-parameters t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1756 ["Send a bug report" gnus-bug t] |
17493 | 1757 ("Exit" |
1758 ["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
|
1759 ["Catchup all and exit" gnus-summary-catchup-all-and-exit t] |
17493 | 1760 ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t] |
1761 ["Exit group" gnus-summary-exit t] | |
1762 ["Exit group without updating" gnus-summary-exit-no-update t] | |
1763 ["Exit and goto next group" gnus-summary-next-group t] | |
1764 ["Exit and goto prev group" gnus-summary-prev-group t] | |
1765 ["Reselect group" gnus-summary-reselect-current-group t] | |
1766 ["Rescan group" gnus-summary-rescan-group t] | |
1767 ["Update dribble" gnus-summary-save-newsrc t]))) | |
1768 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1769 (gnus-run-hooks 'gnus-summary-menu-hook))) |
17493 | 1770 |
1771 (defun gnus-score-set-default (var value) | |
1772 "A version of set that updates the GNU Emacs menu-bar." | |
1773 (set var value) | |
1774 ;; It is the message that forces the active status to be updated. | |
1775 (message "")) | |
1776 | |
1777 (defun gnus-make-score-map (type) | |
1778 "Make a summary score map of type TYPE." | |
1779 (if t | |
1780 nil | |
1781 (let ((headers '(("author" "from" string) | |
1782 ("subject" "subject" string) | |
1783 ("article body" "body" string) | |
1784 ("article head" "head" string) | |
1785 ("xref" "xref" string) | |
1786 ("lines" "lines" number) | |
1787 ("followups to author" "followup" string))) | |
1788 (types '((number ("less than" <) | |
1789 ("greater than" >) | |
1790 ("equal" =)) | |
1791 (string ("substring" s) | |
1792 ("exact string" e) | |
1793 ("fuzzy string" f) | |
1794 ("regexp" r)))) | |
1795 (perms '(("temporary" (current-time-string)) | |
1796 ("permanent" nil) | |
1797 ("immediate" now))) | |
1798 header) | |
1799 (list | |
1800 (apply | |
1801 'nconc | |
1802 (list | |
1803 (if (eq type 'lower) | |
1804 "Lower score" | |
1805 "Increase score")) | |
1806 (let (outh) | |
1807 (while headers | |
1808 (setq header (car headers)) | |
1809 (setq outh | |
1810 (cons | |
1811 (apply | |
1812 'nconc | |
1813 (list (car header)) | |
1814 (let ((ts (cdr (assoc (nth 2 header) types))) | |
1815 outt) | |
1816 (while ts | |
1817 (setq outt | |
1818 (cons | |
1819 (apply | |
1820 'nconc | |
1821 (list (caar ts)) | |
1822 (let ((ps perms) | |
1823 outp) | |
1824 (while ps | |
1825 (setq outp | |
1826 (cons | |
1827 (vector | |
1828 (caar ps) | |
1829 (list | |
1830 'gnus-summary-score-entry | |
1831 (nth 1 header) | |
1832 (if (or (string= (nth 1 header) | |
1833 "head") | |
1834 (string= (nth 1 header) | |
1835 "body")) | |
1836 "" | |
1837 (list 'gnus-summary-header | |
1838 (nth 1 header))) | |
1839 (list 'quote (nth 1 (car ts))) | |
1840 (list 'gnus-score-default nil) | |
1841 (nth 1 (car ps)) | |
1842 t) | |
1843 t) | |
1844 outp)) | |
1845 (setq ps (cdr ps))) | |
1846 (list (nreverse outp)))) | |
1847 outt)) | |
1848 (setq ts (cdr ts))) | |
1849 (list (nreverse outt)))) | |
1850 outh)) | |
1851 (setq headers (cdr headers))) | |
1852 (list (nreverse outh)))))))) | |
1853 | |
1854 | |
1855 | |
1856 (defun gnus-summary-mode (&optional group) | |
1857 "Major mode for reading articles. | |
1858 | |
1859 All normal editing commands are switched off. | |
1860 \\<gnus-summary-mode-map> | |
1861 Each line in this buffer represents one article. To read an | |
1862 article, you can, for instance, type `\\[gnus-summary-next-page]'. To move forwards | |
1863 and backwards while displaying articles, type `\\[gnus-summary-next-unread-article]' and `\\[gnus-summary-prev-unread-article]', | |
1864 respectively. | |
1865 | |
1866 You can also post articles and send mail from this buffer. To | |
1867 follow up an article, type `\\[gnus-summary-followup]'. To mail a reply to the author | |
1868 of an article, type `\\[gnus-summary-reply]'. | |
1869 | |
1870 There are approx. one gazillion commands you can execute in this | |
1871 buffer; read the info pages for more information (`\\[gnus-info-find-node]'). | |
1872 | |
1873 The following commands are available: | |
1874 | |
1875 \\{gnus-summary-mode-map}" | |
1876 (interactive) | |
1877 (when (gnus-visual-p 'summary-menu 'menu) | |
1878 (gnus-summary-make-menu-bar)) | |
1879 (kill-all-local-variables) | |
1880 (gnus-summary-make-local-variables) | |
1881 (gnus-make-thread-indent-array) | |
1882 (gnus-simplify-mode-line) | |
1883 (setq major-mode 'gnus-summary-mode) | |
1884 (setq mode-name "Summary") | |
1885 (make-local-variable 'minor-mode-alist) | |
1886 (use-local-map gnus-summary-mode-map) | |
1887 (buffer-disable-undo (current-buffer)) | |
1888 (setq buffer-read-only t) ;Disable modification | |
1889 (setq truncate-lines t) | |
1890 (setq selective-display t) | |
1891 (setq selective-display-ellipses t) ;Display `...' | |
1892 (gnus-summary-set-display-table) | |
1893 (gnus-set-default-directory) | |
1894 (setq gnus-newsgroup-name group) | |
1895 (make-local-variable 'gnus-summary-line-format) | |
1896 (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
|
1897 (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
|
1898 (make-local-variable 'gnus-summary-dummy-line-format-spec) |
17493 | 1899 (make-local-variable 'gnus-summary-mark-positions) |
1900 (make-local-hook 'post-command-hook) | |
1901 (add-hook 'post-command-hook 'gnus-clear-inboxes-moved nil t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1902 (make-local-hook 'pre-command-hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1903 (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
|
1904 (gnus-run-hooks 'gnus-summary-mode-hook) |
17493 | 1905 (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy) |
1906 (gnus-update-summary-mark-positions)) | |
1907 | |
1908 (defun gnus-summary-make-local-variables () | |
1909 "Make all the local summary buffer variables." | |
1910 (let ((locals gnus-summary-local-variables) | |
1911 global local) | |
1912 (while (setq local (pop locals)) | |
1913 (if (consp local) | |
1914 (progn | |
1915 (if (eq (cdr local) 'global) | |
1916 ;; Copy the global value of the variable. | |
1917 (setq global (symbol-value (car local))) | |
1918 ;; Use the value from the list. | |
1919 (setq global (eval (cdr local)))) | |
1920 (make-local-variable (car local)) | |
1921 (set (car local) global)) | |
1922 ;; Simple nil-valued local variable. | |
1923 (make-local-variable local) | |
1924 (set local nil))))) | |
1925 | |
1926 (defun gnus-summary-clear-local-variables () | |
1927 (let ((locals gnus-summary-local-variables)) | |
1928 (while locals | |
1929 (if (consp (car locals)) | |
1930 (and (vectorp (caar locals)) | |
1931 (set (caar locals) nil)) | |
1932 (and (vectorp (car locals)) | |
1933 (set (car locals) nil))) | |
1934 (setq locals (cdr locals))))) | |
1935 | |
1936 ;; Summary data functions. | |
1937 | |
1938 (defmacro gnus-data-number (data) | |
1939 `(car ,data)) | |
1940 | |
1941 (defmacro gnus-data-set-number (data number) | |
1942 `(setcar ,data ,number)) | |
1943 | |
1944 (defmacro gnus-data-mark (data) | |
1945 `(nth 1 ,data)) | |
1946 | |
1947 (defmacro gnus-data-set-mark (data mark) | |
1948 `(setcar (nthcdr 1 ,data) ,mark)) | |
1949 | |
1950 (defmacro gnus-data-pos (data) | |
1951 `(nth 2 ,data)) | |
1952 | |
1953 (defmacro gnus-data-set-pos (data pos) | |
1954 `(setcar (nthcdr 2 ,data) ,pos)) | |
1955 | |
1956 (defmacro gnus-data-header (data) | |
1957 `(nth 3 ,data)) | |
1958 | |
1959 (defmacro gnus-data-set-header (data header) | |
1960 `(setf (nth 3 ,data) ,header)) | |
1961 | |
1962 (defmacro gnus-data-level (data) | |
1963 `(nth 4 ,data)) | |
1964 | |
1965 (defmacro gnus-data-unread-p (data) | |
1966 `(= (nth 1 ,data) gnus-unread-mark)) | |
1967 | |
1968 (defmacro gnus-data-read-p (data) | |
1969 `(/= (nth 1 ,data) gnus-unread-mark)) | |
1970 | |
1971 (defmacro gnus-data-pseudo-p (data) | |
1972 `(consp (nth 3 ,data))) | |
1973 | |
1974 (defmacro gnus-data-find (number) | |
1975 `(assq ,number gnus-newsgroup-data)) | |
1976 | |
1977 (defmacro gnus-data-find-list (number &optional data) | |
1978 `(let ((bdata ,(or data 'gnus-newsgroup-data))) | |
1979 (memq (assq ,number bdata) | |
1980 bdata))) | |
1981 | |
1982 (defmacro gnus-data-make (number mark pos header level) | |
1983 `(list ,number ,mark ,pos ,header ,level)) | |
1984 | |
1985 (defun gnus-data-enter (after-article number mark pos header level offset) | |
1986 (let ((data (gnus-data-find-list after-article))) | |
1987 (unless data | |
1988 (error "No such article: %d" after-article)) | |
1989 (setcdr data (cons (gnus-data-make number mark pos header level) | |
1990 (cdr data))) | |
1991 (setq gnus-newsgroup-data-reverse nil) | |
1992 (gnus-data-update-list (cddr data) offset))) | |
1993 | |
1994 (defun gnus-data-enter-list (after-article list &optional offset) | |
1995 (when list | |
1996 (let ((data (and after-article (gnus-data-find-list after-article))) | |
1997 (ilist list)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1998 (if (not (or data |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1999 after-article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2000 (let ((odata gnus-newsgroup-data)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2001 (setq gnus-newsgroup-data (nconc list gnus-newsgroup-data)) |
17493 | 2002 (when offset |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2003 (gnus-data-update-list odata offset))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2004 ;; 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
|
2005 ;; list. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2006 (while (cdr list) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2007 (setq list (cdr list))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2008 (if (not data) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2009 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2010 (setcdr list gnus-newsgroup-data) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2011 (setq gnus-newsgroup-data ilist) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2012 (when offset |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2013 (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
|
2014 (setcdr list (cdr data)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2015 (setcdr data ilist) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2016 (when offset |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2017 (gnus-data-update-list (cdr list) offset)))) |
17493 | 2018 (setq gnus-newsgroup-data-reverse nil)))) |
2019 | |
2020 (defun gnus-data-remove (article &optional offset) | |
2021 (let ((data gnus-newsgroup-data)) | |
2022 (if (= (gnus-data-number (car data)) article) | |
2023 (progn | |
2024 (setq gnus-newsgroup-data (cdr gnus-newsgroup-data) | |
2025 gnus-newsgroup-data-reverse nil) | |
2026 (when offset | |
2027 (gnus-data-update-list gnus-newsgroup-data offset))) | |
2028 (while (cdr data) | |
2029 (when (= (gnus-data-number (cadr data)) article) | |
2030 (setcdr data (cddr data)) | |
2031 (when offset | |
2032 (gnus-data-update-list (cdr data) offset)) | |
2033 (setq data nil | |
2034 gnus-newsgroup-data-reverse nil)) | |
2035 (setq data (cdr data)))))) | |
2036 | |
2037 (defmacro gnus-data-list (backward) | |
2038 `(if ,backward | |
2039 (or gnus-newsgroup-data-reverse | |
2040 (setq gnus-newsgroup-data-reverse | |
2041 (reverse gnus-newsgroup-data))) | |
2042 gnus-newsgroup-data)) | |
2043 | |
2044 (defun gnus-data-update-list (data offset) | |
2045 "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
|
2046 (setq gnus-newsgroup-data-reverse nil) |
17493 | 2047 (while data |
2048 (setcar (nthcdr 2 (car data)) (+ offset (nth 2 (car data)))) | |
2049 (setq data (cdr data)))) | |
2050 | |
2051 (defun gnus-data-compute-positions () | |
2052 "Compute the positions of all articles." | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2053 (setq gnus-newsgroup-data-reverse nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2054 (let ((data gnus-newsgroup-data)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2055 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2056 (gnus-save-hidden-threads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2057 (gnus-summary-show-all-threads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2058 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2059 (while data |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2060 (while (get-text-property (point) 'gnus-intangible) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2061 (forward-line 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2062 (gnus-data-set-pos (car data) (+ (point) 3)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2063 (setq data (cdr data)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2064 (forward-line 1)))))) |
17493 | 2065 |
2066 (defun gnus-summary-article-pseudo-p (article) | |
2067 "Say whether this article is a pseudo article or not." | |
2068 (not (vectorp (gnus-data-header (gnus-data-find article))))) | |
2069 | |
2070 (defmacro gnus-summary-article-sparse-p (article) | |
2071 "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
|
2072 `(memq ,article gnus-newsgroup-sparse)) |
17493 | 2073 |
2074 (defmacro gnus-summary-article-ancient-p (article) | |
2075 "Say whether this article is a sparse article or not." | |
2076 `(memq ,article gnus-newsgroup-ancient)) | |
2077 | |
2078 (defun gnus-article-parent-p (number) | |
2079 "Say whether this article is a parent or not." | |
2080 (let ((data (gnus-data-find-list number))) | |
2081 (and (cdr data) ; There has to be an article after... | |
2082 (< (gnus-data-level (car data)) ; And it has to have a higher level. | |
2083 (gnus-data-level (nth 1 data)))))) | |
2084 | |
2085 (defun gnus-article-children (number) | |
2086 "Return a list of all children to NUMBER." | |
2087 (let* ((data (gnus-data-find-list number)) | |
2088 (level (gnus-data-level (car data))) | |
2089 children) | |
2090 (setq data (cdr data)) | |
2091 (while (and data | |
2092 (= (gnus-data-level (car data)) (1+ level))) | |
2093 (push (gnus-data-number (car data)) children) | |
2094 (setq data (cdr data))) | |
2095 children)) | |
2096 | |
2097 (defmacro gnus-summary-skip-intangible () | |
2098 "If the current article is intangible, then jump to a different article." | |
2099 '(let ((to (get-text-property (point) 'gnus-intangible))) | |
2100 (and to (gnus-summary-goto-subject to)))) | |
2101 | |
2102 (defmacro gnus-summary-article-intangible-p () | |
2103 "Say whether this article is intangible or not." | |
2104 '(get-text-property (point) 'gnus-intangible)) | |
2105 | |
2106 (defun gnus-article-read-p (article) | |
2107 "Say whether ARTICLE is read or not." | |
2108 (not (or (memq article gnus-newsgroup-marked) | |
2109 (memq article gnus-newsgroup-unreads) | |
2110 (memq article gnus-newsgroup-unselected) | |
2111 (memq article gnus-newsgroup-dormant)))) | |
2112 | |
2113 ;; Some summary mode macros. | |
2114 | |
2115 (defmacro gnus-summary-article-number () | |
2116 "The article number of the article on the current line. | |
2117 If there isn's an article number here, then we return the current | |
2118 article number." | |
2119 '(progn | |
2120 (gnus-summary-skip-intangible) | |
2121 (or (get-text-property (point) 'gnus-number) | |
2122 (gnus-summary-last-subject)))) | |
2123 | |
2124 (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
|
2125 "Return the header of article NUMBER." |
17493 | 2126 `(gnus-data-header (gnus-data-find |
2127 ,(or number '(gnus-summary-article-number))))) | |
2128 | |
2129 (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
|
2130 "Return the level of thread that starts with article NUMBER." |
17493 | 2131 `(if (and (eq gnus-summary-make-false-root 'dummy) |
2132 (get-text-property (point) 'gnus-intangible)) | |
2133 0 | |
2134 (gnus-data-level (gnus-data-find | |
2135 ,(or number '(gnus-summary-article-number)))))) | |
2136 | |
2137 (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
|
2138 "Return the mark of article NUMBER." |
17493 | 2139 `(gnus-data-mark (gnus-data-find |
2140 ,(or number '(gnus-summary-article-number))))) | |
2141 | |
2142 (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
|
2143 "Return the position of the line of article NUMBER." |
17493 | 2144 `(gnus-data-pos (gnus-data-find |
2145 ,(or number '(gnus-summary-article-number))))) | |
2146 | |
2147 (defalias 'gnus-summary-subject-string 'gnus-summary-article-subject) | |
2148 (defmacro gnus-summary-article-subject (&optional number) | |
2149 "Return current subject string or nil if nothing." | |
2150 `(let ((headers | |
2151 ,(if number | |
2152 `(gnus-data-header (assq ,number gnus-newsgroup-data)) | |
2153 '(gnus-data-header (assq (gnus-summary-article-number) | |
2154 gnus-newsgroup-data))))) | |
2155 (and headers | |
2156 (vectorp headers) | |
2157 (mail-header-subject headers)))) | |
2158 | |
2159 (defmacro gnus-summary-article-score (&optional number) | |
2160 "Return current article score." | |
2161 `(or (cdr (assq ,(or number '(gnus-summary-article-number)) | |
2162 gnus-newsgroup-scored)) | |
2163 gnus-summary-default-score 0)) | |
2164 | |
2165 (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
|
2166 "Return a list of article numbers that are children of article NUMBER." |
17493 | 2167 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number)))) |
2168 (level (gnus-data-level (car data))) | |
2169 l children) | |
2170 (while (and (setq data (cdr data)) | |
2171 (> (setq l (gnus-data-level (car data))) level)) | |
2172 (and (= (1+ level) l) | |
2173 (push (gnus-data-number (car data)) | |
2174 children))) | |
2175 (nreverse children))) | |
2176 | |
2177 (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
|
2178 "Return the article number of the parent of article NUMBER." |
17493 | 2179 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number)) |
2180 (gnus-data-list t))) | |
2181 (level (gnus-data-level (car data)))) | |
2182 (if (zerop level) | |
2183 () ; This is a root. | |
2184 ;; We search until we find an article with a level less than | |
2185 ;; this one. That function has to be the parent. | |
2186 (while (and (setq data (cdr data)) | |
2187 (not (< (gnus-data-level (car data)) level)))) | |
2188 (and data (gnus-data-number (car data)))))) | |
2189 | |
2190 (defun gnus-unread-mark-p (mark) | |
2191 "Say whether MARK is the unread mark." | |
2192 (= mark gnus-unread-mark)) | |
2193 | |
2194 (defun gnus-read-mark-p (mark) | |
2195 "Say whether MARK is one of the marks that mark as read. | |
2196 This is all marks except unread, ticked, dormant, and expirable." | |
2197 (not (or (= mark gnus-unread-mark) | |
2198 (= mark gnus-ticked-mark) | |
2199 (= mark gnus-dormant-mark) | |
2200 (= mark gnus-expirable-mark)))) | |
2201 | |
2202 (defmacro gnus-article-mark (number) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2203 "Return the MARK of article NUMBER. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2204 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
|
2205 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
|
2206 `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
|
2207 marks of articles." |
17493 | 2208 `(cond |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2209 ((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
|
2210 ((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
|
2211 ((memq ,number gnus-newsgroup-downloadable) gnus-downloadable-mark) |
17493 | 2212 ((memq ,number gnus-newsgroup-unreads) gnus-unread-mark) |
2213 ((memq ,number gnus-newsgroup-marked) gnus-ticked-mark) | |
2214 ((memq ,number gnus-newsgroup-dormant) gnus-dormant-mark) | |
2215 ((memq ,number gnus-newsgroup-expirable) gnus-expirable-mark) | |
2216 (t (or (cdr (assq ,number gnus-newsgroup-reads)) | |
2217 gnus-ancient-mark)))) | |
2218 | |
2219 ;; Saving hidden threads. | |
2220 | |
2221 (put 'gnus-save-hidden-threads 'lisp-indent-function 0) | |
2222 (put 'gnus-save-hidden-threads 'edebug-form-spec '(body)) | |
2223 | |
2224 (defmacro gnus-save-hidden-threads (&rest forms) | |
2225 "Save hidden threads, eval FORMS, and restore the hidden threads." | |
2226 (let ((config (make-symbol "config"))) | |
2227 `(let ((,config (gnus-hidden-threads-configuration))) | |
2228 (unwind-protect | |
2229 (save-excursion | |
2230 ,@forms) | |
2231 (gnus-restore-hidden-threads-configuration ,config))))) | |
2232 | |
2233 (defun gnus-hidden-threads-configuration () | |
2234 "Return the current hidden threads configuration." | |
2235 (save-excursion | |
2236 (let (config) | |
2237 (goto-char (point-min)) | |
2238 (while (search-forward "\r" nil t) | |
2239 (push (1- (point)) config)) | |
2240 config))) | |
2241 | |
2242 (defun gnus-restore-hidden-threads-configuration (config) | |
2243 "Restore hidden threads configuration from CONFIG." | |
2244 (let (point buffer-read-only) | |
2245 (while (setq point (pop config)) | |
2246 (when (and (< point (point-max)) | |
2247 (goto-char point) | |
2248 (= (following-char) ?\n)) | |
2249 (subst-char-in-region point (1+ point) ?\n ?\r))))) | |
2250 | |
2251 ;; Various summary mode internalish functions. | |
2252 | |
2253 (defun gnus-mouse-pick-article (e) | |
2254 (interactive "e") | |
2255 (mouse-set-point e) | |
2256 (gnus-summary-next-page nil t)) | |
2257 | |
2258 (defun gnus-summary-set-display-table () | |
2259 ;; Change the display table. Odd characters have a tendency to mess | |
2260 ;; up nicely formatted displays - we make all possible glyphs | |
2261 ;; display only a single character. | |
2262 | |
2263 ;; We start from the standard display table, if any. | |
2264 (let ((table (or (copy-sequence standard-display-table) | |
2265 (make-display-table))) | |
2266 (i 32)) | |
2267 ;; Nix out all the control chars... | |
2268 (while (>= (setq i (1- i)) 0) | |
2269 (aset table i [??])) | |
2270 ;; ... but not newline and cr, of course. (cr is necessary for the | |
2271 ;; selective display). | |
2272 (aset table ?\n nil) | |
2273 (aset table ?\r nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2274 ;; We keep TAB as well. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2275 (aset table ?\t nil) |
17493 | 2276 ;; We nix out any glyphs over 126 that are not set already. |
2277 (let ((i 256)) | |
2278 (while (>= (setq i (1- i)) 127) | |
2279 ;; Only modify if the entry is nil. | |
2280 (unless (aref table i) | |
2281 (aset table i [??])))) | |
2282 (setq buffer-display-table table))) | |
2283 | |
2284 (defun gnus-summary-setup-buffer (group) | |
2285 "Initialize summary buffer." | |
2286 (let ((buffer (concat "*Summary " group "*"))) | |
2287 (if (get-buffer buffer) | |
2288 (progn | |
2289 (set-buffer buffer) | |
2290 (setq gnus-summary-buffer (current-buffer)) | |
2291 (not gnus-newsgroup-prepared)) | |
2292 ;; 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
|
2293 (setq gnus-summary-buffer (set-buffer (gnus-get-buffer-create buffer))) |
17493 | 2294 (gnus-summary-mode group) |
2295 (when gnus-carpal | |
2296 (gnus-carpal-setup-buffer 'summary)) | |
2297 (unless gnus-single-article-buffer | |
2298 (make-local-variable 'gnus-article-buffer) | |
2299 (make-local-variable 'gnus-article-current) | |
2300 (make-local-variable 'gnus-original-article-buffer)) | |
2301 (setq gnus-newsgroup-name group) | |
2302 t))) | |
2303 | |
2304 (defun gnus-set-global-variables () | |
2305 ;; Set the global equivalents of the summary buffer-local variables | |
2306 ;; to the latest values they had. These reflect the summary buffer | |
2307 ;; that was in action when the last article was fetched. | |
2308 (when (eq major-mode 'gnus-summary-mode) | |
2309 (setq gnus-summary-buffer (current-buffer)) | |
2310 (let ((name gnus-newsgroup-name) | |
2311 (marked gnus-newsgroup-marked) | |
2312 (unread gnus-newsgroup-unreads) | |
2313 (headers gnus-current-headers) | |
2314 (data gnus-newsgroup-data) | |
2315 (summary gnus-summary-buffer) | |
2316 (article-buffer gnus-article-buffer) | |
2317 (original gnus-original-article-buffer) | |
2318 (gac gnus-article-current) | |
2319 (reffed gnus-reffed-article-number) | |
2320 (score-file gnus-current-score-file)) | |
2321 (save-excursion | |
2322 (set-buffer gnus-group-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2323 (setq gnus-newsgroup-name name |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2324 gnus-newsgroup-marked marked |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2325 gnus-newsgroup-unreads unread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2326 gnus-current-headers headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2327 gnus-newsgroup-data data |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2328 gnus-article-current gac |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2329 gnus-summary-buffer summary |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2330 gnus-article-buffer article-buffer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2331 gnus-original-article-buffer original |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2332 gnus-reffed-article-number reffed |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2333 gnus-current-score-file score-file) |
17493 | 2334 ;; The article buffer also has local variables. |
2335 (when (gnus-buffer-live-p gnus-article-buffer) | |
2336 (set-buffer gnus-article-buffer) | |
2337 (setq gnus-summary-buffer summary)))))) | |
2338 | |
2339 (defun gnus-summary-article-unread-p (article) | |
2340 "Say whether ARTICLE is unread or not." | |
2341 (memq article gnus-newsgroup-unreads)) | |
2342 | |
2343 (defun gnus-summary-first-article-p (&optional article) | |
2344 "Return whether ARTICLE is the first article in the buffer." | |
2345 (if (not (setq article (or article (gnus-summary-article-number)))) | |
2346 nil | |
2347 (eq article (caar gnus-newsgroup-data)))) | |
2348 | |
2349 (defun gnus-summary-last-article-p (&optional article) | |
2350 "Return whether ARTICLE is the last article in the buffer." | |
2351 (if (not (setq article (or article (gnus-summary-article-number)))) | |
2352 t ; All non-existent numbers are the last article. :-) | |
2353 (not (cdr (gnus-data-find-list article))))) | |
2354 | |
2355 (defun gnus-make-thread-indent-array () | |
2356 (let ((n 200)) | |
2357 (unless (and gnus-thread-indent-array | |
2358 (= gnus-thread-indent-level gnus-thread-indent-array-level)) | |
2359 (setq gnus-thread-indent-array (make-vector 201 "") | |
2360 gnus-thread-indent-array-level gnus-thread-indent-level) | |
2361 (while (>= n 0) | |
2362 (aset gnus-thread-indent-array n | |
2363 (make-string (* n gnus-thread-indent-level) ? )) | |
2364 (setq n (1- n)))))) | |
2365 | |
2366 (defun gnus-update-summary-mark-positions () | |
2367 "Compute where the summary marks are to go." | |
2368 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2369 (when (gnus-buffer-exists-p gnus-summary-buffer) |
17493 | 2370 (set-buffer gnus-summary-buffer)) |
2371 (let ((gnus-replied-mark 129) | |
2372 (gnus-score-below-mark 130) | |
2373 (gnus-score-over-mark 130) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2374 (gnus-download-mark 131) |
17493 | 2375 (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
|
2376 gnus-visual pos) |
17493 | 2377 (save-excursion |
2378 (gnus-set-work-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2379 (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
|
2380 (gnus-newsgroup-downloadable '((0 . t)))) |
17493 | 2381 (gnus-summary-insert-line |
2382 [0 "" "" "" "" "" 0 0 ""] 0 nil 128 t nil "" nil 1) | |
2383 (goto-char (point-min)) | |
2384 (setq pos (list (cons 'unread (and (search-forward "\200" nil t) | |
2385 (- (point) 2))))) | |
2386 (goto-char (point-min)) | |
2387 (push (cons 'replied (and (search-forward "\201" nil t) | |
2388 (- (point) 2))) | |
2389 pos) | |
2390 (goto-char (point-min)) | |
2391 (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
|
2392 pos) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2393 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2394 (push (cons 'download |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2395 (and (search-forward "\203" nil t) (- (point) 2))) |
17493 | 2396 pos))) |
2397 (setq gnus-summary-mark-positions pos)))) | |
2398 | |
2399 (defun gnus-summary-insert-dummy-line (gnus-tmp-subject gnus-tmp-number) | |
2400 "Insert a dummy root in the summary buffer." | |
2401 (beginning-of-line) | |
2402 (gnus-add-text-properties | |
2403 (point) (progn (eval gnus-summary-dummy-line-format-spec) (point)) | |
2404 (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number))) | |
2405 | |
2406 (defun gnus-summary-insert-line (gnus-tmp-header | |
2407 gnus-tmp-level gnus-tmp-current | |
2408 gnus-tmp-unread gnus-tmp-replied | |
2409 gnus-tmp-expirable gnus-tmp-subject-or-nil | |
2410 &optional gnus-tmp-dummy gnus-tmp-score | |
2411 gnus-tmp-process) | |
2412 (let* ((gnus-tmp-indentation (aref gnus-thread-indent-array gnus-tmp-level)) | |
2413 (gnus-tmp-lines (mail-header-lines gnus-tmp-header)) | |
2414 (gnus-tmp-score (or gnus-tmp-score gnus-summary-default-score 0)) | |
2415 (gnus-tmp-score-char | |
2416 (if (or (null gnus-summary-default-score) | |
2417 (<= (abs (- gnus-tmp-score gnus-summary-default-score)) | |
2418 gnus-summary-zcore-fuzz)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2419 ? ;space |
17493 | 2420 (if (< gnus-tmp-score gnus-summary-default-score) |
2421 gnus-score-below-mark gnus-score-over-mark))) | |
2422 (gnus-tmp-replied | |
2423 (cond (gnus-tmp-process gnus-process-mark) | |
2424 ((memq gnus-tmp-current gnus-newsgroup-cached) | |
2425 gnus-cached-mark) | |
2426 (gnus-tmp-replied gnus-replied-mark) | |
2427 ((memq gnus-tmp-current gnus-newsgroup-saved) | |
2428 gnus-saved-mark) | |
2429 (t gnus-unread-mark))) | |
2430 (gnus-tmp-from (mail-header-from gnus-tmp-header)) | |
2431 (gnus-tmp-name | |
2432 (cond | |
2433 ((string-match "<[^>]+> *$" gnus-tmp-from) | |
2434 (let ((beg (match-beginning 0))) | |
2435 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from) | |
2436 (substring gnus-tmp-from (1+ (match-beginning 0)) | |
2437 (1- (match-end 0)))) | |
2438 (substring gnus-tmp-from 0 beg)))) | |
2439 ((string-match "(.+)" gnus-tmp-from) | |
2440 (substring gnus-tmp-from | |
2441 (1+ (match-beginning 0)) (1- (match-end 0)))) | |
2442 (t gnus-tmp-from))) | |
2443 (gnus-tmp-subject (mail-header-subject gnus-tmp-header)) | |
2444 (gnus-tmp-number (mail-header-number gnus-tmp-header)) | |
2445 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[)) | |
2446 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\])) | |
2447 (buffer-read-only nil)) | |
2448 (when (string= gnus-tmp-name "") | |
2449 (setq gnus-tmp-name gnus-tmp-from)) | |
2450 (unless (numberp gnus-tmp-lines) | |
2451 (setq gnus-tmp-lines 0)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2452 (gnus-put-text-property-excluding-characters-with-faces |
17493 | 2453 (point) |
2454 (progn (eval gnus-summary-line-format-spec) (point)) | |
2455 'gnus-number gnus-tmp-number) | |
2456 (when (gnus-visual-p 'summary-highlight 'highlight) | |
2457 (forward-line -1) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2458 (gnus-run-hooks 'gnus-summary-update-hook) |
17493 | 2459 (forward-line 1)))) |
2460 | |
2461 (defun gnus-summary-update-line (&optional dont-update) | |
2462 ;; Update summary line after change. | |
2463 (when (and gnus-summary-default-score | |
2464 (not gnus-summary-inhibit-highlight)) | |
2465 (let* ((gnus-summary-inhibit-highlight t) ; Prevent recursion. | |
2466 (article (gnus-summary-article-number)) | |
2467 (score (gnus-summary-article-score article))) | |
2468 (unless dont-update | |
2469 (if (and gnus-summary-mark-below | |
2470 (< (gnus-summary-article-score) | |
2471 gnus-summary-mark-below)) | |
2472 ;; This article has a low score, so we mark it as read. | |
2473 (when (memq article gnus-newsgroup-unreads) | |
2474 (gnus-summary-mark-article-as-read gnus-low-score-mark)) | |
2475 (when (eq (gnus-summary-article-mark) gnus-low-score-mark) | |
2476 ;; This article was previously marked as read on account | |
2477 ;; of a low score, but now it has risen, so we mark it as | |
2478 ;; unread. | |
2479 (gnus-summary-mark-article-as-unread gnus-unread-mark))) | |
2480 (gnus-summary-update-mark | |
2481 (if (or (null gnus-summary-default-score) | |
2482 (<= (abs (- score gnus-summary-default-score)) | |
2483 gnus-summary-zcore-fuzz)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2484 ? ;space |
17493 | 2485 (if (< score gnus-summary-default-score) |
2486 gnus-score-below-mark gnus-score-over-mark)) | |
2487 'score)) | |
2488 ;; Do visual highlighting. | |
2489 (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
|
2490 (gnus-run-hooks 'gnus-summary-update-hook))))) |
17493 | 2491 |
2492 (defvar gnus-tmp-new-adopts nil) | |
2493 | |
2494 (defun gnus-summary-number-of-articles-in-thread (thread &optional level char) | |
2495 "Return the number of articles in THREAD. | |
2496 This may be 0 in some cases -- if none of the articles in | |
2497 the thread are to be displayed." | |
2498 (let* ((number | |
2499 ;; Fix by Luc Van Eycken <Luc.VanEycken@esat.kuleuven.ac.be>. | |
2500 (cond | |
2501 ((not (listp thread)) | |
2502 1) | |
2503 ((and (consp thread) (cdr thread)) | |
2504 (apply | |
2505 '+ 1 (mapcar | |
2506 'gnus-summary-number-of-articles-in-thread (cdr thread)))) | |
2507 ((null thread) | |
2508 1) | |
2509 ((memq (mail-header-number (car thread)) gnus-newsgroup-limit) | |
2510 1) | |
2511 (t 0)))) | |
2512 (when (and level (zerop level) gnus-tmp-new-adopts) | |
2513 (incf number | |
2514 (apply '+ (mapcar | |
2515 'gnus-summary-number-of-articles-in-thread | |
2516 gnus-tmp-new-adopts)))) | |
2517 (if char | |
2518 (if (> number 1) gnus-not-empty-thread-mark | |
2519 gnus-empty-thread-mark) | |
2520 number))) | |
2521 | |
2522 (defun gnus-summary-set-local-parameters (group) | |
2523 "Go through the local params of GROUP and set all variable specs in that list." | |
2524 (let ((params (gnus-group-find-parameter group)) | |
2525 elem) | |
2526 (while params | |
2527 (setq elem (car params) | |
2528 params (cdr params)) | |
2529 (and (consp elem) ; Has to be a cons. | |
2530 (consp (cdr elem)) ; The cdr has to be a list. | |
2531 (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
|
2532 (not (memq (car elem) '(quit-config))) ; Ignore quit-config. |
17493 | 2533 (ignore-errors ; So we set it. |
2534 (make-local-variable (car elem)) | |
2535 (set (car elem) (eval (nth 1 elem)))))))) | |
2536 | |
2537 (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
|
2538 kill-buffer no-display backward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2539 select-articles) |
17493 | 2540 "Start reading news in newsgroup GROUP. |
2541 If SHOW-ALL is non-nil, already read articles are also listed. | |
2542 If NO-ARTICLE is non-nil, no article is selected initially. | |
2543 If NO-DISPLAY, don't generate a summary buffer." | |
2544 (let (result) | |
2545 (while (and group | |
2546 (null (setq result | |
2547 (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
|
2548 (or (gnus-summary-read-group-1 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2549 group show-all no-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2550 kill-buffer no-display |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2551 select-articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2552 (setq show-all nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2553 select-articles nil))))) |
17493 | 2554 (eq gnus-auto-select-next 'quietly)) |
2555 (set-buffer gnus-group-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2556 ;; 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
|
2557 ;; 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
|
2558 ;; 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
|
2559 (when backward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2560 (gnus-group-prev-unread-group 2)) |
17493 | 2561 (if (not (equal group (gnus-group-group-name))) |
2562 (setq group (gnus-group-group-name)) | |
2563 (setq group nil))) | |
2564 result)) | |
2565 | |
2566 (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
|
2567 kill-buffer no-display |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2568 &optional select-articles) |
17493 | 2569 ;; Killed foreign groups can't be entered. |
2570 (when (and (not (gnus-group-native-p group)) | |
2571 (not (gnus-gethash group gnus-newsrc-hashtb))) | |
2572 (error "Dead non-native groups can't be entered")) | |
2573 (gnus-message 5 "Retrieving newsgroup: %s..." group) | |
2574 (let* ((new-group (gnus-summary-setup-buffer group)) | |
2575 (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
|
2576 (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
|
2577 group show-all select-articles)))) |
17493 | 2578 (cond |
2579 ;; This summary buffer exists already, so we just select it. | |
2580 ((not new-group) | |
2581 (gnus-set-global-variables) | |
2582 (when kill-buffer | |
2583 (gnus-kill-or-deaden-summary kill-buffer)) | |
2584 (gnus-configure-windows 'summary 'force) | |
2585 (gnus-set-mode-line 'summary) | |
2586 (gnus-summary-position-point) | |
2587 (message "") | |
2588 t) | |
2589 ;; We couldn't select this group. | |
2590 ((null did-select) | |
2591 (when (and (eq major-mode 'gnus-summary-mode) | |
2592 (not (equal (current-buffer) kill-buffer))) | |
2593 (kill-buffer (current-buffer)) | |
2594 (if (not quit-config) | |
2595 (progn | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2596 ;; 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
|
2597 ;; for instance. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2598 (gnus-summary-update-info) |
17493 | 2599 (set-buffer gnus-group-buffer) |
2600 (gnus-group-jump-to-group group) | |
2601 (gnus-group-next-unread-group 1)) | |
2602 (gnus-handle-ephemeral-exit quit-config))) | |
2603 (gnus-message 3 "Can't select group") | |
2604 nil) | |
2605 ;; The user did a `C-g' while prompting for number of articles, | |
2606 ;; so we exit this group. | |
2607 ((eq did-select 'quit) | |
2608 (and (eq major-mode 'gnus-summary-mode) | |
2609 (not (equal (current-buffer) kill-buffer)) | |
2610 (kill-buffer (current-buffer))) | |
2611 (when kill-buffer | |
2612 (gnus-kill-or-deaden-summary kill-buffer)) | |
2613 (if (not quit-config) | |
2614 (progn | |
2615 (set-buffer gnus-group-buffer) | |
2616 (gnus-group-jump-to-group group) | |
2617 (gnus-group-next-unread-group 1) | |
2618 (gnus-configure-windows 'group 'force)) | |
2619 (gnus-handle-ephemeral-exit quit-config)) | |
2620 ;; Finally signal the quit. | |
2621 (signal 'quit nil)) | |
2622 ;; The group was successfully selected. | |
2623 (t | |
2624 (gnus-set-global-variables) | |
2625 ;; Save the active value in effect when the group was entered. | |
2626 (setq gnus-newsgroup-active | |
2627 (gnus-copy-sequence | |
2628 (gnus-active gnus-newsgroup-name))) | |
2629 ;; 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
|
2630 (gnus-run-hooks 'gnus-select-group-hook) |
17493 | 2631 ;; Set any local variables in the group parameters. |
2632 (gnus-summary-set-local-parameters gnus-newsgroup-name) | |
2633 (gnus-update-format-specifications | |
2634 nil 'summary 'summary-mode 'summary-dummy) | |
2635 ;; Do score processing. | |
2636 (when gnus-use-scoring | |
2637 (gnus-possibly-score-headers)) | |
2638 ;; Check whether to fill in the gaps in the threads. | |
2639 (when gnus-build-sparse-threads | |
2640 (gnus-build-sparse-threads)) | |
2641 ;; Find the initial limit. | |
2642 (if gnus-show-threads | |
2643 (if show-all | |
2644 (let ((gnus-newsgroup-dormant nil)) | |
2645 (gnus-summary-initial-limit show-all)) | |
2646 (gnus-summary-initial-limit show-all)) | |
2647 (setq gnus-newsgroup-limit | |
2648 (mapcar | |
2649 (lambda (header) (mail-header-number header)) | |
2650 gnus-newsgroup-headers))) | |
2651 ;; Generate the summary buffer. | |
2652 (unless no-display | |
2653 (gnus-summary-prepare)) | |
2654 (when gnus-use-trees | |
2655 (gnus-tree-open group) | |
2656 (setq gnus-summary-highlight-line-function | |
2657 'gnus-tree-highlight-article)) | |
2658 ;; If the summary buffer is empty, but there are some low-scored | |
2659 ;; articles or some excluded dormants, we include these in the | |
2660 ;; buffer. | |
2661 (when (and (zerop (buffer-size)) | |
2662 (not no-display)) | |
2663 (cond (gnus-newsgroup-dormant | |
2664 (gnus-summary-limit-include-dormant)) | |
2665 ((and gnus-newsgroup-scored show-all) | |
2666 (gnus-summary-limit-include-expunged t)))) | |
2667 ;; 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
|
2668 (gnus-run-hooks 'gnus-apply-kill-hook) |
17493 | 2669 (if (and (zerop (buffer-size)) |
2670 (not no-display)) | |
2671 (progn | |
2672 ;; This newsgroup is empty. | |
2673 (gnus-summary-catchup-and-exit nil t) | |
2674 (gnus-message 6 "No unread news") | |
2675 (when kill-buffer | |
2676 (gnus-kill-or-deaden-summary kill-buffer)) | |
2677 ;; Return nil from this function. | |
2678 nil) | |
2679 ;; Hide conversation thread subtrees. We cannot do this in | |
2680 ;; gnus-summary-prepare-hook since kill processing may not | |
2681 ;; work with hidden articles. | |
2682 (and gnus-show-threads | |
2683 gnus-thread-hide-subtree | |
2684 (gnus-summary-hide-all-threads)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2685 (when kill-buffer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2686 (gnus-kill-or-deaden-summary kill-buffer)) |
17493 | 2687 ;; Show first unread article if requested. |
2688 (if (and (not no-article) | |
2689 (not no-display) | |
2690 gnus-newsgroup-unreads | |
2691 gnus-auto-select-first) | |
2692 (unless (if (eq gnus-auto-select-first 'best) | |
2693 (gnus-summary-best-unread-article) | |
2694 (gnus-summary-first-unread-article)) | |
2695 (gnus-configure-windows 'summary)) | |
2696 ;; Don't select any articles, just move point to the first | |
2697 ;; article in the group. | |
2698 (goto-char (point-min)) | |
2699 (gnus-summary-position-point) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2700 (gnus-configure-windows 'summary 'force) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2701 (gnus-set-mode-line 'summary)) |
17493 | 2702 (when (get-buffer-window gnus-group-buffer t) |
2703 ;; Gotta use windows, because recenter does weird stuff if | |
2704 ;; the current buffer ain't the displayed window. | |
2705 (let ((owin (selected-window))) | |
2706 (select-window (get-buffer-window gnus-group-buffer t)) | |
2707 (when (gnus-group-goto-group group) | |
2708 (recenter)) | |
2709 (select-window owin))) | |
2710 ;; Mark this buffer as "prepared". | |
2711 (setq gnus-newsgroup-prepared t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2712 (gnus-run-hooks 'gnus-summary-prepared-hook) |
17493 | 2713 t))))) |
2714 | |
2715 (defun gnus-summary-prepare () | |
2716 "Generate the summary buffer." | |
2717 (interactive) | |
2718 (let ((buffer-read-only nil)) | |
2719 (erase-buffer) | |
2720 (setq gnus-newsgroup-data nil | |
2721 gnus-newsgroup-data-reverse nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2722 (gnus-run-hooks 'gnus-summary-generate-hook) |
17493 | 2723 ;; Generate the buffer, either with threads or without. |
2724 (when gnus-newsgroup-headers | |
2725 (gnus-summary-prepare-threads | |
2726 (if gnus-show-threads | |
2727 (gnus-sort-gathered-threads | |
2728 (funcall gnus-summary-thread-gathering-function | |
2729 (gnus-sort-threads | |
2730 (gnus-cut-threads (gnus-make-threads))))) | |
2731 ;; Unthreaded display. | |
2732 (gnus-sort-articles gnus-newsgroup-headers)))) | |
2733 (setq gnus-newsgroup-data (nreverse gnus-newsgroup-data)) | |
2734 ;; Call hooks for modifying summary buffer. | |
2735 (goto-char (point-min)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2736 (gnus-run-hooks 'gnus-summary-prepare-hook))) |
17493 | 2737 |
2738 (defsubst gnus-general-simplify-subject (subject) | |
2739 "Simply subject by the same rules as gnus-gather-threads-by-subject." | |
2740 (setq subject | |
2741 (cond | |
2742 ;; Truncate the subject. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2743 (gnus-simplify-subject-functions |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2744 (gnus-map-function gnus-simplify-subject-functions subject)) |
17493 | 2745 ((numberp gnus-summary-gather-subject-limit) |
2746 (setq subject (gnus-simplify-subject-re subject)) | |
2747 (if (> (length subject) gnus-summary-gather-subject-limit) | |
2748 (substring subject 0 gnus-summary-gather-subject-limit) | |
2749 subject)) | |
2750 ;; Fuzzily simplify it. | |
2751 ((eq 'fuzzy gnus-summary-gather-subject-limit) | |
2752 (gnus-simplify-subject-fuzzy subject)) | |
2753 ;; Just remove the leading "Re:". | |
2754 (t | |
2755 (gnus-simplify-subject-re subject)))) | |
2756 | |
2757 (if (and gnus-summary-gather-exclude-subject | |
2758 (string-match gnus-summary-gather-exclude-subject subject)) | |
2759 nil ; This article shouldn't be gathered | |
2760 subject)) | |
2761 | |
2762 (defun gnus-summary-simplify-subject-query () | |
2763 "Query where the respool algorithm would put this article." | |
2764 (interactive) | |
2765 (gnus-summary-select-article) | |
2766 (message (gnus-general-simplify-subject (gnus-summary-article-subject)))) | |
2767 | |
2768 (defun gnus-gather-threads-by-subject (threads) | |
2769 "Gather threads by looking at Subject headers." | |
2770 (if (not gnus-summary-make-false-root) | |
2771 threads | |
2772 (let ((hashtb (gnus-make-hashtable 1024)) | |
2773 (prev threads) | |
2774 (result threads) | |
2775 subject hthread whole-subject) | |
2776 (while threads | |
2777 (setq subject (gnus-general-simplify-subject | |
2778 (setq whole-subject (mail-header-subject | |
2779 (caar threads))))) | |
2780 (when subject | |
2781 (if (setq hthread (gnus-gethash subject hashtb)) | |
2782 (progn | |
2783 ;; We enter a dummy root into the thread, if we | |
2784 ;; haven't done that already. | |
2785 (unless (stringp (caar hthread)) | |
2786 (setcar hthread (list whole-subject (car hthread)))) | |
2787 ;; We add this new gathered thread to this gathered | |
2788 ;; thread. | |
2789 (setcdr (car hthread) | |
2790 (nconc (cdar hthread) (list (car threads)))) | |
2791 ;; Remove it from the list of threads. | |
2792 (setcdr prev (cdr threads)) | |
2793 (setq threads prev)) | |
2794 ;; Enter this thread into the hash table. | |
2795 (gnus-sethash subject threads hashtb))) | |
2796 (setq prev threads) | |
2797 (setq threads (cdr threads))) | |
2798 result))) | |
2799 | |
2800 (defun gnus-gather-threads-by-references (threads) | |
2801 "Gather threads by looking at References headers." | |
2802 (let ((idhashtb (gnus-make-hashtable 1024)) | |
2803 (thhashtb (gnus-make-hashtable 1024)) | |
2804 (prev threads) | |
2805 (result threads) | |
2806 ids references id gthread gid entered ref) | |
2807 (while threads | |
2808 (when (setq references (mail-header-references (caar threads))) | |
2809 (setq id (mail-header-id (caar threads)) | |
2810 ids (gnus-split-references references) | |
2811 entered nil) | |
2812 (while (setq ref (pop ids)) | |
2813 (setq ids (delete ref ids)) | |
2814 (if (not (setq gid (gnus-gethash ref idhashtb))) | |
2815 (progn | |
2816 (gnus-sethash ref id idhashtb) | |
2817 (gnus-sethash id threads thhashtb)) | |
2818 (setq gthread (gnus-gethash gid thhashtb)) | |
2819 (unless entered | |
2820 ;; We enter a dummy root into the thread, if we | |
2821 ;; haven't done that already. | |
2822 (unless (stringp (caar gthread)) | |
2823 (setcar gthread (list (mail-header-subject (caar gthread)) | |
2824 (car gthread)))) | |
2825 ;; We add this new gathered thread to this gathered | |
2826 ;; thread. | |
2827 (setcdr (car gthread) | |
2828 (nconc (cdar gthread) (list (car threads))))) | |
2829 ;; Add it into the thread hash table. | |
2830 (gnus-sethash id gthread thhashtb) | |
2831 (setq entered t) | |
2832 ;; Remove it from the list of threads. | |
2833 (setcdr prev (cdr threads)) | |
2834 (setq threads prev)))) | |
2835 (setq prev threads) | |
2836 (setq threads (cdr threads))) | |
2837 result)) | |
2838 | |
2839 (defun gnus-sort-gathered-threads (threads) | |
2840 "Sort subtreads inside each gathered thread by article number." | |
2841 (let ((result threads)) | |
2842 (while threads | |
2843 (when (stringp (caar threads)) | |
2844 (setcdr (car threads) | |
2845 (sort (cdar threads) 'gnus-thread-sort-by-number))) | |
2846 (setq threads (cdr threads))) | |
2847 result)) | |
2848 | |
2849 (defun gnus-thread-loop-p (root thread) | |
2850 "Say whether ROOT is in THREAD." | |
2851 (let ((stack (list thread)) | |
2852 (infloop 0) | |
2853 th) | |
2854 (while (setq thread (pop stack)) | |
2855 (setq th (cdr thread)) | |
2856 (while (and th | |
2857 (not (eq (caar th) root))) | |
2858 (pop th)) | |
2859 (if th | |
2860 ;; We have found a loop. | |
2861 (let (ref-dep) | |
2862 (setcdr thread (delq (car th) (cdr thread))) | |
2863 (if (boundp (setq ref-dep (intern "none" | |
2864 gnus-newsgroup-dependencies))) | |
2865 (setcdr (symbol-value ref-dep) | |
2866 (nconc (cdr (symbol-value ref-dep)) | |
2867 (list (car th)))) | |
2868 (set ref-dep (list nil (car th)))) | |
2869 (setq infloop 1 | |
2870 stack nil)) | |
2871 ;; Push all the subthreads onto the stack. | |
2872 (push (cdr thread) stack))) | |
2873 infloop)) | |
2874 | |
2875 (defun gnus-make-threads () | |
2876 "Go through the dependency hashtb and find the roots. Return all threads." | |
2877 (let (threads) | |
2878 (while (catch 'infloop | |
2879 (mapatoms | |
2880 (lambda (refs) | |
2881 ;; Deal with self-referencing References loops. | |
2882 (when (and (car (symbol-value refs)) | |
2883 (not (zerop | |
2884 (apply | |
2885 '+ | |
2886 (mapcar | |
2887 (lambda (thread) | |
2888 (gnus-thread-loop-p | |
2889 (car (symbol-value refs)) thread)) | |
2890 (cdr (symbol-value refs))))))) | |
2891 (setq threads nil) | |
2892 (throw 'infloop t)) | |
2893 (unless (car (symbol-value refs)) | |
2894 ;; These threads do not refer back to any other articles, | |
2895 ;; so they're roots. | |
2896 (setq threads (append (cdr (symbol-value refs)) threads)))) | |
2897 gnus-newsgroup-dependencies))) | |
2898 threads)) | |
2899 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2900 ;; Build the thread tree. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2901 (defun 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
|
2902 "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
|
2903 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2904 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
|
2905 if it was already present. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2906 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2907 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
|
2908 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
|
2909 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
|
2910 being entered. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2911 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2912 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
|
2913 (let* ((id (mail-header-id header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2914 (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
|
2915 ref ref-dep ref-header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2916 ;; 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
|
2917 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2918 ((not id-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2919 (setq header nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2920 ;; 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
|
2921 ;; in the `dependencies' table. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2922 ((not (boundp id-dep)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2923 (set id-dep (list header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2924 ((null (car (symbol-value id-dep))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2925 (setcar (symbol-value id-dep) header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2926 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2927 ;; 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
|
2928 ;; `dependencies' table. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2929 (force-new |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2930 ;; Overrides an existing entry; |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2931 ;; 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
|
2932 (setcar (symbol-value id-dep) header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2933 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2934 ;; 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
|
2935 ((not gnus-summary-ignore-duplicates) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2936 ;; 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
|
2937 ;; We rename the Message-ID. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2938 (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
|
2939 (list header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2940 (mail-header-set-id header id)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2941 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2942 ;; 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
|
2943 ;; 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
|
2944 ;; servers. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2945 ;; 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
|
2946 ;; table was *not* modified. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2947 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2948 (mail-header-set-xref |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2949 (car (symbol-value id-dep)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2950 (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
|
2951 "") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2952 (or (mail-header-xref header) ""))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2953 (setq header nil))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2954 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2955 (when header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2956 ;; 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
|
2957 (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
|
2958 (while (and ref |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2959 (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
|
2960 (boundp ref-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2961 (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
|
2962 (if (string= id ref) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2963 ;; 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
|
2964 ;; root article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2965 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2966 (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
|
2967 (setq ref nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2968 (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
|
2969 (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
|
2970 (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
|
2971 (if (boundp ref-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2972 (setcdr (symbol-value ref-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2973 (nconc (cdr (symbol-value ref-dep)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2974 (list (symbol-value id-dep)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2975 (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
|
2976 header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2977 |
17493 | 2978 (defun gnus-build-sparse-threads () |
2979 (let ((headers gnus-newsgroup-headers) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2980 (gnus-summary-ignore-duplicates t) |
17493 | 2981 header references generation relations |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2982 subject child end new-child date) |
17493 | 2983 ;; First we create an alist of generations/relations, where |
2984 ;; generations is how much we trust the relation, and the relation | |
2985 ;; is parent/child. | |
2986 (gnus-message 7 "Making sparse threads...") | |
2987 (save-excursion | |
2988 (nnheader-set-temp-buffer " *gnus sparse threads*") | |
2989 (while (setq header (pop headers)) | |
2990 (when (and (setq references (mail-header-references header)) | |
2991 (not (string= references ""))) | |
2992 (insert references) | |
2993 (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
|
2994 subject (mail-header-subject header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2995 date (mail-header-date header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2996 generation 0) |
17493 | 2997 (while (search-backward ">" nil t) |
2998 (setq end (1+ (point))) | |
2999 (when (search-backward "<" nil t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3000 (setq new-child (buffer-substring (point) end)) |
17493 | 3001 (push (list (incf generation) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3002 child (setq child new-child) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3003 subject date) |
17493 | 3004 relations))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3005 (when child |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3006 (push (list (1+ generation) child nil subject) relations)) |
17493 | 3007 (erase-buffer))) |
3008 (kill-buffer (current-buffer))) | |
3009 ;; Sort over trustworthiness. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3010 (mapcar |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3011 (lambda (relation) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3012 (when (gnus-dependencies-add-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3013 (make-full-mail-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3014 gnus-reffed-article-number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3015 (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
|
3016 (nth 1 relation) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3017 (or (nth 2 relation) "") 0 0 "") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3018 gnus-newsgroup-dependencies nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3019 (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
|
3020 (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
|
3021 (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
|
3022 gnus-newsgroup-reads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3023 (decf gnus-reffed-article-number))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3024 (sort relations 'car-less-than-car)) |
17493 | 3025 (gnus-message 7 "Making sparse threads...done"))) |
3026 | |
3027 (defun gnus-build-old-threads () | |
3028 ;; Look at all the articles that refer back to old articles, and | |
3029 ;; fetch the headers for the articles that aren't there. This will | |
3030 ;; build complete threads - if the roots haven't been expired by the | |
3031 ;; server, that is. | |
3032 (let (id heads) | |
3033 (mapatoms | |
3034 (lambda (refs) | |
3035 (when (not (car (symbol-value refs))) | |
3036 (setq heads (cdr (symbol-value refs))) | |
3037 (while heads | |
3038 (if (memq (mail-header-number (caar heads)) | |
3039 gnus-newsgroup-dormant) | |
3040 (setq heads (cdr heads)) | |
3041 (setq id (symbol-name refs)) | |
3042 (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
|
3043 (not (car (gnus-id-to-thread id))))) |
17493 | 3044 (setq heads nil))))) |
3045 gnus-newsgroup-dependencies))) | |
3046 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3047 ;; The following macros and functions were written by Felix Lee |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3048 ;; <flee@cse.psu.edu>. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3049 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3050 (defmacro gnus-nov-read-integer () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3051 '(prog1 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3052 (if (= (following-char) ?\t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3053 0 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3054 (let ((num (ignore-errors (read buffer)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3055 (if (numberp num) num 0))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3056 (unless (eobp) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3057 (search-forward "\t" eol 'move)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3058 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3059 (defmacro gnus-nov-skip-field () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3060 '(search-forward "\t" eol 'move)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3061 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3062 (defmacro gnus-nov-field () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3063 '(buffer-substring (point) (if (gnus-nov-skip-field) (1- (point)) eol))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3064 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3065 ;; 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
|
3066 ;; on the beginning of the line. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3067 (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
|
3068 (let ((eol (gnus-point-at-eol)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3069 (buffer (current-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3070 header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3071 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3072 ;; 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
|
3073 (unwind-protect |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3074 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3075 (narrow-to-region (point) eol) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3076 (unless (eobp) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3077 (forward-char)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3078 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3079 (setq header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3080 (make-full-mail-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3081 number ; number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3082 (funcall |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3083 gnus-unstructured-field-decoder (gnus-nov-field)) ; subject |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3084 (funcall |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3085 gnus-structured-field-decoder (gnus-nov-field)) ; from |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3086 (gnus-nov-field) ; date |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3087 (or (gnus-nov-field) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3088 (nnheader-generate-fake-message-id)) ; id |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3089 (gnus-nov-field) ; refs |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3090 (gnus-nov-read-integer) ; chars |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3091 (gnus-nov-read-integer) ; lines |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3092 (unless (= (following-char) ?\n) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3093 (gnus-nov-field))))) ; misc |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3094 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3095 (widen)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3096 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3097 (when gnus-alter-header-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3098 (funcall gnus-alter-header-function header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3099 (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
|
3100 |
17493 | 3101 (defun gnus-build-get-header (id) |
3102 ;; Look through the buffer of NOV lines and find the header to | |
3103 ;; ID. Enter this line into the dependencies hash table, and return | |
3104 ;; the id of the parent article (if any). | |
3105 (let ((deps gnus-newsgroup-dependencies) | |
3106 found header) | |
3107 (prog1 | |
3108 (save-excursion | |
3109 (set-buffer nntp-server-buffer) | |
3110 (let ((case-fold-search nil)) | |
3111 (goto-char (point-min)) | |
3112 (while (and (not found) | |
3113 (search-forward id nil t)) | |
3114 (beginning-of-line) | |
3115 (setq found (looking-at | |
3116 (format "^[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t%s" | |
3117 (regexp-quote id)))) | |
3118 (or found (beginning-of-line 2))) | |
3119 (when found | |
3120 (beginning-of-line) | |
3121 (and | |
3122 (setq header (gnus-nov-parse-line | |
3123 (read (current-buffer)) deps)) | |
3124 (gnus-parent-id (mail-header-references header)))))) | |
3125 (when header | |
3126 (let ((number (mail-header-number header))) | |
3127 (push number gnus-newsgroup-limit) | |
3128 (push header gnus-newsgroup-headers) | |
3129 (if (memq number gnus-newsgroup-unselected) | |
3130 (progn | |
3131 (push number gnus-newsgroup-unreads) | |
3132 (setq gnus-newsgroup-unselected | |
3133 (delq number gnus-newsgroup-unselected))) | |
3134 (push number gnus-newsgroup-ancient))))))) | |
3135 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3136 (defun gnus-build-all-threads () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3137 "Read all the headers." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3138 (let ((gnus-summary-ignore-duplicates t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3139 (dependencies gnus-newsgroup-dependencies) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3140 header article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3141 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3142 (set-buffer nntp-server-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3143 (let ((case-fold-search nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3144 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3145 (while (not (eobp)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3146 (ignore-errors |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3147 (setq article (read (current-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3148 header (gnus-nov-parse-line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3149 article dependencies))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3150 (when header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3151 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3152 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3153 (push header gnus-newsgroup-headers) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3154 (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
|
3155 gnus-newsgroup-unselected) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3156 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3157 (push article gnus-newsgroup-unreads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3158 (setq gnus-newsgroup-unselected |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3159 (delq article gnus-newsgroup-unselected))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3160 (push article gnus-newsgroup-ancient))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3161 (forward-line 1))))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3162 |
17493 | 3163 (defun gnus-summary-update-article-line (article header) |
3164 "Update the line for ARTICLE using HEADERS." | |
3165 (let* ((id (mail-header-id header)) | |
3166 (thread (gnus-id-to-thread id))) | |
3167 (unless thread | |
3168 (error "Article in no thread")) | |
3169 ;; Update the thread. | |
3170 (setcar thread header) | |
3171 (gnus-summary-goto-subject article) | |
3172 (let* ((datal (gnus-data-find-list article)) | |
3173 (data (car datal)) | |
3174 (length (when (cdr datal) | |
3175 (- (gnus-data-pos data) | |
3176 (gnus-data-pos (cadr datal))))) | |
3177 (buffer-read-only nil) | |
3178 (level (gnus-summary-thread-level))) | |
3179 (gnus-delete-line) | |
3180 (gnus-summary-insert-line | |
3181 header level nil (gnus-article-mark article) | |
3182 (memq article gnus-newsgroup-replied) | |
3183 (memq article gnus-newsgroup-expirable) | |
3184 ;; Only insert the Subject string when it's different | |
3185 ;; from the previous Subject string. | |
3186 (if (gnus-subject-equal | |
3187 (condition-case () | |
3188 (mail-header-subject | |
3189 (gnus-data-header | |
3190 (cadr | |
3191 (gnus-data-find-list | |
3192 article | |
3193 (gnus-data-list t))))) | |
3194 ;; Error on the side of excessive subjects. | |
3195 (error "")) | |
3196 (mail-header-subject header)) | |
3197 "" | |
3198 (mail-header-subject header)) | |
3199 nil (cdr (assq article gnus-newsgroup-scored)) | |
3200 (memq article gnus-newsgroup-processable)) | |
3201 (when length | |
3202 (gnus-data-update-list | |
3203 (cdr datal) (- length (- (gnus-data-pos data) (point)))))))) | |
3204 | |
3205 (defun gnus-summary-update-article (article &optional iheader) | |
3206 "Update ARTICLE in the summary buffer." | |
3207 (set-buffer gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3208 (let* ((header (gnus-summary-article-header article)) |
17493 | 3209 (id (mail-header-id header)) |
3210 (data (gnus-data-find article)) | |
3211 (thread (gnus-id-to-thread id)) | |
3212 (references (mail-header-references header)) | |
3213 (parent | |
3214 (gnus-id-to-thread | |
3215 (or (gnus-parent-id | |
3216 (when (and references | |
3217 (not (equal "" references))) | |
3218 references)) | |
3219 "none"))) | |
3220 (buffer-read-only nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3221 (old (car thread))) |
17493 | 3222 (when thread |
3223 (unless iheader | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3224 (setcar thread nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3225 (when parent |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3226 (delq thread parent))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3227 (if (gnus-summary-insert-subject id header) |
17493 | 3228 ;; Set the (possibly) new article number in the data structure. |
3229 (gnus-data-set-number data (gnus-id-to-article id)) | |
3230 (setcar thread old) | |
3231 nil)))) | |
3232 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3233 (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
|
3234 "Rebuild the thread containing ID. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3235 If LINE, insert the rebuilt thread starting on line LINE." |
17493 | 3236 (let ((buffer-read-only nil) |
3237 old-pos current thread data) | |
3238 (if (not gnus-show-threads) | |
3239 (setq thread (list (car (gnus-id-to-thread id)))) | |
3240 ;; Get the thread this article is part of. | |
3241 (setq thread (gnus-remove-thread id))) | |
3242 (setq old-pos (gnus-point-at-bol)) | |
3243 (setq current (save-excursion | |
3244 (and (zerop (forward-line -1)) | |
3245 (gnus-summary-article-number)))) | |
3246 ;; If this is a gathered thread, we have to go some re-gathering. | |
3247 (when (stringp (car thread)) | |
3248 (let ((subject (car thread)) | |
3249 roots thr) | |
3250 (setq thread (cdr thread)) | |
3251 (while thread | |
3252 (unless (memq (setq thr (gnus-id-to-thread | |
3253 (gnus-root-id | |
3254 (mail-header-id (caar thread))))) | |
3255 roots) | |
3256 (push thr roots)) | |
3257 (setq thread (cdr thread))) | |
3258 ;; We now have all (unique) roots. | |
3259 (if (= (length roots) 1) | |
3260 ;; All the loose roots are now one solid root. | |
3261 (setq thread (car roots)) | |
3262 (setq thread (cons subject (gnus-sort-threads roots)))))) | |
3263 (let (threads) | |
3264 ;; 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
|
3265 (when line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3266 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3267 (forward-line (1- line))) |
17493 | 3268 (let (gnus-newsgroup-data gnus-newsgroup-threads) |
3269 (if gnus-show-threads | |
3270 (gnus-summary-prepare-threads (gnus-cut-threads (list thread))) | |
3271 (gnus-summary-prepare-unthreaded thread)) | |
3272 (setq data (nreverse gnus-newsgroup-data)) | |
3273 (setq threads gnus-newsgroup-threads)) | |
3274 ;; 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
|
3275 ;;!!! 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
|
3276 ;;!!! 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
|
3277 ;;!!! 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
|
3278 ;;!!! change in the future. Perhaps. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3279 (gnus-data-enter-list |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3280 (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
|
3281 (setq gnus-newsgroup-threads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3282 (nconc threads gnus-newsgroup-threads)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3283 (gnus-data-compute-positions)))) |
17493 | 3284 |
3285 (defun gnus-number-to-header (number) | |
3286 "Return the header for article NUMBER." | |
3287 (let ((headers gnus-newsgroup-headers)) | |
3288 (while (and headers | |
3289 (not (= number (mail-header-number (car headers))))) | |
3290 (pop headers)) | |
3291 (when headers | |
3292 (car headers)))) | |
3293 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3294 (defun gnus-parent-headers (in-headers &optional generation) |
17493 | 3295 "Return the headers of the GENERATIONeth parent of HEADERS." |
3296 (unless generation | |
3297 (setq generation 1)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
3298 (let ((parent t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3299 (headers in-headers) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
3300 references) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3301 (while (and parent |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3302 (not (zerop generation)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3303 (setq references (mail-header-references headers))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3304 (setq headers (if (and references |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3305 (setq parent (gnus-parent-id references))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3306 (car (gnus-id-to-thread parent)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3307 nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3308 (decf generation)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3309 (and (not (eq headers in-headers)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3310 headers))) |
17493 | 3311 |
3312 (defun gnus-id-to-thread (id) | |
3313 "Return the (sub-)thread where ID appears." | |
3314 (gnus-gethash id gnus-newsgroup-dependencies)) | |
3315 | |
3316 (defun gnus-id-to-article (id) | |
3317 "Return the article number of ID." | |
3318 (let ((thread (gnus-id-to-thread id))) | |
3319 (when (and thread | |
3320 (car thread)) | |
3321 (mail-header-number (car thread))))) | |
3322 | |
3323 (defun gnus-id-to-header (id) | |
3324 "Return the article headers of ID." | |
3325 (car (gnus-id-to-thread id))) | |
3326 | |
3327 (defun gnus-article-displayed-root-p (article) | |
3328 "Say whether ARTICLE is a root(ish) article." | |
3329 (let ((level (gnus-summary-thread-level article)) | |
3330 (refs (mail-header-references (gnus-summary-article-header article))) | |
3331 particle) | |
3332 (cond | |
3333 ((null level) nil) | |
3334 ((zerop level) t) | |
3335 ((null refs) t) | |
3336 ((null (gnus-parent-id refs)) t) | |
3337 ((and (= 1 level) | |
3338 (null (setq particle (gnus-id-to-article | |
3339 (gnus-parent-id refs)))) | |
3340 (null (gnus-summary-thread-level particle))))))) | |
3341 | |
3342 (defun gnus-root-id (id) | |
3343 "Return the id of the root of the thread where ID appears." | |
3344 (let (last-id prev) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3345 (while (and id (setq prev (car (gnus-id-to-thread id)))) |
17493 | 3346 (setq last-id id |
3347 id (gnus-parent-id (mail-header-references prev)))) | |
3348 last-id)) | |
3349 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3350 (defun gnus-articles-in-thread (thread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3351 "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
|
3352 (cons (mail-header-number (car thread)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3353 (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
|
3354 |
17493 | 3355 (defun gnus-remove-thread (id &optional dont-remove) |
3356 "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
|
3357 (let (headers thread last-id) |
17493 | 3358 ;; 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
|
3359 (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
|
3360 headers (message-flatten-list (gnus-id-to-thread last-id))) |
17493 | 3361 ;; We have now found the real root of this thread. It might have |
3362 ;; been gathered into some loose thread, so we have to search | |
3363 ;; through the threads to find the thread we wanted. | |
3364 (let ((threads gnus-newsgroup-threads) | |
3365 sub) | |
3366 (while threads | |
3367 (setq sub (car threads)) | |
3368 (if (stringp (car sub)) | |
3369 ;; This is a gathered thread, so we look at the roots | |
3370 ;; below it to find whether this article is in this | |
3371 ;; gathered root. | |
3372 (progn | |
3373 (setq sub (cdr sub)) | |
3374 (while sub | |
3375 (when (member (caar sub) headers) | |
3376 (setq thread (car threads) | |
3377 threads nil | |
3378 sub nil)) | |
3379 (setq sub (cdr sub)))) | |
3380 ;; It's an ordinary thread, so we check it. | |
3381 (when (eq (car sub) (car headers)) | |
3382 (setq thread sub | |
3383 threads nil))) | |
3384 (setq threads (cdr threads))) | |
3385 ;; If this article is in no thread, then it's a root. | |
3386 (if thread | |
3387 (unless dont-remove | |
3388 (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
|
3389 (setq thread (gnus-id-to-thread last-id))) |
17493 | 3390 (when thread |
3391 (prog1 | |
3392 thread ; We return this thread. | |
3393 (unless dont-remove | |
3394 (if (stringp (car thread)) | |
3395 (progn | |
3396 ;; If we use dummy roots, then we have to remove the | |
3397 ;; dummy root as well. | |
3398 (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
|
3399 ;; 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
|
3400 ;; 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
|
3401 (gnus-summary-goto-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3402 (mail-header-number (caadr thread))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3403 (forward-line -1) |
17493 | 3404 (gnus-delete-line) |
3405 (gnus-data-compute-positions)) | |
3406 (setq thread (cdr thread)) | |
3407 (while thread | |
3408 (gnus-remove-thread-1 (car thread)) | |
3409 (setq thread (cdr thread)))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3410 (gnus-summary-show-all-threads) |
17493 | 3411 (gnus-remove-thread-1 thread)))))))) |
3412 | |
3413 (defun gnus-remove-thread-1 (thread) | |
3414 "Remove the thread THREAD recursively." | |
3415 (let ((number (mail-header-number (pop thread))) | |
3416 d) | |
3417 (setq thread (reverse thread)) | |
3418 (while thread | |
3419 (gnus-remove-thread-1 (pop thread))) | |
3420 (when (setq d (gnus-data-find number)) | |
3421 (goto-char (gnus-data-pos d)) | |
3422 (gnus-data-remove | |
3423 number | |
3424 (- (gnus-point-at-bol) | |
3425 (prog1 | |
3426 (1+ (gnus-point-at-eol)) | |
3427 (gnus-delete-line))))))) | |
3428 | |
3429 (defun gnus-sort-threads (threads) | |
3430 "Sort THREADS." | |
3431 (if (not gnus-thread-sort-functions) | |
3432 threads | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3433 (gnus-message 8 "Sorting threads...") |
17493 | 3434 (prog1 |
3435 (sort threads (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
|
3436 (gnus-message 8 "Sorting threads...done")))) |
17493 | 3437 |
3438 (defun gnus-sort-articles (articles) | |
3439 "Sort ARTICLES." | |
3440 (when gnus-article-sort-functions | |
3441 (gnus-message 7 "Sorting articles...") | |
3442 (prog1 | |
3443 (setq gnus-newsgroup-headers | |
3444 (sort articles (gnus-make-sort-function | |
3445 gnus-article-sort-functions))) | |
3446 (gnus-message 7 "Sorting articles...done")))) | |
3447 | |
3448 ;; Written by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>. | |
3449 (defmacro gnus-thread-header (thread) | |
3450 ;; Return header of first article in THREAD. | |
3451 ;; Note that THREAD must never, ever be anything else than a variable - | |
3452 ;; using some other form will lead to serious barfage. | |
3453 (or (symbolp thread) (signal 'wrong-type-argument '(symbolp thread))) | |
3454 ;; (8% speedup to gnus-summary-prepare, just for fun :-) | |
3455 (list 'byte-code "\10\211:\203\17\0\211@;\203\16\0A@@\207" ; | |
3456 (vector thread) 2)) | |
3457 | |
3458 (defsubst gnus-article-sort-by-number (h1 h2) | |
3459 "Sort articles by article number." | |
3460 (< (mail-header-number h1) | |
3461 (mail-header-number h2))) | |
3462 | |
3463 (defun gnus-thread-sort-by-number (h1 h2) | |
3464 "Sort threads by root article number." | |
3465 (gnus-article-sort-by-number | |
3466 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3467 | |
3468 (defsubst gnus-article-sort-by-lines (h1 h2) | |
3469 "Sort articles by article Lines header." | |
3470 (< (mail-header-lines h1) | |
3471 (mail-header-lines h2))) | |
3472 | |
3473 (defun gnus-thread-sort-by-lines (h1 h2) | |
3474 "Sort threads by root article Lines header." | |
3475 (gnus-article-sort-by-lines | |
3476 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3477 | |
3478 (defsubst gnus-article-sort-by-author (h1 h2) | |
3479 "Sort articles by root author." | |
3480 (string-lessp | |
3481 (let ((extract (funcall | |
3482 gnus-extract-address-components | |
3483 (mail-header-from h1)))) | |
3484 (or (car extract) (cadr extract) "")) | |
3485 (let ((extract (funcall | |
3486 gnus-extract-address-components | |
3487 (mail-header-from h2)))) | |
3488 (or (car extract) (cadr extract) "")))) | |
3489 | |
3490 (defun gnus-thread-sort-by-author (h1 h2) | |
3491 "Sort threads by root author." | |
3492 (gnus-article-sort-by-author | |
3493 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3494 | |
3495 (defsubst gnus-article-sort-by-subject (h1 h2) | |
3496 "Sort articles by root subject." | |
3497 (string-lessp | |
3498 (downcase (gnus-simplify-subject-re (mail-header-subject h1))) | |
3499 (downcase (gnus-simplify-subject-re (mail-header-subject h2))))) | |
3500 | |
3501 (defun gnus-thread-sort-by-subject (h1 h2) | |
3502 "Sort threads by root subject." | |
3503 (gnus-article-sort-by-subject | |
3504 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3505 | |
3506 (defsubst gnus-article-sort-by-date (h1 h2) | |
3507 "Sort articles by root article date." | |
3508 (gnus-time-less | |
3509 (gnus-date-get-time (mail-header-date h1)) | |
3510 (gnus-date-get-time (mail-header-date h2)))) | |
3511 | |
3512 (defun gnus-thread-sort-by-date (h1 h2) | |
3513 "Sort threads by root article date." | |
3514 (gnus-article-sort-by-date | |
3515 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3516 | |
3517 (defsubst gnus-article-sort-by-score (h1 h2) | |
3518 "Sort articles by root article score. | |
3519 Unscored articles will be counted as having a score of zero." | |
3520 (> (or (cdr (assq (mail-header-number h1) | |
3521 gnus-newsgroup-scored)) | |
3522 gnus-summary-default-score 0) | |
3523 (or (cdr (assq (mail-header-number h2) | |
3524 gnus-newsgroup-scored)) | |
3525 gnus-summary-default-score 0))) | |
3526 | |
3527 (defun gnus-thread-sort-by-score (h1 h2) | |
3528 "Sort threads by root article score." | |
3529 (gnus-article-sort-by-score | |
3530 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3531 | |
3532 (defun gnus-thread-sort-by-total-score (h1 h2) | |
3533 "Sort threads by the sum of all scores in the thread. | |
3534 Unscored articles will be counted as having a score of zero." | |
3535 (> (gnus-thread-total-score h1) (gnus-thread-total-score h2))) | |
3536 | |
3537 (defun gnus-thread-total-score (thread) | |
3538 ;; This function find the total score of THREAD. | |
3539 (cond ((null thread) | |
3540 0) | |
3541 ((consp thread) | |
3542 (if (stringp (car thread)) | |
3543 (apply gnus-thread-score-function 0 | |
3544 (mapcar 'gnus-thread-total-score-1 (cdr thread))) | |
3545 (gnus-thread-total-score-1 thread))) | |
3546 (t | |
3547 (gnus-thread-total-score-1 (list thread))))) | |
3548 | |
3549 (defun gnus-thread-total-score-1 (root) | |
3550 ;; This function find the total score of the thread below ROOT. | |
3551 (setq root (car root)) | |
3552 (apply gnus-thread-score-function | |
3553 (or (append | |
3554 (mapcar 'gnus-thread-total-score | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3555 (cdr (gnus-id-to-thread (mail-header-id root)))) |
17493 | 3556 (when (> (mail-header-number root) 0) |
3557 (list (or (cdr (assq (mail-header-number root) | |
3558 gnus-newsgroup-scored)) | |
3559 gnus-summary-default-score 0)))) | |
3560 (list gnus-summary-default-score) | |
3561 '(0)))) | |
3562 | |
3563 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>. | |
3564 (defvar gnus-tmp-prev-subject nil) | |
3565 (defvar gnus-tmp-false-parent nil) | |
3566 (defvar gnus-tmp-root-expunged nil) | |
3567 (defvar gnus-tmp-dummy-line nil) | |
3568 | |
3569 (defun gnus-summary-prepare-threads (threads) | |
3570 "Prepare summary buffer from THREADS and indentation LEVEL. | |
3571 THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])' | |
3572 or a straight list of headers." | |
3573 (gnus-message 7 "Generating summary...") | |
3574 | |
3575 (setq gnus-newsgroup-threads threads) | |
3576 (beginning-of-line) | |
3577 | |
3578 (let ((gnus-tmp-level 0) | |
3579 (default-score (or gnus-summary-default-score 0)) | |
3580 (gnus-visual-p (gnus-visual-p 'summary-highlight 'highlight)) | |
3581 thread number subject stack state gnus-tmp-gathered beg-match | |
3582 new-roots gnus-tmp-new-adopts thread-end | |
3583 gnus-tmp-header gnus-tmp-unread | |
3584 gnus-tmp-replied gnus-tmp-subject-or-nil | |
3585 gnus-tmp-dummy gnus-tmp-indentation gnus-tmp-lines gnus-tmp-score | |
3586 gnus-tmp-score-char gnus-tmp-from gnus-tmp-name | |
3587 gnus-tmp-number gnus-tmp-opening-bracket gnus-tmp-closing-bracket) | |
3588 | |
3589 (setq gnus-tmp-prev-subject nil) | |
3590 | |
3591 (if (vectorp (car threads)) | |
3592 ;; If this is a straight (sic) list of headers, then a | |
3593 ;; threaded summary display isn't required, so we just create | |
3594 ;; an unthreaded one. | |
3595 (gnus-summary-prepare-unthreaded threads) | |
3596 | |
3597 ;; Do the threaded display. | |
3598 | |
3599 (while (or threads stack gnus-tmp-new-adopts new-roots) | |
3600 | |
3601 (if (and (= gnus-tmp-level 0) | |
3602 (or (not stack) | |
3603 (= (caar stack) 0)) | |
3604 (not gnus-tmp-false-parent) | |
3605 (or gnus-tmp-new-adopts new-roots)) | |
3606 (if gnus-tmp-new-adopts | |
3607 (setq gnus-tmp-level (if gnus-tmp-root-expunged 0 1) | |
3608 thread (list (car gnus-tmp-new-adopts)) | |
3609 gnus-tmp-header (caar thread) | |
3610 gnus-tmp-new-adopts (cdr gnus-tmp-new-adopts)) | |
3611 (when new-roots | |
3612 (setq thread (list (car new-roots)) | |
3613 gnus-tmp-header (caar thread) | |
3614 new-roots (cdr new-roots)))) | |
3615 | |
3616 (if threads | |
3617 ;; If there are some threads, we do them before the | |
3618 ;; threads on the stack. | |
3619 (setq thread threads | |
3620 gnus-tmp-header (caar thread)) | |
3621 ;; There were no current threads, so we pop something off | |
3622 ;; the stack. | |
3623 (setq state (car stack) | |
3624 gnus-tmp-level (car state) | |
3625 thread (cdr state) | |
3626 stack (cdr stack) | |
3627 gnus-tmp-header (caar thread)))) | |
3628 | |
3629 (setq gnus-tmp-false-parent nil) | |
3630 (setq gnus-tmp-root-expunged nil) | |
3631 (setq thread-end nil) | |
3632 | |
3633 (if (stringp gnus-tmp-header) | |
3634 ;; The header is a dummy root. | |
3635 (cond | |
3636 ((eq gnus-summary-make-false-root 'adopt) | |
3637 ;; We let the first article adopt the rest. | |
3638 (setq gnus-tmp-new-adopts (nconc gnus-tmp-new-adopts | |
3639 (cddar thread))) | |
3640 (setq gnus-tmp-gathered | |
3641 (nconc (mapcar | |
3642 (lambda (h) (mail-header-number (car h))) | |
3643 (cddar thread)) | |
3644 gnus-tmp-gathered)) | |
3645 (setq thread (cons (list (caar thread) | |
3646 (cadar thread)) | |
3647 (cdr thread))) | |
3648 (setq gnus-tmp-level -1 | |
3649 gnus-tmp-false-parent t)) | |
3650 ((eq gnus-summary-make-false-root 'empty) | |
3651 ;; We print adopted articles with empty subject fields. | |
3652 (setq gnus-tmp-gathered | |
3653 (nconc (mapcar | |
3654 (lambda (h) (mail-header-number (car h))) | |
3655 (cddar thread)) | |
3656 gnus-tmp-gathered)) | |
3657 (setq gnus-tmp-level -1)) | |
3658 ((eq gnus-summary-make-false-root 'dummy) | |
3659 ;; We remember that we probably want to output a dummy | |
3660 ;; root. | |
3661 (setq gnus-tmp-dummy-line gnus-tmp-header) | |
3662 (setq gnus-tmp-prev-subject gnus-tmp-header)) | |
3663 (t | |
3664 ;; We do not make a root for the gathered | |
3665 ;; sub-threads at all. | |
3666 (setq gnus-tmp-level -1))) | |
3667 | |
3668 (setq number (mail-header-number gnus-tmp-header) | |
3669 subject (mail-header-subject gnus-tmp-header)) | |
3670 | |
3671 (cond | |
3672 ;; If the thread has changed subject, we might want to make | |
3673 ;; this subthread into a root. | |
3674 ((and (null gnus-thread-ignore-subject) | |
3675 (not (zerop gnus-tmp-level)) | |
3676 gnus-tmp-prev-subject | |
3677 (not (inline | |
3678 (gnus-subject-equal gnus-tmp-prev-subject subject)))) | |
3679 (setq new-roots (nconc new-roots (list (car thread))) | |
3680 thread-end t | |
3681 gnus-tmp-header nil)) | |
3682 ;; If the article lies outside the current limit, | |
3683 ;; then we do not display it. | |
3684 ((not (memq number gnus-newsgroup-limit)) | |
3685 (setq gnus-tmp-gathered | |
3686 (nconc (mapcar | |
3687 (lambda (h) (mail-header-number (car h))) | |
3688 (cdar thread)) | |
3689 gnus-tmp-gathered)) | |
3690 (setq gnus-tmp-new-adopts (if (cdar thread) | |
3691 (append gnus-tmp-new-adopts | |
3692 (cdar thread)) | |
3693 gnus-tmp-new-adopts) | |
3694 thread-end t | |
3695 gnus-tmp-header nil) | |
3696 (when (zerop gnus-tmp-level) | |
3697 (setq gnus-tmp-root-expunged t))) | |
3698 ;; Perhaps this article is to be marked as read? | |
3699 ((and gnus-summary-mark-below | |
3700 (< (or (cdr (assq number gnus-newsgroup-scored)) | |
3701 default-score) | |
3702 gnus-summary-mark-below) | |
3703 ;; Don't touch sparse articles. | |
3704 (not (gnus-summary-article-sparse-p number)) | |
3705 (not (gnus-summary-article-ancient-p number))) | |
3706 (setq gnus-newsgroup-unreads | |
3707 (delq number gnus-newsgroup-unreads)) | |
3708 (if gnus-newsgroup-auto-expire | |
3709 (push number gnus-newsgroup-expirable) | |
3710 (push (cons number gnus-low-score-mark) | |
3711 gnus-newsgroup-reads)))) | |
3712 | |
3713 (when gnus-tmp-header | |
3714 ;; We may have an old dummy line to output before this | |
3715 ;; article. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3716 (when (and gnus-tmp-dummy-line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3717 (gnus-subject-equal |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3718 gnus-tmp-dummy-line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3719 (mail-header-subject gnus-tmp-header))) |
17493 | 3720 (gnus-summary-insert-dummy-line |
3721 gnus-tmp-dummy-line (mail-header-number gnus-tmp-header)) | |
3722 (setq gnus-tmp-dummy-line nil)) | |
3723 | |
3724 ;; Compute the mark. | |
3725 (setq gnus-tmp-unread (gnus-article-mark number)) | |
3726 | |
3727 (push (gnus-data-make number gnus-tmp-unread (1+ (point)) | |
3728 gnus-tmp-header gnus-tmp-level) | |
3729 gnus-newsgroup-data) | |
3730 | |
3731 ;; Actually insert the line. | |
3732 (setq | |
3733 gnus-tmp-subject-or-nil | |
3734 (cond | |
3735 ((and gnus-thread-ignore-subject | |
3736 gnus-tmp-prev-subject | |
3737 (not (inline (gnus-subject-equal | |
3738 gnus-tmp-prev-subject subject)))) | |
3739 subject) | |
3740 ((zerop gnus-tmp-level) | |
3741 (if (and (eq gnus-summary-make-false-root 'empty) | |
3742 (memq number gnus-tmp-gathered) | |
3743 gnus-tmp-prev-subject | |
3744 (inline (gnus-subject-equal | |
3745 gnus-tmp-prev-subject subject))) | |
3746 gnus-summary-same-subject | |
3747 subject)) | |
3748 (t gnus-summary-same-subject))) | |
3749 (if (and (eq gnus-summary-make-false-root 'adopt) | |
3750 (= gnus-tmp-level 1) | |
3751 (memq number gnus-tmp-gathered)) | |
3752 (setq gnus-tmp-opening-bracket ?\< | |
3753 gnus-tmp-closing-bracket ?\>) | |
3754 (setq gnus-tmp-opening-bracket ?\[ | |
3755 gnus-tmp-closing-bracket ?\])) | |
3756 (setq | |
3757 gnus-tmp-indentation | |
3758 (aref gnus-thread-indent-array gnus-tmp-level) | |
3759 gnus-tmp-lines (mail-header-lines gnus-tmp-header) | |
3760 gnus-tmp-score (or (cdr (assq number gnus-newsgroup-scored)) | |
3761 gnus-summary-default-score 0) | |
3762 gnus-tmp-score-char | |
3763 (if (or (null gnus-summary-default-score) | |
3764 (<= (abs (- gnus-tmp-score gnus-summary-default-score)) | |
3765 gnus-summary-zcore-fuzz)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3766 ? ;space |
17493 | 3767 (if (< gnus-tmp-score gnus-summary-default-score) |
3768 gnus-score-below-mark gnus-score-over-mark)) | |
3769 gnus-tmp-replied | |
3770 (cond ((memq number gnus-newsgroup-processable) | |
3771 gnus-process-mark) | |
3772 ((memq number gnus-newsgroup-cached) | |
3773 gnus-cached-mark) | |
3774 ((memq number gnus-newsgroup-replied) | |
3775 gnus-replied-mark) | |
3776 ((memq number gnus-newsgroup-saved) | |
3777 gnus-saved-mark) | |
3778 (t gnus-unread-mark)) | |
3779 gnus-tmp-from (mail-header-from gnus-tmp-header) | |
3780 gnus-tmp-name | |
3781 (cond | |
3782 ((string-match "<[^>]+> *$" gnus-tmp-from) | |
3783 (setq beg-match (match-beginning 0)) | |
3784 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from) | |
3785 (substring gnus-tmp-from (1+ (match-beginning 0)) | |
3786 (1- (match-end 0)))) | |
3787 (substring gnus-tmp-from 0 beg-match))) | |
3788 ((string-match "(.+)" gnus-tmp-from) | |
3789 (substring gnus-tmp-from | |
3790 (1+ (match-beginning 0)) (1- (match-end 0)))) | |
3791 (t gnus-tmp-from))) | |
3792 (when (string= gnus-tmp-name "") | |
3793 (setq gnus-tmp-name gnus-tmp-from)) | |
3794 (unless (numberp gnus-tmp-lines) | |
3795 (setq gnus-tmp-lines 0)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3796 (gnus-put-text-property-excluding-characters-with-faces |
17493 | 3797 (point) |
3798 (progn (eval gnus-summary-line-format-spec) (point)) | |
3799 'gnus-number number) | |
3800 (when gnus-visual-p | |
3801 (forward-line -1) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3802 (gnus-run-hooks 'gnus-summary-update-hook) |
17493 | 3803 (forward-line 1)) |
3804 | |
3805 (setq gnus-tmp-prev-subject subject))) | |
3806 | |
3807 (when (nth 1 thread) | |
3808 (push (cons (max 0 gnus-tmp-level) (nthcdr 1 thread)) stack)) | |
3809 (incf gnus-tmp-level) | |
3810 (setq threads (if thread-end nil (cdar thread))) | |
3811 (unless threads | |
3812 (setq gnus-tmp-level 0))))) | |
3813 (gnus-message 7 "Generating summary...done")) | |
3814 | |
3815 (defun gnus-summary-prepare-unthreaded (headers) | |
3816 "Generate an unthreaded summary buffer based on HEADERS." | |
3817 (let (header number mark) | |
3818 | |
3819 (beginning-of-line) | |
3820 | |
3821 (while headers | |
3822 ;; We may have to root out some bad articles... | |
3823 (when (memq (setq number (mail-header-number | |
3824 (setq header (pop headers)))) | |
3825 gnus-newsgroup-limit) | |
3826 ;; Mark article as read when it has a low score. | |
3827 (when (and gnus-summary-mark-below | |
3828 (< (or (cdr (assq number gnus-newsgroup-scored)) | |
3829 gnus-summary-default-score 0) | |
3830 gnus-summary-mark-below) | |
3831 (not (gnus-summary-article-ancient-p number))) | |
3832 (setq gnus-newsgroup-unreads | |
3833 (delq number gnus-newsgroup-unreads)) | |
3834 (if gnus-newsgroup-auto-expire | |
3835 (push number gnus-newsgroup-expirable) | |
3836 (push (cons number gnus-low-score-mark) | |
3837 gnus-newsgroup-reads))) | |
3838 | |
3839 (setq mark (gnus-article-mark number)) | |
3840 (push (gnus-data-make number mark (1+ (point)) header 0) | |
3841 gnus-newsgroup-data) | |
3842 (gnus-summary-insert-line | |
3843 header 0 number | |
3844 mark (memq number gnus-newsgroup-replied) | |
3845 (memq number gnus-newsgroup-expirable) | |
3846 (mail-header-subject header) nil | |
3847 (cdr (assq number gnus-newsgroup-scored)) | |
3848 (memq number gnus-newsgroup-processable)))))) | |
3849 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3850 (defun gnus-select-newsgroup (group &optional read-all select-articles) |
17493 | 3851 "Select newsgroup GROUP. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3852 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
|
3853 If SELECT-ARTICLES, only select those articles from GROUP." |
17493 | 3854 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb)) |
3855 ;;!!! Dirty hack; should be removed. | |
3856 (gnus-summary-ignore-duplicates | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3857 (if (eq (car (gnus-find-method-for-group group)) 'nnvirtual) |
17493 | 3858 t |
3859 gnus-summary-ignore-duplicates)) | |
3860 (info (nth 2 entry)) | |
3861 articles fetched-articles cached) | |
3862 | |
3863 (unless (gnus-check-server | |
3864 (setq gnus-current-select-method | |
3865 (gnus-find-method-for-group group))) | |
3866 (error "Couldn't open server")) | |
3867 | |
3868 (or (and entry (not (eq (car entry) t))) ; Either it's active... | |
3869 (gnus-activate-group group) ; Or we can activate it... | |
3870 (progn ; Or we bug out. | |
3871 (when (equal major-mode 'gnus-summary-mode) | |
3872 (kill-buffer (current-buffer))) | |
3873 (error "Couldn't request group %s: %s" | |
3874 group (gnus-status-message group)))) | |
3875 | |
3876 (unless (gnus-request-group group t) | |
3877 (when (equal major-mode 'gnus-summary-mode) | |
3878 (kill-buffer (current-buffer))) | |
3879 (error "Couldn't request group %s: %s" | |
3880 group (gnus-status-message group))) | |
3881 | |
3882 (setq gnus-newsgroup-name group) | |
3883 (setq gnus-newsgroup-unselected nil) | |
3884 (setq gnus-newsgroup-unreads (gnus-list-of-unread-articles group)) | |
3885 | |
3886 ;; Adjust and set lists of article marks. | |
3887 (when info | |
3888 (gnus-adjust-marked-articles info)) | |
3889 | |
3890 ;; Kludge to avoid having cached articles nixed out in virtual groups. | |
3891 (when (gnus-virtual-group-p group) | |
3892 (setq cached gnus-newsgroup-cached)) | |
3893 | |
3894 (setq gnus-newsgroup-unreads | |
3895 (gnus-set-difference | |
3896 (gnus-set-difference gnus-newsgroup-unreads gnus-newsgroup-marked) | |
3897 gnus-newsgroup-dormant)) | |
3898 | |
3899 (setq gnus-newsgroup-processable nil) | |
3900 | |
3901 (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
|
3902 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3903 (if (setq articles select-articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3904 (setq gnus-newsgroup-unselected |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3905 (gnus-sorted-intersection |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3906 gnus-newsgroup-unreads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3907 (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
|
3908 (setq articles (gnus-articles-to-read group read-all))) |
17493 | 3909 |
3910 (cond | |
3911 ((null articles) | |
3912 ;;(gnus-message 3 "Couldn't select newsgroup -- no articles to display") | |
3913 'quit) | |
3914 ((eq articles 0) nil) | |
3915 (t | |
3916 ;; Init the dependencies hash table. | |
3917 (setq gnus-newsgroup-dependencies | |
3918 (gnus-make-hashtable (length articles))) | |
3919 ;; Retrieve the headers and read them in. | |
3920 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name) | |
3921 (setq gnus-newsgroup-headers | |
3922 (if (eq 'nov | |
3923 (setq gnus-headers-retrieved-by | |
3924 (gnus-retrieve-headers | |
3925 articles gnus-newsgroup-name | |
3926 ;; We might want to fetch old headers, but | |
3927 ;; 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
|
3928 (and (or (and |
17493 | 3929 (not (eq gnus-fetch-old-headers 'some)) |
3930 (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
|
3931 (> (length articles) 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3932 gnus-fetch-old-headers)))) |
17493 | 3933 (gnus-get-newsgroup-headers-xover |
3934 articles nil nil gnus-newsgroup-name t) | |
3935 (gnus-get-newsgroup-headers))) | |
3936 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name) | |
3937 | |
3938 ;; Kludge to avoid having cached articles nixed out in virtual groups. | |
3939 (when cached | |
3940 (setq gnus-newsgroup-cached cached)) | |
3941 | |
3942 ;; Suppress duplicates? | |
3943 (when gnus-suppress-duplicates | |
3944 (gnus-dup-suppress-articles)) | |
3945 | |
3946 ;; Set the initial limit. | |
3947 (setq gnus-newsgroup-limit (copy-sequence articles)) | |
3948 ;; Remove canceled articles from the list of unread articles. | |
3949 (setq gnus-newsgroup-unreads | |
3950 (gnus-set-sorted-intersection | |
3951 gnus-newsgroup-unreads | |
3952 (setq fetched-articles | |
3953 (mapcar (lambda (headers) (mail-header-number headers)) | |
3954 gnus-newsgroup-headers)))) | |
3955 ;; Removed marked articles that do not exist. | |
3956 (gnus-update-missing-marks | |
3957 (gnus-sorted-complement fetched-articles articles)) | |
3958 ;; 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
|
3959 (when (and gnus-fetch-old-headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3960 (eq gnus-headers-retrieved-by 'nov)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3961 (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
|
3962 (gnus-build-all-threads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3963 (gnus-build-old-threads))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3964 ;; 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
|
3965 (when gnus-agent |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3966 (gnus-agent-get-undownloaded-list)) |
17493 | 3967 ;; Check whether auto-expire is to be done in this group. |
3968 (setq gnus-newsgroup-auto-expire | |
3969 (gnus-group-auto-expirable-p group)) | |
3970 ;; Set up the article buffer now, if necessary. | |
3971 (unless gnus-single-article-buffer | |
3972 (gnus-article-setup-buffer)) | |
3973 ;; First and last article in this newsgroup. | |
3974 (when gnus-newsgroup-headers | |
3975 (setq gnus-newsgroup-begin | |
3976 (mail-header-number (car gnus-newsgroup-headers)) | |
3977 gnus-newsgroup-end | |
3978 (mail-header-number | |
3979 (gnus-last-element gnus-newsgroup-headers)))) | |
3980 ;; GROUP is successfully selected. | |
3981 (or gnus-newsgroup-headers t))))) | |
3982 | |
3983 (defun gnus-articles-to-read (group &optional read-all) | |
3984 ;; Find out what articles the user wants to read. | |
3985 (let* ((articles | |
3986 ;; Select all articles if `read-all' is non-nil, or if there | |
3987 ;; are no unread articles. | |
3988 (if (or read-all | |
3989 (and (zerop (length gnus-newsgroup-marked)) | |
3990 (zerop (length gnus-newsgroup-unreads))) | |
3991 (eq (gnus-group-find-parameter group 'display) | |
3992 'all)) | |
3993 (gnus-uncompress-range (gnus-active group)) | |
3994 (sort (append gnus-newsgroup-dormant gnus-newsgroup-marked | |
3995 (copy-sequence gnus-newsgroup-unreads)) | |
3996 '<))) | |
3997 (scored-list (gnus-killed-articles gnus-newsgroup-killed articles)) | |
3998 (scored (length scored-list)) | |
3999 (number (length articles)) | |
4000 (marked (+ (length gnus-newsgroup-marked) | |
4001 (length gnus-newsgroup-dormant))) | |
4002 (select | |
4003 (cond | |
4004 ((numberp read-all) | |
4005 read-all) | |
4006 (t | |
4007 (condition-case () | |
4008 (cond | |
4009 ((and (or (<= scored marked) (= scored number)) | |
4010 (numberp gnus-large-newsgroup) | |
4011 (> number gnus-large-newsgroup)) | |
4012 (let ((input | |
4013 (read-string | |
4014 (format | |
4015 "How many articles from %s (default %d): " | |
4016 (gnus-limit-string gnus-newsgroup-name 35) | |
4017 number)))) | |
4018 (if (string-match "^[ \t]*$" input) number input))) | |
4019 ((and (> scored marked) (< scored number) | |
4020 (> (- scored number) 20)) | |
4021 (let ((input | |
4022 (read-string | |
4023 (format "%s %s (%d scored, %d total): " | |
4024 "How many articles from" | |
4025 group scored number)))) | |
4026 (if (string-match "^[ \t]*$" input) | |
4027 number input))) | |
4028 (t number)) | |
4029 (quit nil)))))) | |
4030 (setq select (if (stringp select) (string-to-number select) select)) | |
4031 (if (or (null select) (zerop select)) | |
4032 select | |
4033 (if (and (not (zerop scored)) (<= (abs select) scored)) | |
4034 (progn | |
4035 (setq articles (sort scored-list '<)) | |
4036 (setq number (length articles))) | |
4037 (setq articles (copy-sequence articles))) | |
4038 | |
4039 (when (< (abs select) number) | |
4040 (if (< select 0) | |
4041 ;; Select the N oldest articles. | |
4042 (setcdr (nthcdr (1- (abs select)) articles) nil) | |
4043 ;; Select the N most recent articles. | |
4044 (setq articles (nthcdr (- number select) articles)))) | |
4045 (setq gnus-newsgroup-unselected | |
4046 (gnus-sorted-intersection | |
4047 gnus-newsgroup-unreads | |
4048 (gnus-sorted-complement gnus-newsgroup-unreads articles))) | |
4049 articles))) | |
4050 | |
4051 (defun gnus-killed-articles (killed articles) | |
4052 (let (out) | |
4053 (while articles | |
4054 (when (inline (gnus-member-of-range (car articles) killed)) | |
4055 (push (car articles) out)) | |
4056 (setq articles (cdr articles))) | |
4057 out)) | |
4058 | |
4059 (defun gnus-uncompress-marks (marks) | |
4060 "Uncompress the mark ranges in MARKS." | |
4061 (let ((uncompressed '(score bookmark)) | |
4062 out) | |
4063 (while marks | |
4064 (if (memq (caar marks) uncompressed) | |
4065 (push (car marks) out) | |
4066 (push (cons (caar marks) (gnus-uncompress-range (cdar marks))) out)) | |
4067 (setq marks (cdr marks))) | |
4068 out)) | |
4069 | |
4070 (defun gnus-adjust-marked-articles (info) | |
4071 "Set all article lists and remove all marks that are no longer legal." | |
4072 (let* ((marked-lists (gnus-info-marks info)) | |
4073 (active (gnus-active (gnus-info-group info))) | |
4074 (min (car active)) | |
4075 (max (cdr active)) | |
4076 (types gnus-article-mark-lists) | |
4077 (uncompressed '(score bookmark killed)) | |
4078 marks var articles article mark) | |
4079 | |
4080 (while marked-lists | |
4081 (setq marks (pop marked-lists)) | |
4082 (set (setq var (intern (format "gnus-newsgroup-%s" | |
4083 (car (rassq (setq mark (car marks)) | |
4084 types))))) | |
4085 (if (memq (car marks) uncompressed) (cdr marks) | |
4086 (gnus-uncompress-range (cdr marks)))) | |
4087 | |
4088 (setq articles (symbol-value var)) | |
4089 | |
4090 ;; All articles have to be subsets of the active articles. | |
4091 (cond | |
4092 ;; Adjust "simple" lists. | |
4093 ((memq mark '(tick dormant expire reply save)) | |
4094 (while articles | |
4095 (when (or (< (setq article (pop articles)) min) (> article max)) | |
4096 (set var (delq article (symbol-value var)))))) | |
4097 ;; Adjust assocs. | |
4098 ((memq mark uncompressed) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4099 (when (not (listp (cdr (symbol-value var)))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4100 (set var (list (symbol-value var)))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4101 (when (not (listp (cdr articles))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4102 (setq articles (list articles))) |
17493 | 4103 (while articles |
4104 (when (or (not (consp (setq article (pop articles)))) | |
4105 (< (car article) min) | |
4106 (> (car article) max)) | |
4107 (set var (delq article (symbol-value var)))))))))) | |
4108 | |
4109 (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
|
4110 "Go through the list of MISSING articles and remove them from the mark lists." |
17493 | 4111 (when missing |
4112 (let ((types gnus-article-mark-lists) | |
4113 var m) | |
4114 ;; Go through all types. | |
4115 (while types | |
4116 (setq var (intern (format "gnus-newsgroup-%s" (car (pop types))))) | |
4117 (when (symbol-value var) | |
4118 ;; This list has articles. So we delete all missing articles | |
4119 ;; from it. | |
4120 (setq m missing) | |
4121 (while m | |
4122 (set var (delq (pop m) (symbol-value var))))))))) | |
4123 | |
4124 (defun gnus-update-marks () | |
4125 "Enter the various lists of marked articles into the newsgroup info list." | |
4126 (let ((types gnus-article-mark-lists) | |
4127 (info (gnus-get-info gnus-newsgroup-name)) | |
4128 (uncompressed '(score bookmark killed)) | |
4129 type list newmarked symbol) | |
4130 (when info | |
4131 ;; Add all marks lists that are non-nil to the list of marks lists. | |
4132 (while (setq type (pop types)) | |
4133 (when (setq list (symbol-value | |
4134 (setq symbol | |
4135 (intern (format "gnus-newsgroup-%s" | |
4136 (car type)))))) | |
4137 | |
4138 ;; Get rid of the entries of the articles that have the | |
4139 ;; default score. | |
4140 (when (and (eq (cdr type) 'score) | |
4141 gnus-save-score | |
4142 list) | |
4143 (let* ((arts list) | |
4144 (prev (cons nil list)) | |
4145 (all prev)) | |
4146 (while arts | |
4147 (if (or (not (consp (car arts))) | |
4148 (= (cdar arts) gnus-summary-default-score)) | |
4149 (setcdr prev (cdr arts)) | |
4150 (setq prev arts)) | |
4151 (setq arts (cdr arts))) | |
4152 (setq list (cdr all)))) | |
4153 | |
4154 (push (cons (cdr type) | |
4155 (if (memq (cdr type) uncompressed) list | |
4156 (gnus-compress-sequence | |
4157 (set symbol (sort list '<)) t))) | |
4158 newmarked))) | |
4159 | |
4160 ;; Enter these new marks into the info of the group. | |
4161 (if (nthcdr 3 info) | |
4162 (setcar (nthcdr 3 info) newmarked) | |
4163 ;; Add the marks lists to the end of the info. | |
4164 (when newmarked | |
4165 (setcdr (nthcdr 2 info) (list newmarked)))) | |
4166 | |
4167 ;; Cut off the end of the info if there's nothing else there. | |
4168 (let ((i 5)) | |
4169 (while (and (> i 2) | |
4170 (not (nth i info))) | |
4171 (when (nthcdr (decf i) info) | |
4172 (setcdr (nthcdr i info) nil))))))) | |
4173 | |
4174 (defun gnus-set-mode-line (where) | |
4175 "This function sets the mode line of the article or summary buffers. | |
4176 If WHERE is `summary', the summary mode line format will be used." | |
4177 ;; Is this mode line one we keep updated? | |
4178 (when (memq where gnus-updated-mode-lines) | |
4179 (let (mode-string) | |
4180 (save-excursion | |
4181 ;; We evaluate this in the summary buffer since these | |
4182 ;; variables are buffer-local to that buffer. | |
4183 (set-buffer gnus-summary-buffer) | |
4184 ;; We bind all these variables that are used in the `eval' form | |
4185 ;; below. | |
4186 (let* ((mformat (symbol-value | |
4187 (intern | |
4188 (format "gnus-%s-mode-line-format-spec" where)))) | |
4189 (gnus-tmp-group-name gnus-newsgroup-name) | |
4190 (gnus-tmp-article-number (or gnus-current-article 0)) | |
4191 (gnus-tmp-unread gnus-newsgroup-unreads) | |
4192 (gnus-tmp-unread-and-unticked (length gnus-newsgroup-unreads)) | |
4193 (gnus-tmp-unselected (length gnus-newsgroup-unselected)) | |
4194 (gnus-tmp-unread-and-unselected | |
4195 (cond ((and (zerop gnus-tmp-unread-and-unticked) | |
4196 (zerop gnus-tmp-unselected)) | |
4197 "") | |
4198 ((zerop gnus-tmp-unselected) | |
4199 (format "{%d more}" gnus-tmp-unread-and-unticked)) | |
4200 (t (format "{%d(+%d) more}" | |
4201 gnus-tmp-unread-and-unticked | |
4202 gnus-tmp-unselected)))) | |
4203 (gnus-tmp-subject | |
4204 (if (and gnus-current-headers | |
4205 (vectorp gnus-current-headers)) | |
4206 (gnus-mode-string-quote | |
4207 (mail-header-subject gnus-current-headers)) | |
4208 "")) | |
4209 bufname-length max-len | |
4210 gnus-tmp-header);; passed as argument to any user-format-funcs | |
4211 (setq mode-string (eval mformat)) | |
4212 (setq bufname-length (if (string-match "%b" mode-string) | |
4213 (- (length | |
4214 (buffer-name | |
4215 (if (eq where 'summary) | |
4216 nil | |
4217 (get-buffer gnus-article-buffer)))) | |
4218 2) | |
4219 0)) | |
4220 (setq max-len (max 4 (if gnus-mode-non-string-length | |
4221 (- (window-width) | |
4222 gnus-mode-non-string-length | |
4223 bufname-length) | |
4224 (length mode-string)))) | |
4225 ;; We might have to chop a bit of the string off... | |
4226 (when (> (length mode-string) max-len) | |
4227 (setq mode-string | |
4228 (concat (gnus-truncate-string mode-string (- max-len 3)) | |
4229 "..."))) | |
4230 ;; Pad the mode string a bit. | |
4231 (setq mode-string (format (format "%%-%ds" max-len) mode-string)))) | |
4232 ;; Update the mode line. | |
4233 (setq mode-line-buffer-identification | |
4234 (gnus-mode-line-buffer-identification (list mode-string))) | |
4235 (set-buffer-modified-p t)))) | |
4236 | |
4237 (defun gnus-create-xref-hashtb (from-newsgroup headers unreads) | |
4238 "Go through the HEADERS list and add all Xrefs to a hash table. | |
4239 The resulting hash table is returned, or nil if no Xrefs were found." | |
4240 (let* ((virtual (gnus-virtual-group-p from-newsgroup)) | |
4241 (prefix (if virtual "" (gnus-group-real-prefix from-newsgroup))) | |
4242 (xref-hashtb (gnus-make-hashtable)) | |
4243 start group entry number xrefs header) | |
4244 (while headers | |
4245 (setq header (pop headers)) | |
4246 (when (and (setq xrefs (mail-header-xref header)) | |
4247 (not (memq (setq number (mail-header-number header)) | |
4248 unreads))) | |
4249 (setq start 0) | |
4250 (while (string-match "\\([^ ]+\\)[:/]\\([0-9]+\\)" xrefs start) | |
4251 (setq start (match-end 0)) | |
4252 (setq group (if prefix | |
4253 (concat prefix (substring xrefs (match-beginning 1) | |
4254 (match-end 1))) | |
4255 (substring xrefs (match-beginning 1) (match-end 1)))) | |
4256 (setq number | |
4257 (string-to-int (substring xrefs (match-beginning 2) | |
4258 (match-end 2)))) | |
4259 (if (setq entry (gnus-gethash group xref-hashtb)) | |
4260 (setcdr entry (cons number (cdr entry))) | |
4261 (gnus-sethash group (cons number nil) xref-hashtb))))) | |
4262 (and start xref-hashtb))) | |
4263 | |
4264 (defun gnus-mark-xrefs-as-read (from-newsgroup headers unreads) | |
4265 "Look through all the headers and mark the Xrefs as read." | |
4266 (let ((virtual (gnus-virtual-group-p from-newsgroup)) | |
4267 name entry info xref-hashtb idlist method nth4) | |
4268 (save-excursion | |
4269 (set-buffer gnus-group-buffer) | |
4270 (when (setq xref-hashtb | |
4271 (gnus-create-xref-hashtb from-newsgroup headers unreads)) | |
4272 (mapatoms | |
4273 (lambda (group) | |
4274 (unless (string= from-newsgroup (setq name (symbol-name group))) | |
4275 (setq idlist (symbol-value group)) | |
4276 ;; Dead groups are not updated. | |
4277 (and (prog1 | |
4278 (setq entry (gnus-gethash name gnus-newsrc-hashtb) | |
4279 info (nth 2 entry)) | |
4280 (when (stringp (setq nth4 (gnus-info-method info))) | |
4281 (setq nth4 (gnus-server-to-method nth4)))) | |
4282 ;; Only do the xrefs if the group has the same | |
4283 ;; select method as the group we have just read. | |
4284 (or (gnus-methods-equal-p | |
4285 nth4 (gnus-find-method-for-group from-newsgroup)) | |
4286 virtual | |
4287 (equal nth4 (setq method (gnus-find-method-for-group | |
4288 from-newsgroup))) | |
4289 (and (equal (car nth4) (car method)) | |
4290 (equal (nth 1 nth4) (nth 1 method)))) | |
4291 gnus-use-cross-reference | |
4292 (or (not (eq gnus-use-cross-reference t)) | |
4293 virtual | |
4294 ;; Only do cross-references on subscribed | |
4295 ;; groups, if that is what is wanted. | |
4296 (<= (gnus-info-level info) gnus-level-subscribed)) | |
4297 (gnus-group-make-articles-read name idlist)))) | |
4298 xref-hashtb))))) | |
4299 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4300 (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
|
4301 (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
|
4302 (info (nth 2 entry)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4303 (active (gnus-active group)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4304 ninfo) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4305 (when entry |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4306 ;; First peel off all illegal article numbers. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4307 (when active |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4308 (let ((ids articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4309 id first) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4310 (while (setq id (pop ids)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4311 (when (and first (> id (cdr active))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4312 ;; 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
|
4313 ;; 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
|
4314 ;; 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
|
4315 ;; 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
|
4316 ;; 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
|
4317 ;; 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
|
4318 ;; 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
|
4319 ;; crossposting thingy will *increase* the number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4320 ;; 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
|
4321 (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
|
4322 (when (or (> id (cdr active)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4323 (< id (car active))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4324 (setq articles (delq id articles)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4325 ;; 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
|
4326 (if (and active |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4327 (null (gnus-info-read info)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4328 (> (car active) 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4329 (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
|
4330 (setq ninfo (gnus-info-read info))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4331 ;; 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
|
4332 (gnus-add-to-range |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4333 ninfo (setq articles (sort articles '<)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4334 |
17493 | 4335 (defun gnus-group-make-articles-read (group articles) |
4336 "Update the info of GROUP to say that ARTICLES are read." | |
4337 (let* ((num 0) | |
4338 (entry (gnus-gethash group gnus-newsrc-hashtb)) | |
4339 (info (nth 2 entry)) | |
4340 (active (gnus-active group)) | |
4341 range) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4342 (when entry |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4343 (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
|
4344 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4345 (set-buffer gnus-group-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4346 (gnus-undo-register |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4347 `(progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4348 (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
|
4349 (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
|
4350 (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
|
4351 (gnus-group-update-group ,group t)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4352 ;; 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
|
4353 (gnus-info-set-read info range) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4354 ;; 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
|
4355 ;; articles there are in this group. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4356 (when active |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4357 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4358 ((not range) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4359 (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
|
4360 ((not (listp (cdr range))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4361 (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
|
4362 (car range))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4363 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4364 (while range |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4365 (if (numberp (car range)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4366 (setq num (1+ num)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4367 (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
|
4368 (setq range (cdr range))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4369 (setq num (- (cdr active) num)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4370 ;; Update the number of unread articles. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4371 (setcar entry num) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4372 ;; Update the group buffer. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4373 (gnus-group-update-group group t))))) |
17493 | 4374 |
4375 (defun gnus-methods-equal-p (m1 m2) | |
4376 (let ((m1 (or m1 gnus-select-method)) | |
4377 (m2 (or m2 gnus-select-method))) | |
4378 (or (equal m1 m2) | |
4379 (and (eq (car m1) (car m2)) | |
4380 (or (not (memq 'address (assoc (symbol-name (car m1)) | |
4381 gnus-valid-select-methods))) | |
4382 (equal (nth 1 m1) (nth 1 m2))))))) | |
4383 | |
4384 (defvar gnus-newsgroup-none-id 0) | |
4385 | |
4386 (defun gnus-get-newsgroup-headers (&optional dependencies force-new) | |
4387 (let ((cur nntp-server-buffer) | |
4388 (dependencies | |
4389 (or dependencies | |
4390 (save-excursion (set-buffer gnus-summary-buffer) | |
4391 gnus-newsgroup-dependencies))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4392 headers id end ref) |
17493 | 4393 (save-excursion |
4394 (set-buffer nntp-server-buffer) | |
4395 ;; Translate all TAB characters into SPACE characters. | |
4396 (subst-char-in-region (point-min) (point-max) ?\t ? t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4397 (gnus-run-hooks 'gnus-parse-headers-hook) |
17493 | 4398 (let ((case-fold-search t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4399 in-reply-to header p lines chars) |
17493 | 4400 (goto-char (point-min)) |
4401 ;; Search to the beginning of the next header. Error messages | |
4402 ;; do not begin with 2 or 3. | |
4403 (while (re-search-forward "^[23][0-9]+ " nil t) | |
4404 (setq id nil | |
4405 ref nil) | |
4406 ;; This implementation of this function, with nine | |
4407 ;; search-forwards instead of the one re-search-forward and | |
4408 ;; a case (which basically was the old function) is actually | |
4409 ;; about twice as fast, even though it looks messier. You | |
4410 ;; can't have everything, I guess. Speed and elegance | |
4411 ;; doesn't always go hand in hand. | |
4412 (setq | |
4413 header | |
4414 (vector | |
4415 ;; Number. | |
4416 (prog1 | |
4417 (read cur) | |
4418 (end-of-line) | |
4419 (setq p (point)) | |
4420 (narrow-to-region (point) | |
4421 (or (and (search-forward "\n.\n" nil t) | |
4422 (- (point) 2)) | |
4423 (point)))) | |
4424 ;; Subject. | |
4425 (progn | |
4426 (goto-char p) | |
4427 (if (search-forward "\nsubject: " nil t) | |
19594
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
4428 (funcall |
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
4429 gnus-unstructured-field-decoder (nnheader-header-value)) |
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
4430 "(none)")) |
17493 | 4431 ;; From. |
4432 (progn | |
4433 (goto-char p) | |
4434 (if (search-forward "\nfrom: " nil t) | |
19594
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
4435 (funcall |
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
4436 gnus-structured-field-decoder (nnheader-header-value)) |
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
4437 "(nobody)")) |
17493 | 4438 ;; Date. |
4439 (progn | |
4440 (goto-char p) | |
4441 (if (search-forward "\ndate: " nil t) | |
4442 (nnheader-header-value) "")) | |
4443 ;; Message-ID. | |
4444 (progn | |
4445 (goto-char p) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4446 (setq id (if (re-search-forward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4447 "^message-id: *\\(<[^\n\t> ]+>\\)" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4448 ;; 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
|
4449 ;; is (somewhat) syntactically valid. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4450 (buffer-substring (match-beginning 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4451 (match-end 1)) |
17493 | 4452 ;; If there was no message-id, we just fake one |
4453 ;; to make subsequent routines simpler. | |
4454 (nnheader-generate-fake-message-id)))) | |
4455 ;; References. | |
4456 (progn | |
4457 (goto-char p) | |
4458 (if (search-forward "\nreferences: " nil t) | |
4459 (progn | |
4460 (setq end (point)) | |
4461 (prog1 | |
4462 (nnheader-header-value) | |
4463 (setq ref | |
4464 (buffer-substring | |
4465 (progn | |
4466 (end-of-line) | |
4467 (search-backward ">" end t) | |
4468 (1+ (point))) | |
4469 (progn | |
4470 (search-backward "<" end t) | |
4471 (point)))))) | |
4472 ;; Get the references from the in-reply-to header if there | |
4473 ;; were no references and the in-reply-to header looks | |
4474 ;; promising. | |
4475 (if (and (search-forward "\nin-reply-to: " nil t) | |
4476 (setq in-reply-to (nnheader-header-value)) | |
4477 (string-match "<[^>]+>" in-reply-to)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4478 (let (ref2) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4479 (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
|
4480 (match-end 0))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4481 (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
|
4482 (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
|
4483 (match-end 0))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4484 (when (> (length ref2) (length ref)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4485 (setq ref ref2))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4486 ref) |
17493 | 4487 (setq ref nil)))) |
4488 ;; Chars. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4489 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4490 (goto-char p) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4491 (if (search-forward "\nchars: " nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4492 (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
|
4493 chars 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4494 0)) |
17493 | 4495 ;; Lines. |
4496 (progn | |
4497 (goto-char p) | |
4498 (if (search-forward "\nlines: " nil t) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4499 (if (numberp (setq lines (ignore-errors (read cur)))) |
17493 | 4500 lines 0) |
4501 0)) | |
4502 ;; Xref. | |
4503 (progn | |
4504 (goto-char p) | |
4505 (and (search-forward "\nxref: " nil t) | |
4506 (nnheader-header-value))))) | |
4507 (when (equal id ref) | |
4508 (setq ref nil)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4509 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4510 (when gnus-alter-header-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4511 (funcall gnus-alter-header-function header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4512 (setq id (mail-header-id header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4513 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
|
4514 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4515 (when (setq header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4516 (gnus-dependencies-add-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4517 header dependencies force-new)) |
17493 | 4518 (push header headers)) |
4519 (goto-char (point-max)) | |
4520 (widen)) | |
4521 (nreverse headers))))) | |
4522 | |
4523 ;; Goes through the xover lines and returns a list of vectors | |
4524 (defun gnus-get-newsgroup-headers-xover (sequence &optional | |
4525 force-new dependencies | |
4526 group also-fetch-heads) | |
4527 "Parse the news overview data in the server buffer, and return a | |
4528 list of headers that match SEQUENCE (see `nntp-retrieve-headers')." | |
4529 ;; Get the Xref when the users reads the articles since most/some | |
4530 ;; NNTP servers do not include Xrefs when using XOVER. | |
4531 (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs)) | |
4532 (let ((cur nntp-server-buffer) | |
4533 (dependencies (or dependencies gnus-newsgroup-dependencies)) | |
4534 number headers header) | |
4535 (save-excursion | |
4536 (set-buffer nntp-server-buffer) | |
4537 ;; 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
|
4538 (gnus-run-hooks 'gnus-parse-headers-hook) |
17493 | 4539 (goto-char (point-min)) |
4540 (while (not (eobp)) | |
4541 (condition-case () | |
4542 (while (and sequence (not (eobp))) | |
4543 (setq number (read cur)) | |
4544 (while (and sequence | |
4545 (< (car sequence) number)) | |
4546 (setq sequence (cdr sequence))) | |
4547 (and sequence | |
4548 (eq number (car sequence)) | |
4549 (progn | |
4550 (setq sequence (cdr sequence)) | |
4551 (setq header (inline | |
4552 (gnus-nov-parse-line | |
4553 number dependencies force-new)))) | |
4554 (push header headers)) | |
4555 (forward-line 1)) | |
4556 (error | |
4557 (gnus-error 4 "Strange nov line (%d)" | |
4558 (count-lines (point-min) (point))))) | |
4559 (forward-line 1)) | |
4560 ;; A common bug in inn is that if you have posted an article and | |
4561 ;; then retrieves the active file, it will answer correctly -- | |
4562 ;; the new article is included. However, a NOV entry for the | |
4563 ;; article may not have been generated yet, so this may fail. | |
4564 ;; We work around this problem by retrieving the last few | |
4565 ;; headers using HEAD. | |
4566 (if (or (not also-fetch-heads) | |
4567 (not sequence)) | |
4568 ;; We (probably) got all the headers. | |
4569 (nreverse headers) | |
4570 (let ((gnus-nov-is-evil t)) | |
4571 (nconc | |
4572 (nreverse headers) | |
4573 (when (gnus-retrieve-headers sequence group) | |
4574 (gnus-get-newsgroup-headers)))))))) | |
4575 | |
4576 (defun gnus-article-get-xrefs () | |
4577 "Fill in the Xref value in `gnus-current-headers', if necessary. | |
4578 This is meant to be called in `gnus-article-internal-prepare-hook'." | |
4579 (let ((headers (save-excursion (set-buffer gnus-summary-buffer) | |
4580 gnus-current-headers))) | |
4581 (or (not gnus-use-cross-reference) | |
4582 (not headers) | |
4583 (and (mail-header-xref headers) | |
4584 (not (string= (mail-header-xref headers) ""))) | |
4585 (let ((case-fold-search t) | |
4586 xref) | |
4587 (save-restriction | |
4588 (nnheader-narrow-to-headers) | |
4589 (goto-char (point-min)) | |
4590 (when (or (and (eq (downcase (following-char)) ?x) | |
4591 (looking-at "Xref:")) | |
4592 (search-forward "\nXref:" nil t)) | |
4593 (goto-char (1+ (match-end 0))) | |
4594 (setq xref (buffer-substring (point) | |
4595 (progn (end-of-line) (point)))) | |
4596 (mail-header-set-xref headers xref))))))) | |
4597 | |
4598 (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
|
4599 "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
|
4600 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
|
4601 the subject line on." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4602 (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
|
4603 (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
|
4604 (header (cond ((and old-header use-old-header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4605 old-header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4606 ((and (numberp id) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4607 (gnus-number-to-header id)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4608 (gnus-number-to-header id)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4609 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4610 (gnus-read-header id)))) |
17493 | 4611 (number (and (numberp id) id)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4612 d) |
17493 | 4613 (when header |
4614 ;; Rebuild the thread that this article is part of and go to the | |
4615 ;; article we have fetched. | |
4616 (when (and (not gnus-show-threads) | |
4617 old-header) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4618 (when (and number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4619 (setq d (gnus-data-find (mail-header-number old-header)))) |
17493 | 4620 (goto-char (gnus-data-pos d)) |
4621 (gnus-data-remove | |
4622 number | |
4623 (- (gnus-point-at-bol) | |
4624 (prog1 | |
4625 (1+ (gnus-point-at-eol)) | |
4626 (gnus-delete-line)))))) | |
4627 (when old-header | |
4628 (mail-header-set-number header (mail-header-number old-header))) | |
4629 (setq gnus-newsgroup-sparse | |
4630 (delq (setq number (mail-header-number header)) | |
4631 gnus-newsgroup-sparse)) | |
4632 (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
|
4633 (push number gnus-newsgroup-limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4634 (gnus-rebuild-thread (mail-header-id header) line) |
17493 | 4635 (gnus-summary-goto-subject number nil t)) |
4636 (when (and (numberp number) | |
4637 (> number 0)) | |
4638 ;; We have to update the boundaries even if we can't fetch the | |
4639 ;; article if ID is a number -- so that the next `P' or `N' | |
4640 ;; command will fetch the previous (or next) article even | |
4641 ;; if the one we tried to fetch this time has been canceled. | |
4642 (when (> number gnus-newsgroup-end) | |
4643 (setq gnus-newsgroup-end number)) | |
4644 (when (< number gnus-newsgroup-begin) | |
4645 (setq gnus-newsgroup-begin number)) | |
4646 (setq gnus-newsgroup-unselected | |
4647 (delq number gnus-newsgroup-unselected))) | |
4648 ;; Report back a success? | |
4649 (and header (mail-header-number header)))) | |
4650 | |
4651 ;;; Process/prefix in the summary buffer | |
4652 | |
4653 (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
|
4654 "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
|
4655 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
|
4656 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
|
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-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4659 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4660 (n |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4661 ;; A numerical prefix has been given. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4662 (setq n (prefix-numeric-value n)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4663 (let ((backward (< n 0)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4664 (n (abs (prefix-numeric-value n))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4665 articles article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4666 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4667 (while |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4668 (and (> n 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4669 (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
|
4670 articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4671 (if backward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4672 (gnus-summary-find-prev nil article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4673 (gnus-summary-find-next nil article))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4674 (decf n))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4675 (nreverse articles))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4676 ((and (gnus-region-active-p) (mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4677 (message "region active") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4678 ;; 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
|
4679 (let ((max (max (point) (mark))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4680 articles article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4681 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4682 (goto-char (min (min (point) (mark)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4683 (while |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4684 (and |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4685 (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
|
4686 (gnus-summary-find-next nil article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4687 (< (point) max))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4688 (nreverse articles)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4689 (gnus-newsgroup-processable |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4690 ;; There are process-marked articles present. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4691 ;; Save current state. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4692 (gnus-summary-save-process-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4693 ;; Return the list. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4694 (reverse gnus-newsgroup-processable)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4695 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4696 ;; Just return the current article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4697 (list (gnus-summary-article-number)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4698 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4699 (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
|
4700 "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
|
4701 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
|
4702 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
|
4703 (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
|
4704 `(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
|
4705 (while ,articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4706 (gnus-summary-goto-subject (car ,articles)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4707 ,@forms)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4708 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4709 (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
|
4710 (put 'gnus-summary-iterate 'edebug-form-spec '(form body)) |
17493 | 4711 |
4712 (defun gnus-summary-save-process-mark () | |
4713 "Push the current set of process marked articles on the stack." | |
4714 (interactive) | |
4715 (push (copy-sequence gnus-newsgroup-processable) | |
4716 gnus-newsgroup-process-stack)) | |
4717 | |
4718 (defun gnus-summary-kill-process-mark () | |
4719 "Push the current set of process marked articles on the stack and unmark." | |
4720 (interactive) | |
4721 (gnus-summary-save-process-mark) | |
4722 (gnus-summary-unmark-all-processable)) | |
4723 | |
4724 (defun gnus-summary-yank-process-mark () | |
4725 "Pop the last process mark state off the stack and restore it." | |
4726 (interactive) | |
4727 (unless gnus-newsgroup-process-stack | |
4728 (error "Empty mark stack")) | |
4729 (gnus-summary-process-mark-set (pop gnus-newsgroup-process-stack))) | |
4730 | |
4731 (defun gnus-summary-process-mark-set (set) | |
4732 "Make SET into the current process marked articles." | |
4733 (gnus-summary-unmark-all-processable) | |
4734 (while set | |
4735 (gnus-summary-set-process-mark (pop set)))) | |
4736 | |
4737 ;;; Searching and stuff | |
4738 | |
4739 (defun gnus-summary-search-group (&optional backward use-level) | |
4740 "Search for next unread newsgroup. | |
4741 If optional argument BACKWARD is non-nil, search backward instead." | |
4742 (save-excursion | |
4743 (set-buffer gnus-group-buffer) | |
4744 (when (gnus-group-search-forward | |
4745 backward nil (if use-level (gnus-group-group-level) nil)) | |
4746 (gnus-group-group-name)))) | |
4747 | |
4748 (defun gnus-summary-best-group (&optional exclude-group) | |
4749 "Find the name of the best unread group. | |
4750 If EXCLUDE-GROUP, do not go to this group." | |
4751 (save-excursion | |
4752 (set-buffer gnus-group-buffer) | |
4753 (save-excursion | |
4754 (gnus-group-best-unread-group exclude-group)))) | |
4755 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4756 (defun gnus-summary-find-next (&optional unread article backward undownloaded) |
17493 | 4757 (if backward (gnus-summary-find-prev) |
4758 (let* ((dummy (gnus-summary-article-intangible-p)) | |
4759 (article (or article (gnus-summary-article-number))) | |
4760 (arts (gnus-data-find-list article)) | |
4761 result) | |
4762 (when (and (not dummy) | |
4763 (or (not gnus-summary-check-current) | |
4764 (not unread) | |
4765 (not (gnus-data-unread-p (car arts))))) | |
4766 (setq arts (cdr arts))) | |
4767 (when (setq result | |
4768 (if unread | |
4769 (progn | |
4770 (while arts | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4771 (when (or (and undownloaded |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4772 (eq gnus-undownloaded-mark |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4773 (gnus-data-mark (car arts)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4774 (gnus-data-unread-p (car arts))) |
17493 | 4775 (setq result (car arts) |
4776 arts nil)) | |
4777 (setq arts (cdr arts))) | |
4778 result) | |
4779 (car arts))) | |
4780 (goto-char (gnus-data-pos result)) | |
4781 (gnus-data-number result))))) | |
4782 | |
4783 (defun gnus-summary-find-prev (&optional unread article) | |
4784 (let* ((eobp (eobp)) | |
4785 (article (or article (gnus-summary-article-number))) | |
4786 (arts (gnus-data-find-list article (gnus-data-list 'rev))) | |
4787 result) | |
4788 (when (and (not eobp) | |
4789 (or (not gnus-summary-check-current) | |
4790 (not unread) | |
4791 (not (gnus-data-unread-p (car arts))))) | |
4792 (setq arts (cdr arts))) | |
4793 (when (setq result | |
4794 (if unread | |
4795 (progn | |
4796 (while arts | |
4797 (when (gnus-data-unread-p (car arts)) | |
4798 (setq result (car arts) | |
4799 arts nil)) | |
4800 (setq arts (cdr arts))) | |
4801 result) | |
4802 (car arts))) | |
4803 (goto-char (gnus-data-pos result)) | |
4804 (gnus-data-number result)))) | |
4805 | |
4806 (defun gnus-summary-find-subject (subject &optional unread backward article) | |
4807 (let* ((simp-subject (gnus-simplify-subject-fully subject)) | |
4808 (article (or article (gnus-summary-article-number))) | |
4809 (articles (gnus-data-list backward)) | |
4810 (arts (gnus-data-find-list article articles)) | |
4811 result) | |
4812 (when (or (not gnus-summary-check-current) | |
4813 (not unread) | |
4814 (not (gnus-data-unread-p (car arts)))) | |
4815 (setq arts (cdr arts))) | |
4816 (while arts | |
4817 (and (or (not unread) | |
4818 (gnus-data-unread-p (car arts))) | |
4819 (vectorp (gnus-data-header (car arts))) | |
4820 (gnus-subject-equal | |
4821 simp-subject (mail-header-subject (gnus-data-header (car arts))) t) | |
4822 (setq result (car arts) | |
4823 arts nil)) | |
4824 (setq arts (cdr arts))) | |
4825 (and result | |
4826 (goto-char (gnus-data-pos result)) | |
4827 (gnus-data-number result)))) | |
4828 | |
4829 (defun gnus-summary-search-forward (&optional unread subject backward) | |
4830 "Search forward for an article. | |
4831 If UNREAD, look for unread articles. If SUBJECT, look for | |
4832 articles with that subject. If BACKWARD, search backward instead." | |
4833 (cond (subject (gnus-summary-find-subject subject unread backward)) | |
4834 (backward (gnus-summary-find-prev unread)) | |
4835 (t (gnus-summary-find-next unread)))) | |
4836 | |
4837 (defun gnus-recenter (&optional n) | |
4838 "Center point in window and redisplay frame. | |
4839 Also do horizontal recentering." | |
4840 (interactive "P") | |
4841 (when (and gnus-auto-center-summary | |
4842 (not (eq gnus-auto-center-summary 'vertical))) | |
4843 (gnus-horizontal-recenter)) | |
4844 (recenter n)) | |
4845 | |
4846 (defun gnus-summary-recenter () | |
4847 "Center point in the summary window. | |
4848 If `gnus-auto-center-summary' is nil, or the article buffer isn't | |
4849 displayed, no centering will be performed." | |
4850 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle). | |
4851 ;; Recenter only when requested. Suggested by popovich@park.cs.columbia.edu. | |
4852 (let* ((top (cond ((< (window-height) 4) 0) | |
4853 ((< (window-height) 7) 1) | |
4854 (t 2))) | |
4855 (height (1- (window-height))) | |
4856 (bottom (save-excursion (goto-char (point-max)) | |
4857 (forward-line (- height)) | |
4858 (point))) | |
4859 (window (get-buffer-window (current-buffer)))) | |
4860 ;; The user has to want it. | |
4861 (when gnus-auto-center-summary | |
4862 (when (get-buffer-window gnus-article-buffer) | |
4863 ;; Only do recentering when the article buffer is displayed, | |
4864 ;; Set the window start to either `bottom', which is the biggest | |
4865 ;; possible valid number, or the second line from the top, | |
4866 ;; whichever is the least. | |
4867 (set-window-start | |
4868 window (min bottom (save-excursion | |
4869 (forward-line (- top)) (point))))) | |
4870 ;; Do horizontal recentering while we're at it. | |
4871 (when (and (get-buffer-window (current-buffer) t) | |
4872 (not (eq gnus-auto-center-summary 'vertical))) | |
4873 (let ((selected (selected-window))) | |
4874 (select-window (get-buffer-window (current-buffer) t)) | |
4875 (gnus-summary-position-point) | |
4876 (gnus-horizontal-recenter) | |
4877 (select-window selected)))))) | |
4878 | |
4879 (defun gnus-summary-jump-to-group (newsgroup) | |
4880 "Move point to NEWSGROUP in group mode buffer." | |
4881 ;; Keep update point of group mode buffer if visible. | |
4882 (if (eq (current-buffer) (get-buffer gnus-group-buffer)) | |
4883 (save-window-excursion | |
4884 ;; Take care of tree window mode. | |
4885 (when (get-buffer-window gnus-group-buffer) | |
4886 (pop-to-buffer gnus-group-buffer)) | |
4887 (gnus-group-jump-to-group newsgroup)) | |
4888 (save-excursion | |
4889 ;; Take care of tree window mode. | |
4890 (if (get-buffer-window gnus-group-buffer) | |
4891 (pop-to-buffer gnus-group-buffer) | |
4892 (set-buffer gnus-group-buffer)) | |
4893 (gnus-group-jump-to-group newsgroup)))) | |
4894 | |
4895 ;; This function returns a list of article numbers based on the | |
4896 ;; difference between the ranges of read articles in this group and | |
4897 ;; the range of active articles. | |
4898 (defun gnus-list-of-unread-articles (group) | |
4899 (let* ((read (gnus-info-read (gnus-get-info group))) | |
4900 (active (or (gnus-active group) (gnus-activate-group group))) | |
4901 (last (cdr active)) | |
4902 first nlast unread) | |
4903 ;; If none are read, then all are unread. | |
4904 (if (not read) | |
4905 (setq first (car active)) | |
4906 ;; If the range of read articles is a single range, then the | |
4907 ;; first unread article is the article after the last read | |
4908 ;; article. Sounds logical, doesn't it? | |
4909 (if (not (listp (cdr read))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4910 (setq first (max (car active) (1+ (cdr read)))) |
17493 | 4911 ;; `read' is a list of ranges. |
4912 (when (/= (setq nlast (or (and (numberp (car read)) (car read)) | |
4913 (caar read))) | |
4914 1) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4915 (setq first (car active))) |
17493 | 4916 (while read |
4917 (when first | |
4918 (while (< first nlast) | |
4919 (push first unread) | |
4920 (setq first (1+ first)))) | |
4921 (setq first (1+ (if (atom (car read)) (car read) (cdar read)))) | |
4922 (setq nlast (if (atom (cadr read)) (cadr read) (caadr read))) | |
4923 (setq read (cdr read))))) | |
4924 ;; And add the last unread articles. | |
4925 (while (<= first last) | |
4926 (push first unread) | |
4927 (setq first (1+ first))) | |
4928 ;; 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
|
4929 (delq 0 (nreverse unread)))) |
17493 | 4930 |
4931 (defun gnus-list-of-read-articles (group) | |
4932 "Return a list of unread, unticked and non-dormant articles." | |
4933 (let* ((info (gnus-get-info group)) | |
4934 (marked (gnus-info-marks info)) | |
4935 (active (gnus-active group))) | |
4936 (and info active | |
4937 (gnus-set-difference | |
4938 (gnus-sorted-complement | |
4939 (gnus-uncompress-range active) | |
4940 (gnus-list-of-unread-articles group)) | |
4941 (append | |
4942 (gnus-uncompress-range (cdr (assq 'dormant marked))) | |
4943 (gnus-uncompress-range (cdr (assq 'tick marked)))))))) | |
4944 | |
4945 ;; Various summary commands | |
4946 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4947 (defun gnus-summary-select-article-buffer () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4948 "Reconfigure windows to show article buffer." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4949 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4950 (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
|
4951 (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
|
4952 (gnus-configure-windows 'article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4953 (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
|
4954 |
17493 | 4955 (defun gnus-summary-universal-argument (arg) |
4956 "Perform any operation on all articles that are process/prefixed." | |
4957 (interactive "P") | |
4958 (let ((articles (gnus-summary-work-articles arg)) | |
4959 func article) | |
4960 (if (eq | |
4961 (setq | |
4962 func | |
4963 (key-binding | |
4964 (read-key-sequence | |
4965 (substitute-command-keys | |
4966 "\\<gnus-summary-mode-map>\\[gnus-summary-universal-argument]" | |
4967 )))) | |
4968 'undefined) | |
4969 (gnus-error 1 "Undefined key") | |
4970 (save-excursion | |
4971 (while articles | |
4972 (gnus-summary-goto-subject (setq article (pop articles))) | |
4973 (let (gnus-newsgroup-processable) | |
4974 (command-execute func)) | |
4975 (gnus-summary-remove-process-mark article))))) | |
4976 (gnus-summary-position-point)) | |
4977 | |
4978 (defun gnus-summary-toggle-truncation (&optional arg) | |
4979 "Toggle truncation of summary lines. | |
4980 With arg, turn line truncation on iff arg is positive." | |
4981 (interactive "P") | |
4982 (setq truncate-lines | |
4983 (if (null arg) (not truncate-lines) | |
4984 (> (prefix-numeric-value arg) 0))) | |
4985 (redraw-display)) | |
4986 | |
4987 (defun gnus-summary-reselect-current-group (&optional all rescan) | |
4988 "Exit and then reselect the current newsgroup. | |
4989 The prefix argument ALL means to select all articles." | |
4990 (interactive "P") | |
4991 (when (gnus-ephemeral-group-p gnus-newsgroup-name) | |
4992 (error "Ephemeral groups can't be reselected")) | |
4993 (let ((current-subject (gnus-summary-article-number)) | |
4994 (group gnus-newsgroup-name)) | |
4995 (setq gnus-newsgroup-begin nil) | |
4996 (gnus-summary-exit) | |
4997 ;; We have to adjust the point of group mode buffer because | |
4998 ;; point was moved to the next unread newsgroup by exiting. | |
4999 (gnus-summary-jump-to-group group) | |
5000 (when rescan | |
5001 (save-excursion | |
5002 (gnus-group-get-new-news-this-group 1))) | |
5003 (gnus-group-read-group all t) | |
5004 (gnus-summary-goto-subject current-subject nil t))) | |
5005 | |
5006 (defun gnus-summary-rescan-group (&optional all) | |
5007 "Exit the newsgroup, ask for new articles, and select the newsgroup." | |
5008 (interactive "P") | |
5009 (gnus-summary-reselect-current-group all t)) | |
5010 | |
5011 (defun gnus-summary-update-info (&optional non-destructive) | |
5012 (save-excursion | |
5013 (let ((group gnus-newsgroup-name)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5014 (when group |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5015 (when gnus-newsgroup-kill-headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5016 (setq gnus-newsgroup-killed |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5017 (gnus-compress-sequence |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5018 (nconc |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5019 (gnus-set-sorted-intersection |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5020 (gnus-uncompress-range gnus-newsgroup-killed) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5021 (setq gnus-newsgroup-unselected |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5022 (sort gnus-newsgroup-unselected '<))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5023 (setq gnus-newsgroup-unreads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5024 (sort gnus-newsgroup-unreads '<))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5025 t))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5026 (unless (listp (cdr gnus-newsgroup-killed)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5027 (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
|
5028 (let ((headers gnus-newsgroup-headers)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5029 ;; 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
|
5030 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5031 (set-buffer gnus-group-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5032 (gnus-undo-force-boundary)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5033 (gnus-update-read-articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5034 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
|
5035 ;; Set the current article marks. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5036 (let ((gnus-newsgroup-scored |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5037 (if (and (not gnus-save-score) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5038 (not non-destructive)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5039 nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5040 gnus-newsgroup-scored))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5041 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5042 (gnus-update-marks))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5043 ;; Do the cross-ref thing. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5044 (when gnus-use-cross-reference |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5045 (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
|
5046 ;; 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
|
5047 (set-buffer gnus-group-buffer) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5048 (unless (gnus-ephemeral-group-p group) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5049 (gnus-group-update-group group))))))) |
17493 | 5050 |
5051 (defun gnus-summary-save-newsrc (&optional force) | |
5052 "Save the current number of read/marked articles in the dribble buffer. | |
5053 The dribble buffer will then be saved. | |
5054 If FORCE (the prefix), also save the .newsrc file(s)." | |
5055 (interactive "P") | |
5056 (gnus-summary-update-info t) | |
5057 (if force | |
5058 (gnus-save-newsrc-file) | |
5059 (gnus-dribble-save))) | |
5060 | |
5061 (defun gnus-summary-exit (&optional temporary) | |
5062 "Exit reading current newsgroup, and then return to group selection mode. | |
5063 gnus-exit-group-hook is called with no arguments if that value is non-nil." | |
5064 (interactive) | |
5065 (gnus-set-global-variables) | |
5066 (gnus-kill-save-kill-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5067 (gnus-async-halt-prefetch) |
17493 | 5068 (let* ((group gnus-newsgroup-name) |
5069 (quit-config (gnus-group-quit-config gnus-newsgroup-name)) | |
5070 (mode major-mode) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5071 (group-point nil) |
17493 | 5072 (buf (current-buffer))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5073 (gnus-run-hooks 'gnus-summary-prepare-exit-hook) |
17493 | 5074 ;; If we have several article buffers, we kill them at exit. |
5075 (unless gnus-single-article-buffer | |
5076 (gnus-kill-buffer gnus-original-article-buffer) | |
5077 (setq gnus-article-current nil)) | |
5078 (when gnus-use-cache | |
5079 (gnus-cache-possibly-remove-articles) | |
5080 (gnus-cache-save-buffers)) | |
5081 (gnus-async-prefetch-remove-group group) | |
5082 (when gnus-suppress-duplicates | |
5083 (gnus-dup-enter-articles)) | |
5084 (when gnus-use-trees | |
5085 (gnus-tree-close group)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5086 ;; Remove entries for this group. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5087 (nnmail-purge-split-history (gnus-group-real-name group)) |
17493 | 5088 ;; Make all changes in this group permanent. |
5089 (unless quit-config | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5090 (gnus-run-hooks 'gnus-exit-group-hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5091 (gnus-summary-update-info) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5092 ;; Do adaptive scoring, and possibly save score files. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5093 (when gnus-newsgroup-adaptive |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5094 (gnus-score-adaptive)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5095 (when gnus-use-scoring |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5096 (gnus-score-save))) |
17493 | 5097 (gnus-close-group group) |
5098 ;; Make sure where we were, and go to next newsgroup. | |
5099 (set-buffer gnus-group-buffer) | |
5100 (unless quit-config | |
5101 (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
|
5102 (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
|
5103 (unless (or quit-config |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5104 ;; 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
|
5105 ;; buffer, don't skip forwards. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5106 (not (string= group (gnus-group-group-name)))) |
17493 | 5107 (gnus-group-next-unread-group 1)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5108 (setq group-point (point)) |
17493 | 5109 (if temporary |
5110 nil ;Nothing to do. | |
5111 ;; If we have several article buffers, we kill them at exit. | |
5112 (unless gnus-single-article-buffer | |
5113 (gnus-kill-buffer gnus-article-buffer) | |
5114 (gnus-kill-buffer gnus-original-article-buffer) | |
5115 (setq gnus-article-current nil)) | |
5116 (set-buffer buf) | |
5117 (if (not gnus-kill-summary-on-exit) | |
5118 (gnus-deaden-summary) | |
5119 ;; We set all buffer-local variables to nil. It is unclear why | |
5120 ;; this is needed, but if we don't, buffer-local variables are | |
5121 ;; not garbage-collected, it seems. This would the lead to en | |
5122 ;; ever-growing Emacs. | |
5123 (gnus-summary-clear-local-variables) | |
5124 (when (get-buffer gnus-article-buffer) | |
5125 (bury-buffer gnus-article-buffer)) | |
5126 ;; We clear the global counterparts of the buffer-local | |
5127 ;; variables as well, just to be on the safe side. | |
5128 (set-buffer gnus-group-buffer) | |
5129 (gnus-summary-clear-local-variables) | |
5130 ;; Return to group mode buffer. | |
5131 (when (eq mode 'gnus-summary-mode) | |
5132 (gnus-kill-buffer buf))) | |
5133 (setq gnus-current-select-method gnus-select-method) | |
5134 (pop-to-buffer gnus-group-buffer) | |
5135 (if (not quit-config) | |
5136 (progn | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5137 (goto-char group-point) |
17493 | 5138 (gnus-configure-windows 'group 'force)) |
5139 (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
|
5140 ;; Clear the current group name. |
17493 | 5141 (unless quit-config |
5142 (setq gnus-newsgroup-name nil))))) | |
5143 | |
5144 (defalias 'gnus-summary-quit 'gnus-summary-exit-no-update) | |
5145 (defun gnus-summary-exit-no-update (&optional no-questions) | |
5146 "Quit reading current newsgroup without updating read article info." | |
5147 (interactive) | |
5148 (let* ((group gnus-newsgroup-name) | |
5149 (quit-config (gnus-group-quit-config group))) | |
5150 (when (or no-questions | |
5151 gnus-expert-user | |
5152 (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
|
5153 (gnus-async-halt-prefetch) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5154 (gnus-run-hooks 'gnus-summary-prepare-exit-hook) |
17493 | 5155 ;; If we have several article buffers, we kill them at exit. |
5156 (unless gnus-single-article-buffer | |
5157 (gnus-kill-buffer gnus-article-buffer) | |
5158 (gnus-kill-buffer gnus-original-article-buffer) | |
5159 (setq gnus-article-current nil)) | |
5160 (if (not gnus-kill-summary-on-exit) | |
5161 (gnus-deaden-summary) | |
5162 (gnus-close-group group) | |
5163 (gnus-summary-clear-local-variables) | |
5164 (set-buffer gnus-group-buffer) | |
5165 (gnus-summary-clear-local-variables) | |
5166 (when (get-buffer gnus-summary-buffer) | |
5167 (kill-buffer gnus-summary-buffer))) | |
5168 (unless gnus-single-article-buffer | |
5169 (setq gnus-article-current nil)) | |
5170 (when gnus-use-trees | |
5171 (gnus-tree-close group)) | |
5172 (gnus-async-prefetch-remove-group group) | |
5173 (when (get-buffer gnus-article-buffer) | |
5174 (bury-buffer gnus-article-buffer)) | |
5175 ;; Return to the group buffer. | |
5176 (gnus-configure-windows 'group 'force) | |
5177 ;; Clear the current group name. | |
5178 (setq gnus-newsgroup-name nil) | |
5179 (when (equal (gnus-group-group-name) group) | |
5180 (gnus-group-next-unread-group 1)) | |
5181 (when quit-config | |
5182 (gnus-handle-ephemeral-exit quit-config))))) | |
5183 | |
5184 (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
|
5185 "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
|
5186 The state which existed when entering the ephemeral is reset." |
17493 | 5187 (if (not (buffer-name (car quit-config))) |
5188 (gnus-configure-windows 'group 'force) | |
5189 (set-buffer (car quit-config)) | |
5190 (cond ((eq major-mode 'gnus-summary-mode) | |
5191 (gnus-set-global-variables)) | |
5192 ((eq major-mode 'gnus-article-mode) | |
5193 (save-excursion | |
5194 ;; The `gnus-summary-buffer' variable may point | |
5195 ;; to the old summary buffer when using a single | |
5196 ;; article buffer. | |
5197 (unless (gnus-buffer-live-p gnus-summary-buffer) | |
5198 (set-buffer gnus-group-buffer)) | |
5199 (set-buffer gnus-summary-buffer) | |
5200 (gnus-set-global-variables)))) | |
5201 (if (or (eq (cdr quit-config) 'article) | |
5202 (eq (cdr quit-config) 'pick)) | |
5203 (progn | |
5204 ;; The current article may be from the ephemeral group | |
5205 ;; thus it is best that we reload this article | |
5206 (gnus-summary-show-article) | |
5207 (if (and (boundp 'gnus-pick-mode) (symbol-value 'gnus-pick-mode)) | |
5208 (gnus-configure-windows 'pick 'force) | |
5209 (gnus-configure-windows (cdr quit-config) 'force))) | |
5210 (gnus-configure-windows (cdr quit-config) 'force)) | |
5211 (when (eq major-mode 'gnus-summary-mode) | |
5212 (gnus-summary-next-subject 1 nil t) | |
5213 (gnus-summary-recenter) | |
5214 (gnus-summary-position-point)))) | |
5215 | |
5216 ;;; Dead summaries. | |
5217 | |
5218 (defvar gnus-dead-summary-mode-map nil) | |
5219 | |
5220 (unless gnus-dead-summary-mode-map | |
5221 (setq gnus-dead-summary-mode-map (make-keymap)) | |
5222 (suppress-keymap gnus-dead-summary-mode-map) | |
5223 (substitute-key-definition | |
5224 '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
|
5225 (let ((keys '("\C-d" "\r" "\177" [delete]))) |
17493 | 5226 (while keys |
5227 (define-key gnus-dead-summary-mode-map | |
5228 (pop keys) 'gnus-summary-wake-up-the-dead)))) | |
5229 | |
5230 (defvar gnus-dead-summary-mode nil | |
5231 "Minor mode for Gnus summary buffers.") | |
5232 | |
5233 (defun gnus-dead-summary-mode (&optional arg) | |
5234 "Minor mode for Gnus summary buffers." | |
5235 (interactive "P") | |
5236 (when (eq major-mode 'gnus-summary-mode) | |
5237 (make-local-variable 'gnus-dead-summary-mode) | |
5238 (setq gnus-dead-summary-mode | |
5239 (if (null arg) (not gnus-dead-summary-mode) | |
5240 (> (prefix-numeric-value arg) 0))) | |
5241 (when gnus-dead-summary-mode | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5242 (gnus-add-minor-mode |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5243 'gnus-dead-summary-mode " Dead" gnus-dead-summary-mode-map)))) |
17493 | 5244 |
5245 (defun gnus-deaden-summary () | |
5246 "Make the current summary buffer into a dead summary buffer." | |
5247 ;; Kill any previous dead summary buffer. | |
5248 (when (and gnus-dead-summary | |
5249 (buffer-name gnus-dead-summary)) | |
5250 (save-excursion | |
5251 (set-buffer gnus-dead-summary) | |
5252 (when gnus-dead-summary-mode | |
5253 (kill-buffer (current-buffer))))) | |
5254 ;; Make this the current dead summary. | |
5255 (setq gnus-dead-summary (current-buffer)) | |
5256 (gnus-dead-summary-mode 1) | |
5257 (let ((name (buffer-name))) | |
5258 (when (string-match "Summary" name) | |
5259 (rename-buffer | |
5260 (concat (substring name 0 (match-beginning 0)) "Dead " | |
5261 (substring name (match-beginning 0))) | |
5262 t)))) | |
5263 | |
5264 (defun gnus-kill-or-deaden-summary (buffer) | |
5265 "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
|
5266 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5267 (when (and (buffer-name buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5268 (not gnus-single-article-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5269 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5270 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5271 (gnus-kill-buffer gnus-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5272 (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
|
5273 (cond (gnus-kill-summary-on-exit |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5274 (when (and gnus-use-trees |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5275 (gnus-buffer-exists-p buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5276 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5277 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5278 (gnus-tree-close gnus-newsgroup-name))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5279 (gnus-kill-buffer buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5280 ((gnus-buffer-exists-p buffer) |
17493 | 5281 (save-excursion |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5282 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5283 (gnus-deaden-summary)))))) |
17493 | 5284 |
5285 (defun gnus-summary-wake-up-the-dead (&rest args) | |
5286 "Wake up the dead summary buffer." | |
5287 (interactive) | |
5288 (gnus-dead-summary-mode -1) | |
5289 (let ((name (buffer-name))) | |
5290 (when (string-match "Dead " name) | |
5291 (rename-buffer | |
5292 (concat (substring name 0 (match-beginning 0)) | |
5293 (substring name (match-end 0))) | |
5294 t))) | |
5295 (gnus-message 3 "This dead summary is now alive again")) | |
5296 | |
5297 ;; Suggested by Andrew Eskilsson <pi92ae@pt.hk-r.se>. | |
5298 (defun gnus-summary-fetch-faq (&optional faq-dir) | |
5299 "Fetch the FAQ for the current group. | |
5300 If FAQ-DIR (the prefix), prompt for a directory to search for the faq | |
5301 in." | |
5302 (interactive | |
5303 (list | |
5304 (when current-prefix-arg | |
5305 (completing-read | |
5306 "Faq dir: " (and (listp gnus-group-faq-directory) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5307 (mapcar (lambda (file) (list file)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5308 gnus-group-faq-directory)))))) |
17493 | 5309 (let (gnus-faq-buffer) |
5310 (when (setq gnus-faq-buffer | |
5311 (gnus-group-fetch-faq gnus-newsgroup-name faq-dir)) | |
5312 (gnus-configure-windows 'summary-faq)))) | |
5313 | |
5314 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>. | |
5315 (defun gnus-summary-describe-group (&optional force) | |
5316 "Describe the current newsgroup." | |
5317 (interactive "P") | |
5318 (gnus-group-describe-group force gnus-newsgroup-name)) | |
5319 | |
5320 (defun gnus-summary-describe-briefly () | |
5321 "Describe summary mode commands briefly." | |
5322 (interactive) | |
5323 (gnus-message 6 | |
5324 (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"))) | |
5325 | |
5326 ;; Walking around group mode buffer from summary mode. | |
5327 | |
5328 (defun gnus-summary-next-group (&optional no-article target-group backward) | |
5329 "Exit current newsgroup and then select next unread newsgroup. | |
5330 If prefix argument NO-ARTICLE is non-nil, no article is selected | |
5331 initially. If NEXT-GROUP, go to this group. If BACKWARD, go to | |
5332 previous group instead." | |
5333 (interactive "P") | |
5334 ;; Stop pre-fetching. | |
5335 (gnus-async-halt-prefetch) | |
5336 (let ((current-group gnus-newsgroup-name) | |
5337 (current-buffer (current-buffer)) | |
5338 entered) | |
5339 ;; First we semi-exit this group to update Xrefs and all variables. | |
5340 ;; We can't do a real exit, because the window conf must remain | |
5341 ;; the same in case the user is prompted for info, and we don't | |
5342 ;; want the window conf to change before that... | |
5343 (gnus-summary-exit t) | |
5344 (while (not entered) | |
5345 ;; Then we find what group we are supposed to enter. | |
5346 (set-buffer gnus-group-buffer) | |
5347 (gnus-group-jump-to-group current-group) | |
5348 (setq target-group | |
5349 (or target-group | |
5350 (if (eq gnus-keep-same-level 'best) | |
5351 (gnus-summary-best-group gnus-newsgroup-name) | |
5352 (gnus-summary-search-group backward gnus-keep-same-level)))) | |
5353 (if (not target-group) | |
5354 ;; There are no further groups, so we return to the group | |
5355 ;; buffer. | |
5356 (progn | |
5357 (gnus-message 5 "Returning to the group buffer") | |
5358 (setq entered t) | |
5359 (when (gnus-buffer-live-p current-buffer) | |
5360 (set-buffer current-buffer) | |
5361 (gnus-summary-exit)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5362 (gnus-run-hooks 'gnus-group-no-more-groups-hook)) |
17493 | 5363 ;; We try to enter the target group. |
5364 (gnus-group-jump-to-group target-group) | |
5365 (let ((unreads (gnus-group-group-unread))) | |
5366 (if (and (or (eq t unreads) | |
5367 (and unreads (not (zerop unreads)))) | |
5368 (gnus-summary-read-group | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5369 target-group nil no-article |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5370 (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
|
5371 nil backward)) |
17493 | 5372 (setq entered t) |
5373 (setq current-group target-group | |
5374 target-group nil))))))) | |
5375 | |
5376 (defun gnus-summary-prev-group (&optional no-article) | |
5377 "Exit current newsgroup and then select previous unread newsgroup. | |
5378 If prefix argument NO-ARTICLE is non-nil, no article is selected initially." | |
5379 (interactive "P") | |
5380 (gnus-summary-next-group no-article nil t)) | |
5381 | |
5382 ;; Walking around summary lines. | |
5383 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5384 (defun gnus-summary-first-subject (&optional unread undownloaded) |
17493 | 5385 "Go to the first unread subject. |
5386 If UNREAD is non-nil, go to the first unread article. | |
5387 Returns the article selected or nil if there are no unread articles." | |
5388 (interactive "P") | |
5389 (prog1 | |
5390 (cond | |
5391 ;; Empty summary. | |
5392 ((null gnus-newsgroup-data) | |
5393 (gnus-message 3 "No articles in the group") | |
5394 nil) | |
5395 ;; Pick the first article. | |
5396 ((not unread) | |
5397 (goto-char (gnus-data-pos (car gnus-newsgroup-data))) | |
5398 (gnus-data-number (car gnus-newsgroup-data))) | |
5399 ;; No unread articles. | |
5400 ((null gnus-newsgroup-unreads) | |
5401 (gnus-message 3 "No more unread articles") | |
5402 nil) | |
5403 ;; Find the first unread article. | |
5404 (t | |
5405 (let ((data gnus-newsgroup-data)) | |
5406 (while (and data | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5407 (and (not (and undownloaded |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5408 (eq gnus-undownloaded-mark |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5409 (gnus-data-mark (car data))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5410 (not (gnus-data-unread-p (car data))))) |
17493 | 5411 (setq data (cdr data))) |
5412 (when data | |
5413 (goto-char (gnus-data-pos (car data))) | |
5414 (gnus-data-number (car data)))))) | |
5415 (gnus-summary-position-point))) | |
5416 | |
5417 (defun gnus-summary-next-subject (n &optional unread dont-display) | |
5418 "Go to next N'th summary line. | |
5419 If N is negative, go to the previous N'th subject line. | |
5420 If UNREAD is non-nil, only unread articles are selected. | |
5421 The difference between N and the actual number of steps taken is | |
5422 returned." | |
5423 (interactive "p") | |
5424 (let ((backward (< n 0)) | |
5425 (n (abs n))) | |
5426 (while (and (> n 0) | |
5427 (if backward | |
5428 (gnus-summary-find-prev unread) | |
5429 (gnus-summary-find-next unread))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5430 (gnus-summary-show-thread) |
17493 | 5431 (setq n (1- n))) |
5432 (when (/= 0 n) | |
5433 (gnus-message 7 "No more%s articles" | |
5434 (if unread " unread" ""))) | |
5435 (unless dont-display | |
5436 (gnus-summary-recenter) | |
5437 (gnus-summary-position-point)) | |
5438 n)) | |
5439 | |
5440 (defun gnus-summary-next-unread-subject (n) | |
5441 "Go to next N'th unread summary line." | |
5442 (interactive "p") | |
5443 (gnus-summary-next-subject n t)) | |
5444 | |
5445 (defun gnus-summary-prev-subject (n &optional unread) | |
5446 "Go to previous N'th summary line. | |
5447 If optional argument UNREAD is non-nil, only unread article is selected." | |
5448 (interactive "p") | |
5449 (gnus-summary-next-subject (- n) unread)) | |
5450 | |
5451 (defun gnus-summary-prev-unread-subject (n) | |
5452 "Go to previous N'th unread summary line." | |
5453 (interactive "p") | |
5454 (gnus-summary-next-subject (- n) t)) | |
5455 | |
5456 (defun gnus-summary-goto-subject (article &optional force silent) | |
5457 "Go the subject line of ARTICLE. | |
5458 If FORCE, also allow jumping to articles not currently shown." | |
5459 (interactive "nArticle number: ") | |
5460 (let ((b (point)) | |
5461 (data (gnus-data-find article))) | |
5462 ;; We read in the article if we have to. | |
5463 (and (not data) | |
5464 force | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5465 (gnus-summary-insert-subject |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5466 article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5467 (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
|
5468 t) |
17493 | 5469 (setq data (gnus-data-find article))) |
5470 (goto-char b) | |
5471 (if (not data) | |
5472 (progn | |
5473 (unless silent | |
5474 (gnus-message 3 "Can't find article %d" article)) | |
5475 nil) | |
5476 (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
|
5477 (gnus-summary-position-point) |
17493 | 5478 article))) |
5479 | |
5480 ;; Walking around summary lines with displaying articles. | |
5481 | |
5482 (defun gnus-summary-expand-window (&optional arg) | |
5483 "Make the summary buffer take up the entire Emacs frame. | |
5484 Given a prefix, will force an `article' buffer configuration." | |
5485 (interactive "P") | |
5486 (if arg | |
5487 (gnus-configure-windows 'article 'force) | |
5488 (gnus-configure-windows 'summary 'force))) | |
5489 | |
5490 (defun gnus-summary-display-article (article &optional all-header) | |
5491 "Display ARTICLE in article buffer." | |
5492 (gnus-set-global-variables) | |
5493 (if (null article) | |
5494 nil | |
5495 (prog1 | |
5496 (if gnus-summary-display-article-function | |
5497 (funcall gnus-summary-display-article-function article all-header) | |
5498 (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
|
5499 (gnus-run-hooks 'gnus-select-article-hook) |
17493 | 5500 (when (and gnus-current-article |
5501 (not (zerop gnus-current-article))) | |
5502 (gnus-summary-goto-subject gnus-current-article)) | |
5503 (gnus-summary-recenter) | |
5504 (when (and gnus-use-trees gnus-show-threads) | |
5505 (gnus-possibly-generate-tree article) | |
5506 (gnus-highlight-selected-tree article)) | |
5507 ;; Successfully display article. | |
5508 (gnus-article-set-window-start | |
5509 (cdr (assq article gnus-newsgroup-bookmarks)))))) | |
5510 | |
5511 (defun gnus-summary-select-article (&optional all-headers force pseudo article) | |
5512 "Select the current article. | |
5513 If ALL-HEADERS is non-nil, show all header fields. If FORCE is | |
5514 non-nil, the article will be re-fetched even if it already present in | |
5515 the article buffer. If PSEUDO is non-nil, pseudo-articles will also | |
5516 be displayed." | |
5517 ;; Make sure we are in the summary buffer to work around bbdb bug. | |
5518 (unless (eq major-mode 'gnus-summary-mode) | |
5519 (set-buffer gnus-summary-buffer)) | |
5520 (let ((article (or article (gnus-summary-article-number))) | |
5521 (all-headers (not (not all-headers))) ;Must be T or NIL. | |
5522 gnus-summary-display-article-function | |
5523 did) | |
5524 (and (not pseudo) | |
5525 (gnus-summary-article-pseudo-p article) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5526 (error "This is a pseudo-article")) |
17493 | 5527 (prog1 |
5528 (save-excursion | |
5529 (set-buffer gnus-summary-buffer) | |
5530 (if (or (and gnus-single-article-buffer | |
5531 (or (null gnus-current-article) | |
5532 (null gnus-article-current) | |
5533 (null (get-buffer gnus-article-buffer)) | |
5534 (not (eq article (cdr gnus-article-current))) | |
5535 (not (equal (car gnus-article-current) | |
5536 gnus-newsgroup-name)))) | |
5537 (and (not gnus-single-article-buffer) | |
5538 (or (null gnus-current-article) | |
5539 (not (eq gnus-current-article article)))) | |
5540 force) | |
5541 ;; The requested article is different from the current article. | |
5542 (prog1 | |
5543 (gnus-summary-display-article article all-headers) | |
5544 (setq did article)) | |
5545 (when (or all-headers gnus-show-all-headers) | |
5546 (gnus-article-show-all-headers)) | |
5547 'old)) | |
5548 (when did | |
5549 (gnus-article-set-window-start | |
5550 (cdr (assq article gnus-newsgroup-bookmarks))))))) | |
5551 | |
5552 (defun gnus-summary-set-current-mark (&optional current-mark) | |
5553 "Obsolete function." | |
5554 nil) | |
5555 | |
5556 (defun gnus-summary-next-article (&optional unread subject backward push) | |
5557 "Select the next article. | |
5558 If UNREAD, only unread articles are selected. | |
5559 If SUBJECT, only articles with SUBJECT are selected. | |
5560 If BACKWARD, the previous article is selected instead of the next." | |
5561 (interactive "P") | |
5562 (cond | |
5563 ;; Is there such an article? | |
5564 ((and (gnus-summary-search-forward unread subject backward) | |
5565 (or (gnus-summary-display-article (gnus-summary-article-number)) | |
5566 (eq (gnus-summary-article-mark) gnus-canceled-mark))) | |
5567 (gnus-summary-position-point)) | |
5568 ;; If not, we try the first unread, if that is wanted. | |
5569 ((and subject | |
5570 gnus-auto-select-same | |
5571 (gnus-summary-first-unread-article)) | |
5572 (gnus-summary-position-point) | |
5573 (gnus-message 6 "Wrapped")) | |
5574 ;; Try to get next/previous article not displayed in this group. | |
5575 ((and gnus-auto-extend-newsgroup | |
5576 (not unread) (not subject)) | |
5577 (gnus-summary-goto-article | |
5578 (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
|
5579 nil (count-lines (point-min) (point)))) |
17493 | 5580 ;; Go to next/previous group. |
5581 (t | |
5582 (unless (gnus-ephemeral-group-p gnus-newsgroup-name) | |
5583 (gnus-summary-jump-to-group gnus-newsgroup-name)) | |
5584 (let ((cmd last-command-char) | |
5585 (point | |
5586 (save-excursion | |
5587 (set-buffer gnus-group-buffer) | |
5588 (point))) | |
5589 (group | |
5590 (if (eq gnus-keep-same-level 'best) | |
5591 (gnus-summary-best-group gnus-newsgroup-name) | |
5592 (gnus-summary-search-group backward gnus-keep-same-level)))) | |
5593 ;; For some reason, the group window gets selected. We change | |
5594 ;; it back. | |
5595 (select-window (get-buffer-window (current-buffer))) | |
5596 ;; Select next unread newsgroup automagically. | |
5597 (cond | |
5598 ((or (not gnus-auto-select-next) | |
5599 (not cmd)) | |
5600 (gnus-message 7 "No more%s articles" (if unread " unread" ""))) | |
5601 ((or (eq gnus-auto-select-next 'quietly) | |
5602 (and (eq gnus-auto-select-next 'slightly-quietly) | |
5603 push) | |
5604 (and (eq gnus-auto-select-next 'almost-quietly) | |
5605 (gnus-summary-last-article-p))) | |
5606 ;; Select quietly. | |
5607 (if (gnus-ephemeral-group-p gnus-newsgroup-name) | |
5608 (gnus-summary-exit) | |
5609 (gnus-message 7 "No more%s articles (%s)..." | |
5610 (if unread " unread" "") | |
5611 (if group (concat "selecting " group) | |
5612 "exiting")) | |
5613 (gnus-summary-next-group nil group backward))) | |
5614 (t | |
5615 (when (gnus-key-press-event-p last-input-event) | |
5616 (gnus-summary-walk-group-buffer | |
5617 gnus-newsgroup-name cmd unread backward point)))))))) | |
5618 | |
5619 (defun gnus-summary-walk-group-buffer (from-group cmd unread backward start) | |
5620 (let ((keystrokes '((?\C-n (gnus-group-next-unread-group 1)) | |
5621 (?\C-p (gnus-group-prev-unread-group 1)))) | |
5622 (cursor-in-echo-area t) | |
5623 keve key group ended) | |
5624 (save-excursion | |
5625 (set-buffer gnus-group-buffer) | |
5626 (goto-char start) | |
5627 (setq group | |
5628 (if (eq gnus-keep-same-level 'best) | |
5629 (gnus-summary-best-group gnus-newsgroup-name) | |
5630 (gnus-summary-search-group backward gnus-keep-same-level)))) | |
5631 (while (not ended) | |
5632 (gnus-message | |
5633 5 "No more%s articles%s" (if unread " unread" "") | |
5634 (if (and group | |
5635 (not (gnus-ephemeral-group-p gnus-newsgroup-name))) | |
5636 (format " (Type %s for %s [%s])" | |
5637 (single-key-description cmd) group | |
5638 (car (gnus-gethash group gnus-newsrc-hashtb))) | |
5639 (format " (Type %s to exit %s)" | |
5640 (single-key-description cmd) | |
5641 gnus-newsgroup-name))) | |
5642 ;; Confirm auto selection. | |
5643 (setq key (car (setq keve (gnus-read-event-char)))) | |
5644 (setq ended t) | |
5645 (cond | |
5646 ((assq key keystrokes) | |
5647 (let ((obuf (current-buffer))) | |
5648 (switch-to-buffer gnus-group-buffer) | |
5649 (when group | |
5650 (gnus-group-jump-to-group group)) | |
5651 (eval (cadr (assq key keystrokes))) | |
5652 (setq group (gnus-group-group-name)) | |
5653 (switch-to-buffer obuf)) | |
5654 (setq ended nil)) | |
5655 ((equal key cmd) | |
5656 (if (or (not group) | |
5657 (gnus-ephemeral-group-p gnus-newsgroup-name)) | |
5658 (gnus-summary-exit) | |
5659 (gnus-summary-next-group nil group backward))) | |
5660 (t | |
5661 (push (cdr keve) unread-command-events)))))) | |
5662 | |
5663 (defun gnus-summary-next-unread-article () | |
5664 "Select unread article after current one." | |
5665 (interactive) | |
5666 (gnus-summary-next-article | |
5667 (or (not (eq gnus-summary-goto-unread 'never)) | |
5668 (gnus-summary-last-article-p (gnus-summary-article-number))) | |
5669 (and gnus-auto-select-same | |
5670 (gnus-summary-article-subject)))) | |
5671 | |
5672 (defun gnus-summary-prev-article (&optional unread subject) | |
5673 "Select the article after the current one. | |
5674 If UNREAD is non-nil, only unread articles are selected." | |
5675 (interactive "P") | |
5676 (gnus-summary-next-article unread subject t)) | |
5677 | |
5678 (defun gnus-summary-prev-unread-article () | |
5679 "Select unread article before current one." | |
5680 (interactive) | |
5681 (gnus-summary-prev-article | |
5682 (or (not (eq gnus-summary-goto-unread 'never)) | |
5683 (gnus-summary-first-article-p (gnus-summary-article-number))) | |
5684 (and gnus-auto-select-same | |
5685 (gnus-summary-article-subject)))) | |
5686 | |
5687 (defun gnus-summary-next-page (&optional lines circular) | |
5688 "Show next page of the selected article. | |
5689 If at the end of the current article, select the next article. | |
5690 LINES says how many lines should be scrolled up. | |
5691 | |
5692 If CIRCULAR is non-nil, go to the start of the article instead of | |
5693 selecting the next article when reaching the end of the current | |
5694 article." | |
5695 (interactive "P") | |
5696 (setq gnus-summary-buffer (current-buffer)) | |
5697 (gnus-set-global-variables) | |
5698 (let ((article (gnus-summary-article-number)) | |
5699 (article-window (get-buffer-window gnus-article-buffer t)) | |
5700 endp) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5701 ;; 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
|
5702 (unless article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5703 (error "No article to select")) |
17493 | 5704 (gnus-configure-windows 'article) |
5705 (if (eq (cdr (assq article gnus-newsgroup-reads)) gnus-canceled-mark) | |
5706 (if (and (eq gnus-summary-goto-unread 'never) | |
5707 (not (gnus-summary-last-article-p article))) | |
5708 (gnus-summary-next-article) | |
5709 (gnus-summary-next-unread-article)) | |
5710 (if (or (null gnus-current-article) | |
5711 (null gnus-article-current) | |
5712 (/= article (cdr gnus-article-current)) | |
5713 (not (equal (car gnus-article-current) gnus-newsgroup-name))) | |
5714 ;; Selected subject is different from current article's. | |
5715 (gnus-summary-display-article article) | |
5716 (when article-window | |
5717 (gnus-eval-in-buffer-window gnus-article-buffer | |
5718 (setq endp (gnus-article-next-page lines))) | |
5719 (when endp | |
5720 (cond (circular | |
5721 (gnus-summary-beginning-of-article)) | |
5722 (lines | |
5723 (gnus-message 3 "End of message")) | |
5724 ((null lines) | |
5725 (if (and (eq gnus-summary-goto-unread 'never) | |
5726 (not (gnus-summary-last-article-p article))) | |
5727 (gnus-summary-next-article) | |
5728 (gnus-summary-next-unread-article)))))))) | |
5729 (gnus-summary-recenter) | |
5730 (gnus-summary-position-point))) | |
5731 | |
5732 (defun gnus-summary-prev-page (&optional lines move) | |
5733 "Show previous page of selected article. | |
5734 Argument LINES specifies lines to be scrolled down. | |
5735 If MOVE, move to the previous unread article if point is at | |
5736 the beginning of the buffer." | |
5737 (interactive "P") | |
5738 (let ((article (gnus-summary-article-number)) | |
5739 (article-window (get-buffer-window gnus-article-buffer t)) | |
5740 endp) | |
5741 (gnus-configure-windows 'article) | |
5742 (if (or (null gnus-current-article) | |
5743 (null gnus-article-current) | |
5744 (/= article (cdr gnus-article-current)) | |
5745 (not (equal (car gnus-article-current) gnus-newsgroup-name))) | |
5746 ;; Selected subject is different from current article's. | |
5747 (gnus-summary-display-article article) | |
5748 (gnus-summary-recenter) | |
5749 (when article-window | |
5750 (gnus-eval-in-buffer-window gnus-article-buffer | |
5751 (setq endp (gnus-article-prev-page lines))) | |
5752 (when (and move endp) | |
5753 (cond (lines | |
5754 (gnus-message 3 "Beginning of message")) | |
5755 ((null lines) | |
5756 (if (and (eq gnus-summary-goto-unread 'never) | |
5757 (not (gnus-summary-first-article-p article))) | |
5758 (gnus-summary-prev-article) | |
5759 (gnus-summary-prev-unread-article)))))))) | |
5760 (gnus-summary-position-point)) | |
5761 | |
5762 (defun gnus-summary-prev-page-or-article (&optional lines) | |
5763 "Show previous page of selected article. | |
5764 Argument LINES specifies lines to be scrolled down. | |
5765 If at the beginning of the article, go to the next article." | |
5766 (interactive "P") | |
5767 (gnus-summary-prev-page lines t)) | |
5768 | |
5769 (defun gnus-summary-scroll-up (lines) | |
5770 "Scroll up (or down) one line current article. | |
5771 Argument LINES specifies lines to be scrolled up (or down if negative)." | |
5772 (interactive "p") | |
5773 (gnus-configure-windows 'article) | |
5774 (gnus-summary-show-thread) | |
5775 (when (eq (gnus-summary-select-article nil nil 'pseudo) 'old) | |
5776 (gnus-eval-in-buffer-window gnus-article-buffer | |
5777 (cond ((> lines 0) | |
5778 (when (gnus-article-next-page lines) | |
5779 (gnus-message 3 "End of message"))) | |
5780 ((< lines 0) | |
5781 (gnus-article-prev-page (- lines)))))) | |
5782 (gnus-summary-recenter) | |
5783 (gnus-summary-position-point)) | |
5784 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5785 (defun gnus-summary-scroll-down (lines) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5786 "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
|
5787 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
|
5788 (interactive "p") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5789 (gnus-summary-scroll-up (- lines))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5790 |
17493 | 5791 (defun gnus-summary-next-same-subject () |
5792 "Select next article which has the same subject as current one." | |
5793 (interactive) | |
5794 (gnus-summary-next-article nil (gnus-summary-article-subject))) | |
5795 | |
5796 (defun gnus-summary-prev-same-subject () | |
5797 "Select previous article which has the same subject as current one." | |
5798 (interactive) | |
5799 (gnus-summary-prev-article nil (gnus-summary-article-subject))) | |
5800 | |
5801 (defun gnus-summary-next-unread-same-subject () | |
5802 "Select next unread article which has the same subject as current one." | |
5803 (interactive) | |
5804 (gnus-summary-next-article t (gnus-summary-article-subject))) | |
5805 | |
5806 (defun gnus-summary-prev-unread-same-subject () | |
5807 "Select previous unread article which has the same subject as current one." | |
5808 (interactive) | |
5809 (gnus-summary-prev-article t (gnus-summary-article-subject))) | |
5810 | |
5811 (defun gnus-summary-first-unread-article () | |
5812 "Select the first unread article. | |
5813 Return nil if there are no unread articles." | |
5814 (interactive) | |
5815 (prog1 | |
5816 (when (gnus-summary-first-subject t) | |
5817 (gnus-summary-show-thread) | |
5818 (gnus-summary-first-subject t) | |
5819 (gnus-summary-display-article (gnus-summary-article-number))) | |
5820 (gnus-summary-position-point))) | |
5821 | |
5822 (defun gnus-summary-first-article () | |
5823 "Select the first article. | |
5824 Return nil if there are no articles." | |
5825 (interactive) | |
5826 (prog1 | |
5827 (when (gnus-summary-first-subject) | |
5828 (gnus-summary-show-thread) | |
5829 (gnus-summary-first-subject) | |
5830 (gnus-summary-display-article (gnus-summary-article-number))) | |
5831 (gnus-summary-position-point))) | |
5832 | |
5833 (defun gnus-summary-best-unread-article () | |
5834 "Select the unread article with the highest score." | |
5835 (interactive) | |
5836 (let ((best -1000000) | |
5837 (data gnus-newsgroup-data) | |
5838 article score) | |
5839 (while data | |
5840 (and (gnus-data-unread-p (car data)) | |
5841 (> (setq score | |
5842 (gnus-summary-article-score (gnus-data-number (car data)))) | |
5843 best) | |
5844 (setq best score | |
5845 article (gnus-data-number (car data)))) | |
5846 (setq data (cdr data))) | |
5847 (prog1 | |
5848 (if article | |
5849 (gnus-summary-goto-article article) | |
5850 (error "No unread articles")) | |
5851 (gnus-summary-position-point)))) | |
5852 | |
5853 (defun gnus-summary-last-subject () | |
5854 "Go to the last displayed subject line in the group." | |
5855 (let ((article (gnus-data-number (car (gnus-data-list t))))) | |
5856 (when article | |
5857 (gnus-summary-goto-subject article)))) | |
5858 | |
5859 (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
|
5860 "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
|
5861 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
|
5862 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
|
5863 is a number, it is the line the article is to be displayed on." |
17493 | 5864 (interactive |
5865 (list | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5866 (completing-read |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5867 "Article number or Message-ID: " |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5868 (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
|
5869 gnus-newsgroup-limit)) |
17493 | 5870 current-prefix-arg |
5871 t)) | |
5872 (prog1 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5873 (if (and (stringp article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5874 (string-match "@" article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5875 (gnus-summary-refer-article article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5876 (when (stringp article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5877 (setq article (string-to-number article))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5878 (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
|
5879 (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
|
5880 (gnus-message 4 "Couldn't go to article %s" article) nil)) |
17493 | 5881 (gnus-summary-position-point))) |
5882 | |
5883 (defun gnus-summary-goto-last-article () | |
5884 "Go to the previously read article." | |
5885 (interactive) | |
5886 (prog1 | |
5887 (when gnus-last-article | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5888 (gnus-summary-goto-article gnus-last-article nil t)) |
17493 | 5889 (gnus-summary-position-point))) |
5890 | |
5891 (defun gnus-summary-pop-article (number) | |
5892 "Pop one article off the history and go to the previous. | |
5893 NUMBER articles will be popped off." | |
5894 (interactive "p") | |
5895 (let (to) | |
5896 (setq gnus-newsgroup-history | |
5897 (cdr (setq to (nthcdr number gnus-newsgroup-history)))) | |
5898 (if to | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5899 (gnus-summary-goto-article (car to) nil t) |
17493 | 5900 (error "Article history empty"))) |
5901 (gnus-summary-position-point)) | |
5902 | |
5903 ;; Summary commands and functions for limiting the summary buffer. | |
5904 | |
5905 (defun gnus-summary-limit-to-articles (n) | |
5906 "Limit the summary buffer to the next N articles. | |
5907 If not given a prefix, use the process marked articles instead." | |
5908 (interactive "P") | |
5909 (prog1 | |
5910 (let ((articles (gnus-summary-work-articles n))) | |
5911 (setq gnus-newsgroup-processable nil) | |
5912 (gnus-summary-limit articles)) | |
5913 (gnus-summary-position-point))) | |
5914 | |
5915 (defun gnus-summary-pop-limit (&optional total) | |
5916 "Restore the previous limit. | |
5917 If given a prefix, remove all limits." | |
5918 (interactive "P") | |
5919 (when total | |
5920 (setq gnus-newsgroup-limits | |
5921 (list (mapcar (lambda (h) (mail-header-number h)) | |
5922 gnus-newsgroup-headers)))) | |
5923 (unless gnus-newsgroup-limits | |
5924 (error "No limit to pop")) | |
5925 (prog1 | |
5926 (gnus-summary-limit nil 'pop) | |
5927 (gnus-summary-position-point))) | |
5928 | |
5929 (defun gnus-summary-limit-to-subject (subject &optional header) | |
5930 "Limit the summary buffer to articles that have subjects that match a regexp." | |
5931 (interactive "sLimit to subject (regexp): ") | |
5932 (unless header | |
5933 (setq header "subject")) | |
5934 (when (not (equal "" subject)) | |
5935 (prog1 | |
5936 (let ((articles (gnus-summary-find-matching | |
5937 (or header "subject") subject 'all))) | |
5938 (unless articles | |
5939 (error "Found no matches for \"%s\"" subject)) | |
5940 (gnus-summary-limit articles)) | |
5941 (gnus-summary-position-point)))) | |
5942 | |
5943 (defun gnus-summary-limit-to-author (from) | |
5944 "Limit the summary buffer to articles that have authors that match a regexp." | |
5945 (interactive "sLimit to author (regexp): ") | |
5946 (gnus-summary-limit-to-subject from "from")) | |
5947 | |
5948 (defun gnus-summary-limit-to-age (age &optional younger-p) | |
5949 "Limit the summary buffer to articles that are older than (or equal) AGE days. | |
5950 If YOUNGER-P (the prefix) is non-nil, limit the summary buffer to | |
5951 articles that are younger than AGE days." | |
5952 (interactive "nTime in days: \nP") | |
5953 (prog1 | |
5954 (let ((data gnus-newsgroup-data) | |
5955 (cutoff (nnmail-days-to-time age)) | |
5956 articles d date is-younger) | |
5957 (while (setq d (pop data)) | |
5958 (when (and (vectorp (gnus-data-header d)) | |
5959 (setq date (mail-header-date (gnus-data-header d)))) | |
5960 (setq is-younger (nnmail-time-less | |
5961 (nnmail-time-since (nnmail-date-to-time date)) | |
5962 cutoff)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5963 (when (if younger-p |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5964 is-younger |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5965 (not is-younger)) |
17493 | 5966 (push (gnus-data-number d) articles)))) |
5967 (gnus-summary-limit (nreverse articles))) | |
5968 (gnus-summary-position-point))) | |
5969 | |
5970 (defalias 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread) | |
5971 (make-obsolete | |
5972 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread) | |
5973 | |
5974 (defun gnus-summary-limit-to-unread (&optional all) | |
5975 "Limit the summary buffer to articles that are not marked as read. | |
5976 If ALL is non-nil, limit strictly to unread articles." | |
5977 (interactive "P") | |
5978 (if all | |
5979 (gnus-summary-limit-to-marks (char-to-string gnus-unread-mark)) | |
5980 (gnus-summary-limit-to-marks | |
5981 ;; Concat all the marks that say that an article is read and have | |
5982 ;; those removed. | |
5983 (list gnus-del-mark gnus-read-mark gnus-ancient-mark | |
5984 gnus-killed-mark gnus-kill-file-mark | |
5985 gnus-low-score-mark gnus-expirable-mark | |
5986 gnus-canceled-mark gnus-catchup-mark gnus-sparse-mark | |
5987 gnus-duplicate-mark gnus-souped-mark) | |
5988 'reverse))) | |
5989 | |
5990 (defalias 'gnus-summary-delete-marked-with 'gnus-summary-limit-exclude-marks) | |
5991 (make-obsolete 'gnus-summary-delete-marked-with | |
5992 'gnus-summary-limit-exlude-marks) | |
5993 | |
5994 (defun gnus-summary-limit-exclude-marks (marks &optional reverse) | |
5995 "Exclude articles that are marked with MARKS (e.g. \"DK\"). | |
5996 If REVERSE, limit the summary buffer to articles that are marked | |
5997 with MARKS. MARKS can either be a string of marks or a list of marks. | |
5998 Returns how many articles were removed." | |
5999 (interactive "sMarks: ") | |
6000 (gnus-summary-limit-to-marks marks t)) | |
6001 | |
6002 (defun gnus-summary-limit-to-marks (marks &optional reverse) | |
6003 "Limit the summary buffer to articles that are marked with MARKS (e.g. \"DK\"). | |
6004 If REVERSE (the prefix), limit the summary buffer to articles that are | |
6005 not marked with MARKS. MARKS can either be a string of marks or a | |
6006 list of marks. | |
6007 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
|
6008 (interactive "sMarks: \nP") |
17493 | 6009 (prog1 |
6010 (let ((data gnus-newsgroup-data) | |
6011 (marks (if (listp marks) marks | |
6012 (append marks nil))) ; Transform to list. | |
6013 articles) | |
6014 (while data | |
6015 (when (if reverse (not (memq (gnus-data-mark (car data)) marks)) | |
6016 (memq (gnus-data-mark (car data)) marks)) | |
6017 (push (gnus-data-number (car data)) articles)) | |
6018 (setq data (cdr data))) | |
6019 (gnus-summary-limit articles)) | |
6020 (gnus-summary-position-point))) | |
6021 | |
6022 (defun gnus-summary-limit-to-score (&optional score) | |
6023 "Limit to articles with score at or above SCORE." | |
6024 (interactive "P") | |
6025 (setq score (if score | |
6026 (prefix-numeric-value score) | |
6027 (or gnus-summary-default-score 0))) | |
6028 (let ((data gnus-newsgroup-data) | |
6029 articles) | |
6030 (while data | |
6031 (when (>= (gnus-summary-article-score (gnus-data-number (car data))) | |
6032 score) | |
6033 (push (gnus-data-number (car data)) articles)) | |
6034 (setq data (cdr data))) | |
6035 (prog1 | |
6036 (gnus-summary-limit articles) | |
6037 (gnus-summary-position-point)))) | |
6038 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6039 (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
|
6040 "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
|
6041 (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
|
6042 (let ((articles (gnus-articles-in-thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6043 (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
|
6044 (prog1 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6045 (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
|
6046 (gnus-summary-position-point)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6047 |
17493 | 6048 (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
|
6049 "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
|
6050 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
|
6051 fetched for this group." |
17493 | 6052 (interactive) |
6053 (unless gnus-newsgroup-dormant | |
6054 (error "There are no dormant articles in this group")) | |
6055 (prog1 | |
6056 (gnus-summary-limit (append gnus-newsgroup-dormant gnus-newsgroup-limit)) | |
6057 (gnus-summary-position-point))) | |
6058 | |
6059 (defun gnus-summary-limit-exclude-dormant () | |
6060 "Hide all dormant articles." | |
6061 (interactive) | |
6062 (prog1 | |
6063 (gnus-summary-limit-to-marks (list gnus-dormant-mark) 'reverse) | |
6064 (gnus-summary-position-point))) | |
6065 | |
6066 (defun gnus-summary-limit-exclude-childless-dormant () | |
6067 "Hide all dormant articles that have no children." | |
6068 (interactive) | |
6069 (let ((data (gnus-data-list t)) | |
6070 articles d children) | |
6071 ;; Find all articles that are either not dormant or have | |
6072 ;; children. | |
6073 (while (setq d (pop data)) | |
6074 (when (or (not (= (gnus-data-mark d) gnus-dormant-mark)) | |
6075 (and (setq children | |
6076 (gnus-article-children (gnus-data-number d))) | |
6077 (let (found) | |
6078 (while children | |
6079 (when (memq (car children) articles) | |
6080 (setq children nil | |
6081 found t)) | |
6082 (pop children)) | |
6083 found))) | |
6084 (push (gnus-data-number d) articles))) | |
6085 ;; Do the limiting. | |
6086 (prog1 | |
6087 (gnus-summary-limit articles) | |
6088 (gnus-summary-position-point)))) | |
6089 | |
6090 (defun gnus-summary-limit-mark-excluded-as-read (&optional all) | |
6091 "Mark all unread excluded articles as read. | |
6092 If ALL, mark even excluded ticked and dormants as read." | |
6093 (interactive "P") | |
6094 (let ((articles (gnus-sorted-complement | |
6095 (sort | |
6096 (mapcar (lambda (h) (mail-header-number h)) | |
6097 gnus-newsgroup-headers) | |
6098 '<) | |
6099 (sort gnus-newsgroup-limit '<))) | |
6100 article) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6101 (setq gnus-newsgroup-unreads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6102 (gnus-intersection gnus-newsgroup-unreads gnus-newsgroup-limit)) |
17493 | 6103 (if all |
6104 (setq gnus-newsgroup-dormant nil | |
6105 gnus-newsgroup-marked nil | |
6106 gnus-newsgroup-reads | |
6107 (nconc | |
6108 (mapcar (lambda (n) (cons n gnus-catchup-mark)) articles) | |
6109 gnus-newsgroup-reads)) | |
6110 (while (setq article (pop articles)) | |
6111 (unless (or (memq article gnus-newsgroup-dormant) | |
6112 (memq article gnus-newsgroup-marked)) | |
6113 (push (cons article gnus-catchup-mark) gnus-newsgroup-reads)))))) | |
6114 | |
6115 (defun gnus-summary-limit (articles &optional pop) | |
6116 (if pop | |
6117 ;; We pop the previous limit off the stack and use that. | |
6118 (setq articles (car gnus-newsgroup-limits) | |
6119 gnus-newsgroup-limits (cdr gnus-newsgroup-limits)) | |
6120 ;; We use the new limit, so we push the old limit on the stack. | |
6121 (push gnus-newsgroup-limit gnus-newsgroup-limits)) | |
6122 ;; Set the limit. | |
6123 (setq gnus-newsgroup-limit articles) | |
6124 (let ((total (length gnus-newsgroup-data)) | |
6125 (data (gnus-data-find-list (gnus-summary-article-number))) | |
6126 (gnus-summary-mark-below nil) ; Inhibit this. | |
6127 found) | |
6128 ;; This will do all the work of generating the new summary buffer | |
6129 ;; according to the new limit. | |
6130 (gnus-summary-prepare) | |
6131 ;; Hide any threads, possibly. | |
6132 (and gnus-show-threads | |
6133 gnus-thread-hide-subtree | |
6134 (gnus-summary-hide-all-threads)) | |
6135 ;; Try to return to the article you were at, or one in the | |
6136 ;; neighborhood. | |
6137 (when data | |
6138 ;; We try to find some article after the current one. | |
6139 (while data | |
6140 (when (gnus-summary-goto-subject (gnus-data-number (car data)) nil t) | |
6141 (setq data nil | |
6142 found t)) | |
6143 (setq data (cdr data)))) | |
6144 (unless found | |
6145 ;; If there is no data, that means that we were after the last | |
6146 ;; article. The same goes when we can't find any articles | |
6147 ;; after the current one. | |
6148 (goto-char (point-max)) | |
6149 (gnus-summary-find-prev)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6150 (gnus-set-mode-line 'summary) |
17493 | 6151 ;; We return how many articles were removed from the summary |
6152 ;; buffer as a result of the new limit. | |
6153 (- total (length gnus-newsgroup-data)))) | |
6154 | |
6155 (defsubst gnus-invisible-cut-children (threads) | |
6156 (let ((num 0)) | |
6157 (while threads | |
6158 (when (memq (mail-header-number (caar threads)) gnus-newsgroup-limit) | |
6159 (incf num)) | |
6160 (pop threads)) | |
6161 (< num 2))) | |
6162 | |
6163 (defsubst gnus-cut-thread (thread) | |
6164 "Go forwards in the thread until we find an article that we want to display." | |
6165 (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
|
6166 (eq gnus-fetch-old-headers 'invisible) |
17493 | 6167 (eq gnus-build-sparse-threads 'some) |
6168 (eq gnus-build-sparse-threads 'more)) | |
6169 ;; Deal with old-fetched headers and sparse threads. | |
6170 (while (and | |
6171 thread | |
6172 (or | |
6173 (gnus-summary-article-sparse-p (mail-header-number (car thread))) | |
6174 (gnus-summary-article-ancient-p | |
6175 (mail-header-number (car thread)))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6176 (if (or (<= (length (cdr thread)) 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6177 (eq gnus-fetch-old-headers 'invisible)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6178 (setq gnus-newsgroup-limit |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6179 (delq (mail-header-number (car thread)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6180 gnus-newsgroup-limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6181 thread (cadr thread)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6182 (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
|
6183 (let ((th (cdr thread))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6184 (while th |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6185 (if (memq (mail-header-number (caar th)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6186 gnus-newsgroup-limit) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6187 (setq thread (car th) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6188 th nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6189 (setq th (cdr th)))))))))) |
17493 | 6190 thread) |
6191 | |
6192 (defun gnus-cut-threads (threads) | |
6193 "Cut off all uninteresting articles from the beginning of threads." | |
6194 (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
|
6195 (eq gnus-fetch-old-headers 'invisible) |
17493 | 6196 (eq gnus-build-sparse-threads 'some) |
6197 (eq gnus-build-sparse-threads 'more)) | |
6198 (let ((th threads)) | |
6199 (while th | |
6200 (setcar th (gnus-cut-thread (car th))) | |
6201 (setq th (cdr th))))) | |
6202 ;; Remove nixed out threads. | |
6203 (delq nil threads)) | |
6204 | |
6205 (defun gnus-summary-initial-limit (&optional show-if-empty) | |
6206 "Figure out what the initial limit is supposed to be on group entry. | |
6207 This entails weeding out unwanted dormants, low-scored articles, | |
6208 fetch-old-headers verbiage, and so on." | |
6209 ;; Most groups have nothing to remove. | |
6210 (if (or gnus-inhibit-limiting | |
6211 (and (null gnus-newsgroup-dormant) | |
6212 (not (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
|
6213 (not (eq gnus-fetch-old-headers 'invisible)) |
17493 | 6214 (null gnus-summary-expunge-below) |
6215 (not (eq gnus-build-sparse-threads 'some)) | |
6216 (not (eq gnus-build-sparse-threads 'more)) | |
6217 (null gnus-thread-expunge-below) | |
6218 (not gnus-use-nocem))) | |
6219 () ; Do nothing. | |
6220 (push gnus-newsgroup-limit gnus-newsgroup-limits) | |
6221 (setq gnus-newsgroup-limit nil) | |
6222 (mapatoms | |
6223 (lambda (node) | |
6224 (unless (car (symbol-value node)) | |
6225 ;; These threads have no parents -- they are roots. | |
6226 (let ((nodes (cdr (symbol-value node))) | |
6227 thread) | |
6228 (while nodes | |
6229 (if (and gnus-thread-expunge-below | |
6230 (< (gnus-thread-total-score (car nodes)) | |
6231 gnus-thread-expunge-below)) | |
6232 (gnus-expunge-thread (pop nodes)) | |
6233 (setq thread (pop nodes)) | |
6234 (gnus-summary-limit-children thread)))))) | |
6235 gnus-newsgroup-dependencies) | |
6236 ;; If this limitation resulted in an empty group, we might | |
6237 ;; pop the previous limit and use it instead. | |
6238 (when (and (not gnus-newsgroup-limit) | |
6239 show-if-empty) | |
6240 (setq gnus-newsgroup-limit (pop gnus-newsgroup-limits))) | |
6241 gnus-newsgroup-limit)) | |
6242 | |
6243 (defun gnus-summary-limit-children (thread) | |
6244 "Return 1 if this subthread is visible and 0 if it is not." | |
6245 ;; First we get the number of visible children to this thread. This | |
6246 ;; is done by recursing down the thread using this function, so this | |
6247 ;; will really go down to a leaf article first, before slowly | |
6248 ;; working its way up towards the root. | |
6249 (when thread | |
6250 (let ((children | |
6251 (if (cdr thread) | |
6252 (apply '+ (mapcar 'gnus-summary-limit-children | |
6253 (cdr thread))) | |
6254 0)) | |
6255 (number (mail-header-number (car thread))) | |
6256 score) | |
6257 (if (and | |
6258 (not (memq number gnus-newsgroup-marked)) | |
6259 (or | |
6260 ;; If this article is dormant and has absolutely no visible | |
6261 ;; children, then this article isn't visible. | |
6262 (and (memq number gnus-newsgroup-dormant) | |
6263 (zerop children)) | |
6264 ;; If this is "fetch-old-headered" and there is no | |
6265 ;; visible children, then we don't want this article. | |
6266 (and (eq gnus-fetch-old-headers 'some) | |
6267 (gnus-summary-article-ancient-p number) | |
6268 (zerop children)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6269 ;; 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
|
6270 ;; we don't want this article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6271 (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
|
6272 (gnus-summary-article-ancient-p number)) |
17493 | 6273 ;; If this is a sparsely inserted article with no children, |
6274 ;; we don't want it. | |
6275 (and (eq gnus-build-sparse-threads 'some) | |
6276 (gnus-summary-article-sparse-p number) | |
6277 (zerop children)) | |
6278 ;; If we use expunging, and this article is really | |
6279 ;; low-scored, then we don't want this article. | |
6280 (when (and gnus-summary-expunge-below | |
6281 (< (setq score | |
6282 (or (cdr (assq number gnus-newsgroup-scored)) | |
6283 gnus-summary-default-score)) | |
6284 gnus-summary-expunge-below)) | |
6285 ;; We increase the expunge-tally here, but that has | |
6286 ;; nothing to do with the limits, really. | |
6287 (incf gnus-newsgroup-expunged-tally) | |
6288 ;; We also mark as read here, if that's wanted. | |
6289 (when (and gnus-summary-mark-below | |
6290 (< score gnus-summary-mark-below)) | |
6291 (setq gnus-newsgroup-unreads | |
6292 (delq number gnus-newsgroup-unreads)) | |
6293 (if gnus-newsgroup-auto-expire | |
6294 (push number gnus-newsgroup-expirable) | |
6295 (push (cons number gnus-low-score-mark) | |
6296 gnus-newsgroup-reads))) | |
6297 t) | |
6298 ;; Check NoCeM things. | |
6299 (if (and gnus-use-nocem | |
6300 (gnus-nocem-unwanted-article-p | |
6301 (mail-header-id (car thread)))) | |
6302 (progn | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6303 (setq gnus-newsgroup-unreads |
17493 | 6304 (delq number gnus-newsgroup-unreads)) |
6305 t)))) | |
6306 ;; Nope, invisible article. | |
6307 0 | |
6308 ;; Ok, this article is to be visible, so we add it to the limit | |
6309 ;; and return 1. | |
6310 (push number gnus-newsgroup-limit) | |
6311 1)))) | |
6312 | |
6313 (defun gnus-expunge-thread (thread) | |
6314 "Mark all articles in THREAD as read." | |
6315 (let* ((number (mail-header-number (car thread)))) | |
6316 (incf gnus-newsgroup-expunged-tally) | |
6317 ;; We also mark as read here, if that's wanted. | |
6318 (setq gnus-newsgroup-unreads | |
6319 (delq number gnus-newsgroup-unreads)) | |
6320 (if gnus-newsgroup-auto-expire | |
6321 (push number gnus-newsgroup-expirable) | |
6322 (push (cons number gnus-low-score-mark) | |
6323 gnus-newsgroup-reads))) | |
6324 ;; Go recursively through all subthreads. | |
6325 (mapcar 'gnus-expunge-thread (cdr thread))) | |
6326 | |
6327 ;; Summary article oriented commands | |
6328 | |
6329 (defun gnus-summary-refer-parent-article (n) | |
6330 "Refer parent article N times. | |
6331 If N is negative, go to ancestor -N instead. | |
6332 The difference between N and the number of articles fetched is returned." | |
6333 (interactive "p") | |
6334 (let ((skip 1) | |
6335 error header ref) | |
6336 (when (not (natnump n)) | |
6337 (setq skip (abs n) | |
6338 n 1)) | |
6339 (while (and (> n 0) | |
6340 (not error)) | |
6341 (setq header (gnus-summary-article-header)) | |
6342 (if (and (eq (mail-header-number header) | |
6343 (cdr gnus-article-current)) | |
6344 (equal gnus-newsgroup-name | |
6345 (car gnus-article-current))) | |
6346 ;; If we try to find the parent of the currently | |
6347 ;; displayed article, then we take a look at the actual | |
6348 ;; References header, since this is slightly more | |
6349 ;; reliable than the References field we got from the | |
6350 ;; server. | |
6351 (save-excursion | |
6352 (set-buffer gnus-original-article-buffer) | |
6353 (nnheader-narrow-to-headers) | |
6354 (unless (setq ref (message-fetch-field "references")) | |
6355 (setq ref (message-fetch-field "in-reply-to"))) | |
6356 (widen)) | |
6357 (setq ref | |
6358 ;; It's not the current article, so we take a bet on | |
6359 ;; the value we got from the server. | |
6360 (mail-header-references header))) | |
6361 (if (and ref | |
6362 (not (equal ref ""))) | |
6363 (unless (gnus-summary-refer-article (gnus-parent-id ref skip)) | |
6364 (gnus-message 1 "Couldn't find parent")) | |
6365 (gnus-message 1 "No references in article %d" | |
6366 (gnus-summary-article-number)) | |
6367 (setq error t)) | |
6368 (decf n)) | |
6369 (gnus-summary-position-point) | |
6370 n)) | |
6371 | |
6372 (defun gnus-summary-refer-references () | |
6373 "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
|
6374 Return the number of articles fetched." |
17493 | 6375 (interactive) |
6376 (let ((ref (mail-header-references (gnus-summary-article-header))) | |
6377 (current (gnus-summary-article-number)) | |
6378 (n 0)) | |
6379 (if (or (not ref) | |
6380 (equal ref "")) | |
6381 (error "No References in the current article") | |
6382 ;; For each Message-ID in the References header... | |
6383 (while (string-match "<[^>]*>" ref) | |
6384 (incf n) | |
6385 ;; ... fetch that article. | |
6386 (gnus-summary-refer-article | |
6387 (prog1 (match-string 0 ref) | |
6388 (setq ref (substring ref (match-end 0)))))) | |
6389 (gnus-summary-goto-subject current) | |
6390 (gnus-summary-position-point) | |
6391 n))) | |
6392 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6393 (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
|
6394 "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
|
6395 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
|
6396 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
|
6397 (interactive "P") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6398 (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
|
6399 (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
|
6400 gnus-refer-thread-limit))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6401 ;; 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
|
6402 ;; 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
|
6403 ;; 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
|
6404 (when (numberp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6405 (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
|
6406 (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
|
6407 (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
|
6408 ;; 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
|
6409 (if (eq (gnus-retrieve-headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6410 (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
|
6411 'nov) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6412 (gnus-build-all-threads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6413 (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
|
6414 (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
|
6415 (gnus-summary-limit-include-thread id))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6416 |
17493 | 6417 (defun gnus-summary-refer-article (message-id &optional arg) |
6418 "Fetch an article specified by MESSAGE-ID. | |
6419 If ARG (the prefix), fetch the article using `gnus-refer-article-method' | |
6420 or `gnus-select-method', no matter what backend the article comes from." | |
6421 (interactive "sMessage-ID: \nP") | |
6422 (when (and (stringp message-id) | |
6423 (not (zerop (length message-id)))) | |
6424 ;; Construct the correct Message-ID if necessary. | |
6425 ;; Suggested by tale@pawl.rpi.edu. | |
6426 (unless (string-match "^<" message-id) | |
6427 (setq message-id (concat "<" message-id))) | |
6428 (unless (string-match ">$" message-id) | |
6429 (setq message-id (concat message-id ">"))) | |
6430 (let* ((header (gnus-id-to-header message-id)) | |
6431 (sparse (and header | |
6432 (gnus-summary-article-sparse-p | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6433 (mail-header-number header)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6434 (memq (mail-header-number header) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6435 gnus-newsgroup-limit)))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6436 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6437 ;; 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
|
6438 ((and header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6439 (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
|
6440 (mail-header-number header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6441 sparse)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6442 (prog1 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6443 (gnus-summary-goto-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6444 (mail-header-number header) nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6445 (when sparse |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6446 (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
|
6447 (t |
17493 | 6448 ;; We fetch the article |
6449 (let ((gnus-override-method | |
6450 (cond ((gnus-news-group-p gnus-newsgroup-name) | |
6451 gnus-refer-article-method) | |
6452 (arg | |
6453 (or gnus-refer-article-method gnus-select-method)) | |
6454 (t nil))) | |
6455 number) | |
6456 ;; Start the special refer-article method, if necessary. | |
6457 (when (and gnus-refer-article-method | |
6458 (gnus-news-group-p gnus-newsgroup-name)) | |
6459 (gnus-check-server gnus-refer-article-method)) | |
6460 ;; Fetch the header, and display the article. | |
6461 (if (setq number (gnus-summary-insert-subject message-id)) | |
6462 (gnus-summary-select-article nil nil nil number) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6463 (gnus-message 3 "Couldn't fetch article %s" message-id)))))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6464 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6465 (defun gnus-summary-edit-parameters () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6466 "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
|
6467 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6468 (gnus-group-edit-group gnus-newsgroup-name 'params)) |
17493 | 6469 |
6470 (defun gnus-summary-enter-digest-group (&optional force) | |
6471 "Enter an nndoc group based on the current article. | |
6472 If FORCE, force a digest interpretation. If not, try | |
6473 to guess what the document format is." | |
6474 (interactive "P") | |
6475 (let ((conf gnus-current-window-configuration)) | |
6476 (save-excursion | |
6477 (gnus-summary-select-article)) | |
6478 (setq gnus-current-window-configuration conf) | |
6479 (let* ((name (format "%s-%d" | |
6480 (gnus-group-prefixed-name | |
6481 gnus-newsgroup-name (list 'nndoc "")) | |
6482 (save-excursion | |
6483 (set-buffer gnus-summary-buffer) | |
6484 gnus-current-article))) | |
6485 (ogroup gnus-newsgroup-name) | |
6486 (params (append (gnus-info-params (gnus-get-info ogroup)) | |
6487 (list (cons 'to-group ogroup)) | |
6488 (list (cons 'save-article-group ogroup)))) | |
6489 (case-fold-search t) | |
6490 (buf (current-buffer)) | |
6491 dig) | |
6492 (save-excursion | |
6493 (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*")) | |
6494 (insert-buffer-substring gnus-original-article-buffer) | |
6495 ;; Remove lines that may lead nndoc to misinterpret the | |
6496 ;; document type. | |
6497 (narrow-to-region | |
6498 (goto-char (point-min)) | |
6499 (or (search-forward "\n\n" nil t) (point))) | |
6500 (goto-char (point-min)) | |
6501 (delete-matching-lines "^\\(Path\\):\\|^From ") | |
6502 (widen)) | |
6503 (unwind-protect | |
6504 (if (gnus-group-read-ephemeral-group | |
6505 name `(nndoc ,name (nndoc-address ,(get-buffer dig)) | |
6506 (nndoc-article-type | |
6507 ,(if force 'digest 'guess))) t) | |
6508 ;; Make all postings to this group go to the parent group. | |
6509 (nconc (gnus-info-params (gnus-get-info name)) | |
6510 params) | |
6511 ;; Couldn't select this doc group. | |
6512 (switch-to-buffer buf) | |
6513 (gnus-set-global-variables) | |
6514 (gnus-configure-windows 'summary) | |
6515 (gnus-message 3 "Article couldn't be entered?")) | |
6516 (kill-buffer dig))))) | |
6517 | |
6518 (defun gnus-summary-read-document (n) | |
6519 "Open a new group based on the current article(s). | |
6520 This will allow you to read digests and other similar | |
6521 documents as newsgroups. | |
6522 Obeys the standard process/prefix convention." | |
6523 (interactive "P") | |
6524 (let* ((articles (gnus-summary-work-articles n)) | |
6525 (ogroup gnus-newsgroup-name) | |
6526 (params (append (gnus-info-params (gnus-get-info ogroup)) | |
6527 (list (cons 'to-group ogroup)))) | |
6528 article group egroup groups vgroup) | |
6529 (while (setq article (pop articles)) | |
6530 (setq group (format "%s-%d" gnus-newsgroup-name article)) | |
6531 (gnus-summary-remove-process-mark article) | |
6532 (when (gnus-summary-display-article article) | |
6533 (save-excursion | |
6534 (nnheader-temp-write nil | |
6535 (insert-buffer-substring gnus-original-article-buffer) | |
6536 ;; Remove some headers that may lead nndoc to make | |
6537 ;; the wrong guess. | |
6538 (message-narrow-to-head) | |
6539 (goto-char (point-min)) | |
6540 (delete-matching-lines "^\\(Path\\):\\|^From ") | |
6541 (widen) | |
6542 (if (setq egroup | |
6543 (gnus-group-read-ephemeral-group | |
6544 group `(nndoc ,group (nndoc-address ,(current-buffer)) | |
6545 (nndoc-article-type guess)) | |
6546 t nil t)) | |
6547 (progn | |
6548 ;; Make all postings to this group go to the parent group. | |
6549 (nconc (gnus-info-params (gnus-get-info egroup)) | |
6550 params) | |
6551 (push egroup groups)) | |
6552 ;; Couldn't select this doc group. | |
6553 (gnus-error 3 "Article couldn't be entered")))))) | |
6554 ;; Now we have selected all the documents. | |
6555 (cond | |
6556 ((not groups) | |
6557 (error "None of the articles could be interpreted as documents")) | |
6558 ((gnus-group-read-ephemeral-group | |
6559 (setq vgroup (format | |
6560 "nnvirtual:%s-%s" gnus-newsgroup-name | |
6561 (format-time-string "%Y%m%dT%H%M%S" (current-time)))) | |
6562 `(nnvirtual ,vgroup (nnvirtual-component-groups ,groups)) | |
6563 t | |
6564 (cons (current-buffer) 'summary))) | |
6565 (t | |
6566 (error "Couldn't select virtual nndoc group"))))) | |
6567 | |
6568 (defun gnus-summary-isearch-article (&optional regexp-p) | |
6569 "Do incremental search forward on the current article. | |
6570 If REGEXP-P (the prefix) is non-nil, do regexp isearch." | |
6571 (interactive "P") | |
6572 (gnus-summary-select-article) | |
6573 (gnus-configure-windows 'article) | |
6574 (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
|
6575 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6576 (widen) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6577 (isearch-forward regexp-p)))) |
17493 | 6578 |
6579 (defun gnus-summary-search-article-forward (regexp &optional backward) | |
6580 "Search for an article containing REGEXP forward. | |
6581 If BACKWARD, search backward instead." | |
6582 (interactive | |
6583 (list (read-string | |
6584 (format "Search article %s (regexp%s): " | |
6585 (if current-prefix-arg "backward" "forward") | |
6586 (if gnus-last-search-regexp | |
6587 (concat ", default " gnus-last-search-regexp) | |
6588 ""))) | |
6589 current-prefix-arg)) | |
6590 (if (string-equal regexp "") | |
6591 (setq regexp (or gnus-last-search-regexp "")) | |
6592 (setq gnus-last-search-regexp regexp)) | |
6593 (if (gnus-summary-search-article regexp backward) | |
6594 (gnus-summary-show-thread) | |
6595 (error "Search failed: \"%s\"" regexp))) | |
6596 | |
6597 (defun gnus-summary-search-article-backward (regexp) | |
6598 "Search for an article containing REGEXP backward." | |
6599 (interactive | |
6600 (list (read-string | |
6601 (format "Search article backward (regexp%s): " | |
6602 (if gnus-last-search-regexp | |
6603 (concat ", default " gnus-last-search-regexp) | |
6604 ""))))) | |
6605 (gnus-summary-search-article-forward regexp 'backward)) | |
6606 | |
6607 (defun gnus-summary-search-article (regexp &optional backward) | |
6608 "Search for an article containing REGEXP. | |
6609 Optional argument BACKWARD means do search for backward. | |
6610 `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
|
6611 ;; 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
|
6612 ;; dynamic binding isn't shadowed by autoloading. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6613 (require 'gnus-async) |
17493 | 6614 (let ((gnus-select-article-hook nil) ;Disable hook. |
6615 (gnus-article-display-hook nil) | |
6616 (gnus-mark-article-hook nil) ;Inhibit marking as read. | |
6617 (gnus-use-article-prefetch nil) | |
6618 (gnus-xmas-force-redisplay nil) ;Inhibit XEmacs redisplay. | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6619 (gnus-use-trees nil) ;Inhibit updating tree buffer. |
17493 | 6620 (sum (current-buffer)) |
6621 (found nil) | |
6622 point) | |
6623 (gnus-save-hidden-threads | |
6624 (gnus-summary-select-article) | |
6625 (set-buffer gnus-article-buffer) | |
6626 (when backward | |
6627 (forward-line -1)) | |
6628 (while (not found) | |
6629 (gnus-message 7 "Searching article: %d..." (cdr gnus-article-current)) | |
6630 (if (if backward | |
6631 (re-search-backward regexp nil t) | |
6632 (re-search-forward regexp nil t)) | |
6633 ;; We found the regexp. | |
6634 (progn | |
6635 (setq found 'found) | |
6636 (beginning-of-line) | |
6637 (set-window-start | |
6638 (get-buffer-window (current-buffer)) | |
6639 (point)) | |
6640 (forward-line 1) | |
6641 (set-buffer sum) | |
6642 (setq point (point))) | |
6643 ;; We didn't find it, so we go to the next article. | |
6644 (set-buffer sum) | |
6645 (setq found 'not) | |
6646 (while (eq found 'not) | |
6647 (if (not (if backward (gnus-summary-find-prev) | |
6648 (gnus-summary-find-next))) | |
6649 ;; No more articles. | |
6650 (setq found t) | |
6651 ;; Select the next article and adjust point. | |
6652 (unless (gnus-summary-article-sparse-p | |
6653 (gnus-summary-article-number)) | |
6654 (setq found nil) | |
6655 (gnus-summary-select-article) | |
6656 (set-buffer gnus-article-buffer) | |
6657 (widen) | |
6658 (goto-char (if backward (point-max) (point-min)))))))) | |
6659 (gnus-message 7 "")) | |
6660 ;; Return whether we found the regexp. | |
6661 (when (eq found 'found) | |
6662 (goto-char point) | |
6663 (gnus-summary-show-thread) | |
6664 (gnus-summary-goto-subject gnus-current-article) | |
6665 (gnus-summary-position-point) | |
6666 t))) | |
6667 | |
6668 (defun gnus-summary-find-matching (header regexp &optional backward unread | |
6669 not-case-fold) | |
6670 "Return a list of all articles that match REGEXP on HEADER. | |
6671 The search stars on the current article and goes forwards unless | |
6672 BACKWARD is non-nil. If BACKWARD is `all', do all articles. | |
6673 If UNREAD is non-nil, only unread articles will | |
6674 be taken into consideration. If NOT-CASE-FOLD, case won't be folded | |
6675 in the comparisons." | |
6676 (let ((data (if (eq backward 'all) gnus-newsgroup-data | |
6677 (gnus-data-find-list | |
6678 (gnus-summary-article-number) (gnus-data-list backward)))) | |
6679 (func `(lambda (h) (,(intern (concat "mail-header-" header)) h))) | |
6680 (case-fold-search (not not-case-fold)) | |
6681 articles d) | |
6682 (unless (fboundp (intern (concat "mail-header-" header))) | |
6683 (error "%s is not a valid header" header)) | |
6684 (while data | |
6685 (setq d (car data)) | |
6686 (and (or (not unread) ; We want all articles... | |
6687 (gnus-data-unread-p d)) ; Or just unreads. | |
6688 (vectorp (gnus-data-header d)) ; It's not a pseudo. | |
6689 (string-match regexp (funcall func (gnus-data-header d))) ; Match. | |
6690 (push (gnus-data-number d) articles)) ; Success! | |
6691 (setq data (cdr data))) | |
6692 (nreverse articles))) | |
6693 | |
6694 (defun gnus-summary-execute-command (header regexp command &optional backward) | |
6695 "Search forward for an article whose HEADER matches REGEXP and execute COMMAND. | |
6696 If HEADER is an empty string (or nil), the match is done on the entire | |
6697 article. If BACKWARD (the prefix) is non-nil, search backward instead." | |
6698 (interactive | |
6699 (list (let ((completion-ignore-case t)) | |
6700 (completing-read | |
6701 "Header name: " | |
6702 (mapcar (lambda (string) (list string)) | |
6703 '("Number" "Subject" "From" "Lines" "Date" | |
6704 "Message-ID" "Xref" "References" "Body")) | |
6705 nil 'require-match)) | |
6706 (read-string "Regexp: ") | |
6707 (read-key-sequence "Command: ") | |
6708 current-prefix-arg)) | |
6709 (when (equal header "Body") | |
6710 (setq header "")) | |
6711 ;; Hidden thread subtrees must be searched as well. | |
6712 (gnus-summary-show-all-threads) | |
6713 ;; We don't want to change current point nor window configuration. | |
6714 (save-excursion | |
6715 (save-window-excursion | |
6716 (gnus-message 6 "Executing %s..." (key-description command)) | |
6717 ;; We'd like to execute COMMAND interactively so as to give arguments. | |
6718 (gnus-execute header regexp | |
6719 `(call-interactively ',(key-binding command)) | |
6720 backward) | |
6721 (gnus-message 6 "Executing %s...done" (key-description command))))) | |
6722 | |
6723 (defun gnus-summary-beginning-of-article () | |
6724 "Scroll the article back to the beginning." | |
6725 (interactive) | |
6726 (gnus-summary-select-article) | |
6727 (gnus-configure-windows 'article) | |
6728 (gnus-eval-in-buffer-window gnus-article-buffer | |
6729 (widen) | |
6730 (goto-char (point-min)) | |
6731 (when gnus-page-broken | |
6732 (gnus-narrow-to-page)))) | |
6733 | |
6734 (defun gnus-summary-end-of-article () | |
6735 "Scroll to the end of the article." | |
6736 (interactive) | |
6737 (gnus-summary-select-article) | |
6738 (gnus-configure-windows 'article) | |
6739 (gnus-eval-in-buffer-window gnus-article-buffer | |
6740 (widen) | |
6741 (goto-char (point-max)) | |
6742 (recenter -3) | |
6743 (when gnus-page-broken | |
6744 (gnus-narrow-to-page)))) | |
6745 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6746 (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
|
6747 "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
|
6748 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6749 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
|
6750 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
|
6751 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6752 If the optional second argument FILENAME is nil, send the image to the |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6753 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
|
6754 that name. If FILENAME is a number, prompt the user for the name of the file |
17493 | 6755 to save in." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6756 (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
|
6757 current-prefix-arg)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6758 (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
|
6759 (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
|
6760 (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
|
6761 (let ((buffer (generate-new-buffer " *print*"))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6762 (unwind-protect |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6763 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6764 (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
|
6765 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6766 (gnus-article-delete-invisible-text) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6767 (let ((ps-left-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6768 (list |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6769 (concat "(" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6770 (mail-header-subject gnus-current-headers) ")") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6771 (concat "(" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6772 (mail-header-from gnus-current-headers) ")"))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6773 (ps-right-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6774 (list |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6775 "/pagenumberstring load" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6776 (concat "(" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6777 (mail-header-date gnus-current-headers) ")")))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6778 (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
|
6779 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6780 (ps-print-buffer-with-faces filename)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6781 (kill-buffer buffer)))))) |
17493 | 6782 |
6783 (defun gnus-summary-show-article (&optional arg) | |
6784 "Force re-fetching of the current article. | |
6785 If ARG (the prefix) is non-nil, show the raw article without any | |
6786 article massaging functions being run." | |
6787 (interactive "P") | |
6788 (if (not arg) | |
6789 ;; Select the article the normal way. | |
6790 (gnus-summary-select-article nil 'force) | |
6791 ;; Bind the article treatment functions to nil. | |
6792 (let ((gnus-have-all-headers t) | |
6793 gnus-article-display-hook | |
6794 gnus-article-prepare-hook | |
6795 gnus-break-pages | |
6796 gnus-show-mime | |
6797 gnus-visual) | |
6798 (gnus-summary-select-article nil 'force))) | |
6799 (gnus-summary-goto-subject gnus-current-article) | |
6800 (gnus-summary-position-point)) | |
6801 | |
6802 (defun gnus-summary-verbose-headers (&optional arg) | |
6803 "Toggle permanent full header display. | |
6804 If ARG is a positive number, turn header display on. | |
6805 If ARG is a negative number, turn header display off." | |
6806 (interactive "P") | |
6807 (setq gnus-show-all-headers | |
6808 (cond ((or (not (numberp arg)) | |
6809 (zerop arg)) | |
6810 (not gnus-show-all-headers)) | |
6811 ((natnump arg) | |
6812 t))) | |
6813 (gnus-summary-show-article)) | |
6814 | |
6815 (defun gnus-summary-toggle-header (&optional arg) | |
6816 "Show the headers if they are hidden, or hide them if they are shown. | |
6817 If ARG is a positive number, show the entire header. | |
6818 If ARG is a negative number, hide the unwanted header lines." | |
6819 (interactive "P") | |
6820 (save-excursion | |
6821 (set-buffer gnus-article-buffer) | |
6822 (let* ((buffer-read-only nil) | |
6823 (inhibit-point-motion-hooks t) | |
6824 (hidden (text-property-any | |
6825 (goto-char (point-min)) (search-forward "\n\n") | |
6826 'invisible t)) | |
6827 e) | |
6828 (goto-char (point-min)) | |
6829 (when (search-forward "\n\n" nil t) | |
6830 (delete-region (point-min) (1- (point)))) | |
6831 (goto-char (point-min)) | |
6832 (save-excursion | |
6833 (set-buffer gnus-original-article-buffer) | |
6834 (goto-char (point-min)) | |
6835 (setq e (1- (or (search-forward "\n\n" nil t) (point-max))))) | |
6836 (insert-buffer-substring gnus-original-article-buffer 1 e) | |
6837 (let ((article-inhibit-hiding t)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6838 (gnus-run-hooks 'gnus-article-display-hook)) |
17493 | 6839 (when (or (not hidden) (and (numberp arg) (< arg 0))) |
6840 (gnus-article-hide-headers))))) | |
6841 | |
6842 (defun gnus-summary-show-all-headers () | |
6843 "Make all header lines visible." | |
6844 (interactive) | |
6845 (gnus-article-show-all-headers)) | |
6846 | |
6847 (defun gnus-summary-toggle-mime (&optional arg) | |
6848 "Toggle MIME processing. | |
6849 If ARG is a positive number, turn MIME processing on." | |
6850 (interactive "P") | |
6851 (setq gnus-show-mime | |
6852 (if (null arg) (not gnus-show-mime) | |
6853 (> (prefix-numeric-value arg) 0))) | |
6854 (gnus-summary-select-article t 'force)) | |
6855 | |
6856 (defun gnus-summary-caesar-message (&optional arg) | |
6857 "Caesar rotate the current article by 13. | |
6858 The numerical prefix specifies how many places to rotate each letter | |
6859 forward." | |
6860 (interactive "P") | |
6861 (gnus-summary-select-article) | |
6862 (let ((mail-header-separator "")) | |
6863 (gnus-eval-in-buffer-window gnus-article-buffer | |
6864 (save-restriction | |
6865 (widen) | |
6866 (let ((start (window-start)) | |
6867 buffer-read-only) | |
6868 (message-caesar-buffer-body arg) | |
6869 (set-window-start (get-buffer-window (current-buffer)) start)))))) | |
6870 | |
6871 (defun gnus-summary-stop-page-breaking () | |
6872 "Stop page breaking in the current article." | |
6873 (interactive) | |
6874 (gnus-summary-select-article) | |
6875 (gnus-eval-in-buffer-window gnus-article-buffer | |
6876 (widen) | |
6877 (when (gnus-visual-p 'page-marker) | |
6878 (let ((buffer-read-only nil)) | |
6879 (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
|
6880 (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
|
6881 (setq gnus-page-broken nil)))) |
17493 | 6882 |
6883 (defun gnus-summary-move-article (&optional n to-newsgroup | |
6884 select-method action) | |
6885 "Move the current article to a different newsgroup. | |
6886 If N is a positive number, move the N next articles. | |
6887 If N is a negative number, move the N previous articles. | |
6888 If N is nil and any articles have been marked with the process mark, | |
6889 move those articles instead. | |
6890 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to. | |
6891 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but | |
6892 re-spool using this method. | |
6893 | |
6894 For this function to work, both the current newsgroup and the | |
6895 newsgroup that you want to move to have to support the `request-move' | |
6896 and `request-accept' functions." | |
6897 (interactive "P") | |
6898 (unless action | |
6899 (setq action 'move)) | |
6900 ;; Disable marking as read. | |
6901 (let (gnus-mark-article-hook) | |
6902 (save-window-excursion | |
6903 (gnus-summary-select-article))) | |
6904 ;; Check whether the source group supports the required functions. | |
6905 (cond ((and (eq action 'move) | |
6906 (not (gnus-check-backend-function | |
6907 'request-move-article gnus-newsgroup-name))) | |
6908 (error "The current group does not support article moving")) | |
6909 ((and (eq action 'crosspost) | |
6910 (not (gnus-check-backend-function | |
6911 'request-replace-article gnus-newsgroup-name))) | |
6912 (error "The current group does not support article editing"))) | |
6913 (let ((articles (gnus-summary-work-articles n)) | |
6914 (prefix (gnus-group-real-prefix gnus-newsgroup-name)) | |
6915 (names '((move "Move" "Moving") | |
6916 (copy "Copy" "Copying") | |
6917 (crosspost "Crosspost" "Crossposting"))) | |
6918 (copy-buf (save-excursion | |
6919 (nnheader-set-temp-buffer " *copy article*"))) | |
6920 art-group to-method new-xref article to-groups) | |
6921 (unless (assq action names) | |
6922 (error "Unknown action %s" action)) | |
6923 ;; Read the newsgroup name. | |
6924 (when (and (not to-newsgroup) | |
6925 (not select-method)) | |
6926 (setq to-newsgroup | |
6927 (gnus-read-move-group-name | |
6928 (cadr (assq action names)) | |
6929 (symbol-value (intern (format "gnus-current-%s-group" action))) | |
6930 articles prefix)) | |
6931 (set (intern (format "gnus-current-%s-group" action)) to-newsgroup)) | |
6932 (setq to-method (or select-method | |
6933 (gnus-group-name-to-method to-newsgroup))) | |
6934 ;; Check the method we are to move this article to... | |
6935 (unless (gnus-check-backend-function | |
6936 'request-accept-article (car to-method)) | |
6937 (error "%s does not support article copying" (car to-method))) | |
6938 (unless (gnus-check-server to-method) | |
6939 (error "Can't open server %s" (car to-method))) | |
6940 (gnus-message 6 "%s to %s: %s..." | |
6941 (caddr (assq action names)) | |
6942 (or (car select-method) to-newsgroup) articles) | |
6943 (while articles | |
6944 (setq article (pop articles)) | |
6945 (setq | |
6946 art-group | |
6947 (cond | |
6948 ;; Move the article. | |
6949 ((eq action 'move) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6950 ;; Remove this article from future suppression. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6951 (gnus-dup-unsuppress-article article) |
17493 | 6952 (gnus-request-move-article |
6953 article ; Article to move | |
6954 gnus-newsgroup-name ; From newsgroup | |
6955 (nth 1 (gnus-find-method-for-group | |
6956 gnus-newsgroup-name)) ; Server | |
6957 (list 'gnus-request-accept-article | |
6958 to-newsgroup (list 'quote select-method) | |
6959 (not articles)) ; Accept form | |
6960 (not articles))) ; Only save nov last time | |
6961 ;; Copy the article. | |
6962 ((eq action 'copy) | |
6963 (save-excursion | |
6964 (set-buffer copy-buf) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6965 (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
|
6966 (gnus-request-accept-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6967 to-newsgroup select-method (not articles))))) |
17493 | 6968 ;; Crosspost the article. |
6969 ((eq action 'crosspost) | |
6970 (let ((xref (message-tokenize-header | |
6971 (mail-header-xref (gnus-summary-article-header article)) | |
6972 " "))) | |
6973 (setq new-xref (concat (gnus-group-real-name gnus-newsgroup-name) | |
6974 ":" article)) | |
6975 (unless xref | |
6976 (setq xref (list (system-name)))) | |
6977 (setq new-xref | |
6978 (concat | |
6979 (mapconcat 'identity | |
6980 (delete "Xref:" (delete new-xref xref)) | |
6981 " ") | |
6982 " " new-xref)) | |
6983 (save-excursion | |
6984 (set-buffer copy-buf) | |
6985 ;; First put the article in the destination group. | |
6986 (gnus-request-article-this-buffer article gnus-newsgroup-name) | |
6987 (when (consp (setq art-group | |
6988 (gnus-request-accept-article | |
6989 to-newsgroup select-method (not articles)))) | |
6990 (setq new-xref (concat new-xref " " (car art-group) | |
6991 ":" (cdr art-group))) | |
6992 ;; Now we have the new Xrefs header, so we insert | |
6993 ;; it and replace the new article. | |
6994 (nnheader-replace-header "Xref" new-xref) | |
6995 (gnus-request-replace-article | |
6996 (cdr art-group) to-newsgroup (current-buffer)) | |
6997 art-group)))))) | |
6998 (cond | |
6999 ((not art-group) | |
7000 (gnus-message 1 "Couldn't %s article %s" | |
7001 (cadr (assq action names)) article)) | |
7002 ((and (eq art-group 'junk) | |
7003 (eq action 'move)) | |
7004 (gnus-summary-mark-article article gnus-canceled-mark) | |
7005 (gnus-message 4 "Deleted article %s" article)) | |
7006 (t | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7007 (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
|
7008 (car art-group) to-method)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7009 (entry |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7010 (gnus-gethash pto-group gnus-newsrc-hashtb)) |
17493 | 7011 (info (nth 2 entry)) |
7012 (to-group (gnus-info-group info))) | |
7013 ;; Update the group that has been moved to. | |
7014 (when (and info | |
7015 (memq action '(move copy))) | |
7016 (unless (member to-group to-groups) | |
7017 (push to-group to-groups)) | |
7018 | |
7019 (unless (memq article gnus-newsgroup-unreads) | |
7020 (gnus-info-set-read | |
7021 info (gnus-add-to-range (gnus-info-read info) | |
7022 (list (cdr art-group))))) | |
7023 | |
7024 ;; Copy any marks over to the new group. | |
7025 (let ((marks gnus-article-mark-lists) | |
7026 (to-article (cdr art-group))) | |
7027 | |
7028 ;; See whether the article is to be put in the cache. | |
7029 (when gnus-use-cache | |
7030 (gnus-cache-possibly-enter-article | |
7031 to-group to-article | |
7032 (let ((header (copy-sequence | |
7033 (gnus-summary-article-header article)))) | |
7034 (mail-header-set-number header to-article) | |
7035 header) | |
7036 (memq article gnus-newsgroup-marked) | |
7037 (memq article gnus-newsgroup-dormant) | |
7038 (memq article gnus-newsgroup-unreads))) | |
7039 | |
7040 (when (and (equal to-group gnus-newsgroup-name) | |
7041 (not (memq article gnus-newsgroup-unreads))) | |
7042 ;; Mark this article as read in this group. | |
7043 (push (cons to-article gnus-read-mark) gnus-newsgroup-reads) | |
7044 (setcdr (gnus-active to-group) to-article) | |
7045 (setcdr gnus-newsgroup-active to-article)) | |
7046 | |
7047 (while marks | |
7048 (when (memq article (symbol-value | |
7049 (intern (format "gnus-newsgroup-%s" | |
7050 (caar marks))))) | |
7051 ;; If the other group is the same as this group, | |
7052 ;; then we have to add the mark to the list. | |
7053 (when (equal to-group gnus-newsgroup-name) | |
7054 (set (intern (format "gnus-newsgroup-%s" (caar marks))) | |
7055 (cons to-article | |
7056 (symbol-value | |
7057 (intern (format "gnus-newsgroup-%s" | |
7058 (caar marks))))))) | |
7059 ;; Copy the marks to other group. | |
7060 (gnus-add-marked-articles | |
7061 to-group (cdar marks) (list to-article) info)) | |
7062 (setq marks (cdr marks))) | |
7063 | |
7064 (gnus-dribble-enter | |
7065 (concat "(gnus-group-set-info '" | |
7066 (gnus-prin1-to-string (gnus-get-info to-group)) | |
7067 ")")))) | |
7068 | |
7069 ;; Update the Xref header in this article to point to | |
7070 ;; the new crossposted article we have just created. | |
7071 (when (eq action 'crosspost) | |
7072 (save-excursion | |
7073 (set-buffer copy-buf) | |
7074 (gnus-request-article-this-buffer article gnus-newsgroup-name) | |
7075 (nnheader-replace-header "Xref" new-xref) | |
7076 (gnus-request-replace-article | |
7077 article gnus-newsgroup-name (current-buffer))))) | |
7078 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7079 ;;;!!!Why is this necessary? |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7080 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7081 |
17493 | 7082 (gnus-summary-goto-subject article) |
7083 (when (eq action 'move) | |
7084 (gnus-summary-mark-article article gnus-canceled-mark)))) | |
7085 (gnus-summary-remove-process-mark article)) | |
7086 ;; Re-activate all groups that have been moved to. | |
7087 (while to-groups | |
7088 (save-excursion | |
7089 (set-buffer gnus-group-buffer) | |
7090 (when (gnus-group-goto-group (car to-groups) t) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7091 (gnus-group-get-new-news-this-group 1 t)) |
17493 | 7092 (pop to-groups))) |
7093 | |
7094 (gnus-kill-buffer copy-buf) | |
7095 (gnus-summary-position-point) | |
7096 (gnus-set-mode-line 'summary))) | |
7097 | |
7098 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method) | |
7099 "Move the current article to a different newsgroup. | |
7100 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to. | |
7101 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but | |
7102 re-spool using this method." | |
7103 (interactive "P") | |
7104 (gnus-summary-move-article n to-newsgroup select-method 'copy)) | |
7105 | |
7106 (defun gnus-summary-crosspost-article (&optional n) | |
7107 "Crosspost the current article to some other group." | |
7108 (interactive "P") | |
7109 (gnus-summary-move-article n nil nil 'crosspost)) | |
7110 | |
7111 (defcustom gnus-summary-respool-default-method nil | |
7112 "Default method for respooling an article. | |
7113 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
|
7114 :type '(choice (gnus-select-method :value (nnml "")) |
41843e16f6ac
(gnus-summary-respool-default-method): Fix type.
Karl Heuer <kwzh@gnu.org>
parents:
20117
diff
changeset
|
7115 (const nil)) |
17493 | 7116 :group 'gnus-summary-mail) |
7117 | |
7118 (defun gnus-summary-respool-article (&optional n method) | |
7119 "Respool the current article. | |
7120 The article will be squeezed through the mail spooling process again, | |
7121 which means that it will be put in some mail newsgroup or other | |
7122 depending on `nnmail-split-methods'. | |
7123 If N is a positive number, respool the N next articles. | |
7124 If N is a negative number, respool the N previous articles. | |
7125 If N is nil and any articles have been marked with the process mark, | |
7126 respool those articles instead. | |
7127 | |
7128 Respooling can be done both from mail groups and \"real\" newsgroups. | |
7129 In the former case, the articles in question will be moved from the | |
7130 current group into whatever groups they are destined to. In the | |
7131 latter case, they will be copied into the relevant groups." | |
7132 (interactive | |
7133 (list current-prefix-arg | |
7134 (let* ((methods (gnus-methods-using 'respool)) | |
7135 (methname | |
7136 (symbol-name (or gnus-summary-respool-default-method | |
7137 (car (gnus-find-method-for-group | |
7138 gnus-newsgroup-name))))) | |
7139 (method | |
7140 (gnus-completing-read | |
7141 methname "What backend do you want to use when respooling?" | |
7142 methods nil t nil 'gnus-mail-method-history)) | |
7143 ms) | |
7144 (cond | |
7145 ((zerop (length (setq ms (gnus-servers-using-backend | |
7146 (intern method))))) | |
7147 (list (intern method) "")) | |
7148 ((= 1 (length ms)) | |
7149 (car ms)) | |
7150 (t | |
7151 (let ((ms-alist (mapcar (lambda (m) (cons (cadr m) m)) ms))) | |
7152 (cdr (assoc (completing-read "Server name: " ms-alist nil t) | |
7153 ms-alist)))))))) | |
7154 (unless method | |
7155 (error "No method given for respooling")) | |
7156 (if (assoc (symbol-name | |
7157 (car (gnus-find-method-for-group gnus-newsgroup-name))) | |
7158 (gnus-methods-using 'respool)) | |
7159 (gnus-summary-move-article n nil method) | |
7160 (gnus-summary-copy-article n nil method))) | |
7161 | |
7162 (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
|
7163 "Import an arbitrary file into a mail newsgroup." |
17493 | 7164 (interactive "fImport file: ") |
7165 (let ((group gnus-newsgroup-name) | |
7166 (now (current-time)) | |
7167 atts lines) | |
7168 (unless (gnus-check-backend-function 'request-accept-article group) | |
7169 (error "%s does not support article importing" group)) | |
7170 (or (file-readable-p file) | |
7171 (not (file-regular-p file)) | |
7172 (error "Can't read %s" file)) | |
7173 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7174 (set-buffer (gnus-get-buffer-create " *import file*")) |
17493 | 7175 (buffer-disable-undo (current-buffer)) |
7176 (erase-buffer) | |
7177 (insert-file-contents file) | |
7178 (goto-char (point-min)) | |
7179 (unless (nnheader-article-p) | |
7180 ;; This doesn't look like an article, so we fudge some headers. | |
7181 (setq atts (file-attributes file) | |
7182 lines (count-lines (point-min) (point-max))) | |
7183 (insert "From: " (read-string "From: ") "\n" | |
7184 "Subject: " (read-string "Subject: ") "\n" | |
7185 "Date: " (timezone-make-date-arpa-standard | |
7186 (current-time-string (nth 5 atts)) | |
7187 (current-time-zone now) | |
7188 (current-time-zone now)) | |
7189 "\n" | |
7190 "Message-ID: " (message-make-message-id) "\n" | |
7191 "Lines: " (int-to-string lines) "\n" | |
7192 "Chars: " (int-to-string (nth 7 atts)) "\n\n")) | |
7193 (gnus-request-accept-article group nil t) | |
7194 (kill-buffer (current-buffer))))) | |
7195 | |
7196 (defun gnus-summary-article-posted-p () | |
7197 "Say whether the current (mail) article is available from `gnus-select-method' as well. | |
7198 This will be the case if the article has both been mailed and posted." | |
7199 (interactive) | |
7200 (let ((id (mail-header-references (gnus-summary-article-header))) | |
7201 (gnus-override-method | |
7202 (or gnus-refer-article-method gnus-select-method))) | |
7203 (if (gnus-request-head id "") | |
7204 (gnus-message 2 "The current message was found on %s" | |
7205 gnus-override-method) | |
7206 (gnus-message 2 "The current message couldn't be found on %s" | |
7207 gnus-override-method) | |
7208 nil))) | |
7209 | |
7210 (defun gnus-summary-expire-articles (&optional now) | |
7211 "Expire all articles that are marked as expirable in the current group." | |
7212 (interactive) | |
7213 (when (gnus-check-backend-function | |
7214 'request-expire-articles gnus-newsgroup-name) | |
7215 ;; This backend supports expiry. | |
7216 (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name)) | |
7217 (expirable (if total | |
7218 (progn | |
7219 ;; We need to update the info for | |
7220 ;; this group for `gnus-list-of-read-articles' | |
7221 ;; 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
|
7222 (gnus-run-hooks 'gnus-exit-group-hook) |
17493 | 7223 (gnus-summary-update-info) |
7224 (gnus-list-of-read-articles gnus-newsgroup-name)) | |
7225 (setq gnus-newsgroup-expirable | |
7226 (sort gnus-newsgroup-expirable '<)))) | |
7227 (expiry-wait (if now 'immediate | |
7228 (gnus-group-find-parameter | |
7229 gnus-newsgroup-name 'expiry-wait))) | |
7230 es) | |
7231 (when expirable | |
7232 ;; There are expirable articles in this group, so we run them | |
7233 ;; through the expiry process. | |
7234 (gnus-message 6 "Expiring articles...") | |
7235 ;; 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
|
7236 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7237 (if expiry-wait |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7238 (let ((nnmail-expiry-wait-function nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7239 (nnmail-expiry-wait expiry-wait)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7240 (setq es (gnus-request-expire-articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7241 expirable gnus-newsgroup-name))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7242 (setq es (gnus-request-expire-articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7243 expirable gnus-newsgroup-name)))) |
17493 | 7244 (unless total |
7245 (setq gnus-newsgroup-expirable es)) | |
7246 ;; We go through the old list of expirable, and mark all | |
7247 ;; really expired articles as nonexistent. | |
7248 (unless (eq es expirable) ;If nothing was expired, we don't mark. | |
7249 (let ((gnus-use-cache nil)) | |
7250 (while expirable | |
7251 (unless (memq (car expirable) es) | |
7252 (when (gnus-data-find (car expirable)) | |
7253 (gnus-summary-mark-article | |
7254 (car expirable) gnus-canceled-mark))) | |
7255 (setq expirable (cdr expirable))))) | |
7256 (gnus-message 6 "Expiring articles...done"))))) | |
7257 | |
7258 (defun gnus-summary-expire-articles-now () | |
7259 "Expunge all expirable articles in the current group. | |
7260 This means that *all* articles that are marked as expirable will be | |
7261 deleted forever, right now." | |
7262 (interactive) | |
7263 (or gnus-expert-user | |
7264 (gnus-yes-or-no-p | |
7265 "Are you really, really, really sure you want to delete all these messages? ") | |
7266 (error "Phew!")) | |
7267 (gnus-summary-expire-articles t)) | |
7268 | |
7269 ;; Suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>. | |
7270 (defun gnus-summary-delete-article (&optional n) | |
7271 "Delete the N next (mail) articles. | |
7272 This command actually deletes articles. This is not a marking | |
7273 command. The article will disappear forever from your life, never to | |
7274 return. | |
7275 If N is negative, delete backwards. | |
7276 If N is nil and articles have been marked with the process mark, | |
7277 delete these instead." | |
7278 (interactive "P") | |
7279 (unless (gnus-check-backend-function 'request-expire-articles | |
7280 gnus-newsgroup-name) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7281 (error "The current newsgroup does not support article deletion")) |
17493 | 7282 ;; 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
|
7283 (let ((articles (sort (copy-sequence (gnus-summary-work-articles n)) '<)) |
17493 | 7284 not-deleted) |
7285 (if (and gnus-novice-user | |
7286 (not (gnus-yes-or-no-p | |
7287 (format "Do you really want to delete %s forever? " | |
7288 (if (> (length articles) 1) | |
7289 (format "these %s articles" (length articles)) | |
7290 "this article"))))) | |
7291 () | |
7292 ;; Delete the articles. | |
7293 (setq not-deleted (gnus-request-expire-articles | |
7294 articles gnus-newsgroup-name 'force)) | |
7295 (while articles | |
7296 (gnus-summary-remove-process-mark (car articles)) | |
7297 ;; The backend might not have been able to delete the article | |
7298 ;; after all. | |
7299 (unless (memq (car articles) not-deleted) | |
7300 (gnus-summary-mark-article (car articles) gnus-canceled-mark)) | |
7301 (setq articles (cdr articles))) | |
7302 (when not-deleted | |
7303 (gnus-message 4 "Couldn't delete articles %s" not-deleted))) | |
7304 (gnus-summary-position-point) | |
7305 (gnus-set-mode-line 'summary) | |
7306 not-deleted)) | |
7307 | |
7308 (defun gnus-summary-edit-article (&optional force) | |
7309 "Edit the current article. | |
7310 This will have permanent effect only in mail groups. | |
7311 If FORCE is non-nil, allow editing of articles even in read-only | |
7312 groups." | |
7313 (interactive "P") | |
7314 (save-excursion | |
7315 (set-buffer gnus-summary-buffer) | |
7316 (gnus-set-global-variables) | |
7317 (when (and (not force) | |
7318 (gnus-group-read-only-p)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7319 (error "The current newsgroup does not support article editing")) |
17493 | 7320 ;; Select article if needed. |
7321 (unless (eq (gnus-summary-article-number) | |
7322 gnus-current-article) | |
7323 (gnus-summary-select-article t)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7324 (gnus-article-date-original) |
17493 | 7325 (gnus-article-edit-article |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7326 `(lambda (no-highlight) |
17493 | 7327 (gnus-summary-edit-article-done |
7328 ,(or (mail-header-references gnus-current-headers) "") | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7329 ,(gnus-group-read-only-p) ,gnus-summary-buffer no-highlight))))) |
17493 | 7330 |
7331 (defalias 'gnus-summary-edit-article-postpone 'gnus-article-edit-exit) | |
7332 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7333 (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
|
7334 no-highlight) |
17493 | 7335 "Make edits to the current article permanent." |
7336 (interactive) | |
7337 ;; Replace the article. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7338 (let ((buf (current-buffer))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7339 (nnheader-temp-write nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7340 (insert-buffer buf) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7341 (if (and (not read-only) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7342 (not (gnus-request-replace-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7343 (cdr gnus-article-current) (car gnus-article-current) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7344 (current-buffer)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7345 (error "Couldn't replace article") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7346 ;; Update the summary buffer. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7347 (if (and references |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7348 (equal (message-tokenize-header references " ") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7349 (message-tokenize-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7350 (or (message-fetch-field "references") "") " "))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7351 ;; 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
|
7352 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7353 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7354 (message-narrow-to-head) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7355 (let ((head (buffer-string)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7356 header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7357 (nnheader-temp-write nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7358 (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
|
7359 (cdr gnus-article-current))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7360 (insert head) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7361 (insert ".\n") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7362 (let ((nntp-server-buffer (current-buffer))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7363 (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
|
7364 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7365 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7366 gnus-newsgroup-dependencies) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7367 t)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7368 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7369 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7370 (gnus-data-set-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7371 (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
|
7372 header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7373 (gnus-summary-update-article-line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7374 (cdr gnus-article-current) header)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7375 ;; Update threads. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7376 (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
|
7377 (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
|
7378 ;; Prettify the article buffer again. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7379 (unless no-highlight |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7380 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7381 (set-buffer gnus-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7382 (gnus-run-hooks 'gnus-article-display-hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7383 (set-buffer gnus-original-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7384 (gnus-request-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7385 (cdr gnus-article-current) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7386 (car gnus-article-current) (current-buffer)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7387 ;; Prettify the summary buffer line. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7388 (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
|
7389 (gnus-run-hooks 'gnus-visual-mark-article-hook)))))) |
17493 | 7390 |
7391 (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
|
7392 "Perform editing command KEY in the article buffer." |
17493 | 7393 (interactive |
7394 (list | |
7395 (progn | |
7396 (message "%s" (concat (this-command-keys) "- ")) | |
7397 (read-char)))) | |
7398 (message "") | |
7399 (gnus-summary-edit-article) | |
7400 (execute-kbd-macro (concat (this-command-keys) key)) | |
7401 (gnus-article-edit-done)) | |
7402 | |
7403 ;;; Respooling | |
7404 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7405 (defun gnus-summary-respool-query (&optional silent trace) |
17493 | 7406 "Query where the respool algorithm would put this article." |
7407 (interactive) | |
7408 (let (gnus-mark-article-hook) | |
7409 (gnus-summary-select-article) | |
7410 (save-excursion | |
7411 (set-buffer gnus-original-article-buffer) | |
7412 (save-restriction | |
7413 (message-narrow-to-head) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7414 (let ((groups (nnmail-article-group 'identity trace))) |
17493 | 7415 (unless silent |
7416 (if groups | |
7417 (message "This message would go to %s" | |
7418 (mapconcat 'car groups ", ")) | |
7419 (message "This message would go to no groups")) | |
7420 groups)))))) | |
7421 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7422 (defun gnus-summary-respool-trace () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7423 "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
|
7424 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
|
7425 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7426 (gnus-summary-respool-query nil t)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7427 |
17493 | 7428 ;; Summary marking commands. |
7429 | |
7430 (defun gnus-summary-kill-same-subject-and-select (&optional unmark) | |
7431 "Mark articles which has the same subject as read, and then select the next. | |
7432 If UNMARK is positive, remove any kind of mark. | |
7433 If UNMARK is negative, tick articles." | |
7434 (interactive "P") | |
7435 (when unmark | |
7436 (setq unmark (prefix-numeric-value unmark))) | |
7437 (let ((count | |
7438 (gnus-summary-mark-same-subject | |
7439 (gnus-summary-article-subject) unmark))) | |
7440 ;; Select next unread article. If auto-select-same mode, should | |
7441 ;; select the first unread article. | |
7442 (gnus-summary-next-article t (and gnus-auto-select-same | |
7443 (gnus-summary-article-subject))) | |
7444 (gnus-message 7 "%d article%s marked as %s" | |
7445 count (if (= count 1) " is" "s are") | |
7446 (if unmark "unread" "read")))) | |
7447 | |
7448 (defun gnus-summary-kill-same-subject (&optional unmark) | |
7449 "Mark articles which has the same subject as read. | |
7450 If UNMARK is positive, remove any kind of mark. | |
7451 If UNMARK is negative, tick articles." | |
7452 (interactive "P") | |
7453 (when unmark | |
7454 (setq unmark (prefix-numeric-value unmark))) | |
7455 (let ((count | |
7456 (gnus-summary-mark-same-subject | |
7457 (gnus-summary-article-subject) unmark))) | |
7458 ;; If marked as read, go to next unread subject. | |
7459 (when (null unmark) | |
7460 ;; Go to next unread subject. | |
7461 (gnus-summary-next-subject 1 t)) | |
7462 (gnus-message 7 "%d articles are marked as %s" | |
7463 count (if unmark "unread" "read")))) | |
7464 | |
7465 (defun gnus-summary-mark-same-subject (subject &optional unmark) | |
7466 "Mark articles with same SUBJECT as read, and return marked number. | |
7467 If optional argument UNMARK is positive, remove any kinds of marks. | |
7468 If optional argument UNMARK is negative, mark articles as unread instead." | |
7469 (let ((count 1)) | |
7470 (save-excursion | |
7471 (cond | |
7472 ((null unmark) ; Mark as read. | |
7473 (while (and | |
7474 (progn | |
7475 (gnus-summary-mark-article-as-read gnus-killed-mark) | |
7476 (gnus-summary-show-thread) t) | |
7477 (gnus-summary-find-subject subject)) | |
7478 (setq count (1+ count)))) | |
7479 ((> unmark 0) ; Tick. | |
7480 (while (and | |
7481 (progn | |
7482 (gnus-summary-mark-article-as-unread gnus-ticked-mark) | |
7483 (gnus-summary-show-thread) t) | |
7484 (gnus-summary-find-subject subject)) | |
7485 (setq count (1+ count)))) | |
7486 (t ; Mark as unread. | |
7487 (while (and | |
7488 (progn | |
7489 (gnus-summary-mark-article-as-unread gnus-unread-mark) | |
7490 (gnus-summary-show-thread) t) | |
7491 (gnus-summary-find-subject subject)) | |
7492 (setq count (1+ count))))) | |
7493 (gnus-set-mode-line 'summary) | |
7494 ;; Return the number of marked articles. | |
7495 count))) | |
7496 | |
7497 (defun gnus-summary-mark-as-processable (n &optional unmark) | |
7498 "Set the process mark on the next N articles. | |
7499 If N is negative, mark backward instead. If UNMARK is non-nil, remove | |
7500 the process mark instead. The difference between N and the actual | |
7501 number of articles marked is returned." | |
7502 (interactive "p") | |
7503 (let ((backward (< n 0)) | |
7504 (n (abs n))) | |
7505 (while (and | |
7506 (> n 0) | |
7507 (if unmark | |
7508 (gnus-summary-remove-process-mark | |
7509 (gnus-summary-article-number)) | |
7510 (gnus-summary-set-process-mark (gnus-summary-article-number))) | |
7511 (zerop (gnus-summary-next-subject (if backward -1 1) nil t))) | |
7512 (setq n (1- n))) | |
7513 (when (/= 0 n) | |
7514 (gnus-message 7 "No more articles")) | |
7515 (gnus-summary-recenter) | |
7516 (gnus-summary-position-point) | |
7517 n)) | |
7518 | |
7519 (defun gnus-summary-unmark-as-processable (n) | |
7520 "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
|
7521 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
|
7522 the actual number of articles unmarked is returned." |
17493 | 7523 (interactive "p") |
7524 (gnus-summary-mark-as-processable n t)) | |
7525 | |
7526 (defun gnus-summary-unmark-all-processable () | |
7527 "Remove the process mark from all articles." | |
7528 (interactive) | |
7529 (save-excursion | |
7530 (while gnus-newsgroup-processable | |
7531 (gnus-summary-remove-process-mark (car gnus-newsgroup-processable)))) | |
7532 (gnus-summary-position-point)) | |
7533 | |
7534 (defun gnus-summary-mark-as-expirable (n) | |
7535 "Mark N articles forward as expirable. | |
7536 If N is negative, mark backward instead. The difference between N and | |
7537 the actual number of articles marked is returned." | |
7538 (interactive "p") | |
7539 (gnus-summary-mark-forward n gnus-expirable-mark)) | |
7540 | |
7541 (defun gnus-summary-mark-article-as-replied (article) | |
7542 "Mark ARTICLE replied and update the summary line." | |
7543 (push article gnus-newsgroup-replied) | |
7544 (let ((buffer-read-only nil)) | |
7545 (when (gnus-summary-goto-subject article) | |
7546 (gnus-summary-update-secondary-mark article)))) | |
7547 | |
7548 (defun gnus-summary-set-bookmark (article) | |
7549 "Set a bookmark in current article." | |
7550 (interactive (list (gnus-summary-article-number))) | |
7551 (when (or (not (get-buffer gnus-article-buffer)) | |
7552 (not gnus-current-article) | |
7553 (not gnus-article-current) | |
7554 (not (equal gnus-newsgroup-name (car gnus-article-current)))) | |
7555 (error "No current article selected")) | |
7556 ;; Remove old bookmark, if one exists. | |
7557 (let ((old (assq article gnus-newsgroup-bookmarks))) | |
7558 (when old | |
7559 (setq gnus-newsgroup-bookmarks | |
7560 (delq old gnus-newsgroup-bookmarks)))) | |
7561 ;; Set the new bookmark, which is on the form | |
7562 ;; (article-number . line-number-in-body). | |
7563 (push | |
7564 (cons article | |
7565 (save-excursion | |
7566 (set-buffer gnus-article-buffer) | |
7567 (count-lines | |
7568 (min (point) | |
7569 (save-excursion | |
7570 (goto-char (point-min)) | |
7571 (search-forward "\n\n" nil t) | |
7572 (point))) | |
7573 (point)))) | |
7574 gnus-newsgroup-bookmarks) | |
7575 (gnus-message 6 "A bookmark has been added to the current article.")) | |
7576 | |
7577 (defun gnus-summary-remove-bookmark (article) | |
7578 "Remove the bookmark from the current article." | |
7579 (interactive (list (gnus-summary-article-number))) | |
7580 ;; Remove old bookmark, if one exists. | |
7581 (let ((old (assq article gnus-newsgroup-bookmarks))) | |
7582 (if old | |
7583 (progn | |
7584 (setq gnus-newsgroup-bookmarks | |
7585 (delq old gnus-newsgroup-bookmarks)) | |
7586 (gnus-message 6 "Removed bookmark.")) | |
7587 (gnus-message 6 "No bookmark in current article.")))) | |
7588 | |
7589 ;; Suggested by Daniel Quinlan <quinlan@best.com>. | |
7590 (defun gnus-summary-mark-as-dormant (n) | |
7591 "Mark N articles forward as dormant. | |
7592 If N is negative, mark backward instead. The difference between N and | |
7593 the actual number of articles marked is returned." | |
7594 (interactive "p") | |
7595 (gnus-summary-mark-forward n gnus-dormant-mark)) | |
7596 | |
7597 (defun gnus-summary-set-process-mark (article) | |
7598 "Set the process mark on ARTICLE and update the summary line." | |
7599 (setq gnus-newsgroup-processable | |
7600 (cons article | |
7601 (delq article gnus-newsgroup-processable))) | |
7602 (when (gnus-summary-goto-subject article) | |
7603 (gnus-summary-show-thread) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7604 (gnus-summary-goto-subject article) |
17493 | 7605 (gnus-summary-update-secondary-mark article))) |
7606 | |
7607 (defun gnus-summary-remove-process-mark (article) | |
7608 "Remove the process mark from ARTICLE and update the summary line." | |
7609 (setq gnus-newsgroup-processable (delq article gnus-newsgroup-processable)) | |
7610 (when (gnus-summary-goto-subject article) | |
7611 (gnus-summary-show-thread) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7612 (gnus-summary-goto-subject article) |
17493 | 7613 (gnus-summary-update-secondary-mark article))) |
7614 | |
7615 (defun gnus-summary-set-saved-mark (article) | |
7616 "Set the process mark on ARTICLE and update the summary line." | |
7617 (push article gnus-newsgroup-saved) | |
7618 (when (gnus-summary-goto-subject article) | |
7619 (gnus-summary-update-secondary-mark article))) | |
7620 | |
7621 (defun gnus-summary-mark-forward (n &optional mark no-expire) | |
7622 "Mark N articles as read forwards. | |
7623 If N is negative, mark backwards instead. Mark with MARK, ?r by default. | |
7624 The difference between N and the actual number of articles marked is | |
7625 returned." | |
7626 (interactive "p") | |
7627 (let ((backward (< n 0)) | |
7628 (gnus-summary-goto-unread | |
7629 (and gnus-summary-goto-unread | |
7630 (not (eq gnus-summary-goto-unread 'never)) | |
7631 (not (memq mark (list gnus-unread-mark | |
7632 gnus-ticked-mark gnus-dormant-mark))))) | |
7633 (n (abs n)) | |
7634 (mark (or mark gnus-del-mark))) | |
7635 (while (and (> n 0) | |
7636 (gnus-summary-mark-article nil mark no-expire) | |
7637 (zerop (gnus-summary-next-subject | |
7638 (if backward -1 1) | |
7639 (and gnus-summary-goto-unread | |
7640 (not (eq gnus-summary-goto-unread 'never))) | |
7641 t))) | |
7642 (setq n (1- n))) | |
7643 (when (/= 0 n) | |
7644 (gnus-message 7 "No more %sarticles" (if mark "" "unread "))) | |
7645 (gnus-summary-recenter) | |
7646 (gnus-summary-position-point) | |
7647 (gnus-set-mode-line 'summary) | |
7648 n)) | |
7649 | |
7650 (defun gnus-summary-mark-article-as-read (mark) | |
7651 "Mark the current article quickly as read with MARK." | |
7652 (let ((article (gnus-summary-article-number))) | |
7653 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) | |
7654 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) | |
7655 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) | |
7656 (push (cons article mark) gnus-newsgroup-reads) | |
7657 ;; Possibly remove from cache, if that is used. | |
7658 (when gnus-use-cache | |
7659 (gnus-cache-enter-remove-article article)) | |
7660 ;; Allow the backend to change the mark. | |
7661 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) | |
7662 ;; Check for auto-expiry. | |
7663 (when (and gnus-newsgroup-auto-expire | |
7664 (or (= mark gnus-killed-mark) (= mark gnus-del-mark) | |
7665 (= mark gnus-catchup-mark) (= mark gnus-low-score-mark) | |
7666 (= mark gnus-ancient-mark) | |
7667 (= mark gnus-read-mark) (= mark gnus-souped-mark) | |
7668 (= mark gnus-duplicate-mark))) | |
7669 (setq mark gnus-expirable-mark) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7670 ;; 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
|
7671 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) |
17493 | 7672 (push article gnus-newsgroup-expirable)) |
7673 ;; Set the mark in the buffer. | |
7674 (gnus-summary-update-mark mark 'unread) | |
7675 t)) | |
7676 | |
7677 (defun gnus-summary-mark-article-as-unread (mark) | |
7678 "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
|
7679 (let* ((article (gnus-summary-article-number)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7680 (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
|
7681 ;; 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
|
7682 (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
|
7683 (if (eq mark old-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7684 t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7685 (if (<= article 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7686 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7687 (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
|
7688 nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7689 (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
|
7690 (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
|
7691 (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
|
7692 (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
|
7693 (cond ((= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7694 (push article gnus-newsgroup-marked)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7695 ((= mark gnus-dormant-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7696 (push article gnus-newsgroup-dormant)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7697 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7698 (push article gnus-newsgroup-unreads))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7699 (gnus-pull article gnus-newsgroup-reads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7700 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7701 ;; 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
|
7702 (and gnus-use-cache |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7703 (vectorp (gnus-summary-article-header article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7704 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7705 (gnus-cache-possibly-enter-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7706 gnus-newsgroup-name article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7707 (gnus-summary-article-header article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7708 (= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7709 (= 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
|
7710 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7711 ;; Fix the mark. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7712 (gnus-summary-update-mark mark 'unread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7713 t)))) |
17493 | 7714 |
7715 (defun gnus-summary-mark-article (&optional article mark no-expire) | |
7716 "Mark ARTICLE with MARK. MARK can be any character. | |
7717 Four MARK strings are reserved: `? ' (unread), `?!' (ticked), | |
7718 `??' (dormant) and `?E' (expirable). | |
7719 If MARK is nil, then the default character `?D' is used. | |
7720 If ARTICLE is nil, then the article on the current line will be | |
7721 marked." | |
7722 ;; The mark might be a string. | |
7723 (when (stringp mark) | |
7724 (setq mark (aref mark 0))) | |
7725 ;; If no mark is given, then we check auto-expiring. | |
7726 (and (not no-expire) | |
7727 gnus-newsgroup-auto-expire | |
7728 (or (not mark) | |
7729 (and (gnus-characterp mark) | |
7730 (or (= mark gnus-killed-mark) (= mark gnus-del-mark) | |
7731 (= mark gnus-catchup-mark) (= mark gnus-low-score-mark) | |
7732 (= mark gnus-read-mark) (= mark gnus-souped-mark) | |
7733 (= mark gnus-duplicate-mark)))) | |
7734 (setq mark gnus-expirable-mark)) | |
7735 (let* ((mark (or mark gnus-del-mark)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7736 (article (or article (gnus-summary-article-number))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7737 (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
|
7738 ;; 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
|
7739 (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
|
7740 (if (eq mark old-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7741 t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7742 (unless article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7743 (error "No article on current line")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7744 (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
|
7745 (= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7746 (= mark gnus-dormant-mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7747 (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
|
7748 (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
|
7749 t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7750 ;; 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
|
7751 (and gnus-use-cache |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7752 (not (= mark gnus-canceled-mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7753 (vectorp (gnus-summary-article-header article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7754 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7755 (gnus-cache-possibly-enter-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7756 gnus-newsgroup-name article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7757 (gnus-summary-article-header article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7758 (= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7759 (= 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
|
7760 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7761 (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
|
7762 (let ((buffer-read-only nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7763 (gnus-summary-show-thread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7764 ;; Fix the mark. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7765 (gnus-summary-update-mark mark 'unread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7766 t)))))) |
17493 | 7767 |
7768 (defun gnus-summary-update-secondary-mark (article) | |
7769 "Update the secondary (read, process, cache) mark." | |
7770 (gnus-summary-update-mark | |
7771 (cond ((memq article gnus-newsgroup-processable) | |
7772 gnus-process-mark) | |
7773 ((memq article gnus-newsgroup-cached) | |
7774 gnus-cached-mark) | |
7775 ((memq article gnus-newsgroup-replied) | |
7776 gnus-replied-mark) | |
7777 ((memq article gnus-newsgroup-saved) | |
7778 gnus-saved-mark) | |
7779 (t gnus-unread-mark)) | |
7780 'replied) | |
7781 (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
|
7782 (gnus-run-hooks 'gnus-summary-update-hook)) |
17493 | 7783 t) |
7784 | |
7785 (defun gnus-summary-update-mark (mark type) | |
7786 (let ((forward (cdr (assq type gnus-summary-mark-positions))) | |
7787 (buffer-read-only nil)) | |
7788 (re-search-backward "[\n\r]" (gnus-point-at-bol) 'move-to-limit) | |
7789 (when (looking-at "\r") | |
7790 (incf forward)) | |
7791 (when (and forward | |
7792 (<= (+ forward (point)) (point-max))) | |
7793 ;; Go to the right position on the line. | |
7794 (goto-char (+ forward (point))) | |
7795 ;; Replace the old mark with the new mark. | |
7796 (subst-char-in-region (point) (1+ (point)) (following-char) mark) | |
7797 ;; Optionally update the marks by some user rule. | |
7798 (when (eq type 'unread) | |
7799 (gnus-data-set-mark | |
7800 (gnus-data-find (gnus-summary-article-number)) mark) | |
7801 (gnus-summary-update-line (eq mark gnus-unread-mark)))))) | |
7802 | |
7803 (defun gnus-mark-article-as-read (article &optional mark) | |
7804 "Enter ARTICLE in the pertinent lists and remove it from others." | |
7805 ;; Make the article expirable. | |
7806 (let ((mark (or mark gnus-del-mark))) | |
7807 (if (= mark gnus-expirable-mark) | |
7808 (push article gnus-newsgroup-expirable) | |
7809 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))) | |
7810 ;; Remove from unread and marked lists. | |
7811 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) | |
7812 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) | |
7813 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) | |
7814 (push (cons article mark) gnus-newsgroup-reads) | |
7815 ;; Possibly remove from cache, if that is used. | |
7816 (when gnus-use-cache | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7817 (gnus-cache-enter-remove-article article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7818 t)) |
17493 | 7819 |
7820 (defun gnus-mark-article-as-unread (article &optional mark) | |
7821 "Enter ARTICLE in the pertinent lists and remove it from others." | |
7822 (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
|
7823 (if (<= article 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7824 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7825 (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
|
7826 nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7827 (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
|
7828 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
|
7829 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
|
7830 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
|
7831 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7832 ;; Unsuppress duplicates? |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7833 (when gnus-suppress-duplicates |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7834 (gnus-dup-unsuppress-article article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7835 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7836 (cond ((= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7837 (push article gnus-newsgroup-marked)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7838 ((= mark gnus-dormant-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7839 (push article gnus-newsgroup-dormant)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7840 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7841 (push article gnus-newsgroup-unreads))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7842 (gnus-pull article gnus-newsgroup-reads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7843 t))) |
17493 | 7844 |
7845 (defalias 'gnus-summary-mark-as-unread-forward | |
7846 'gnus-summary-tick-article-forward) | |
7847 (make-obsolete 'gnus-summary-mark-as-unread-forward | |
7848 'gnus-summary-tick-article-forward) | |
7849 (defun gnus-summary-tick-article-forward (n) | |
7850 "Tick N articles forwards. | |
7851 If N is negative, tick backwards instead. | |
7852 The difference between N and the number of articles ticked is returned." | |
7853 (interactive "p") | |
7854 (gnus-summary-mark-forward n gnus-ticked-mark)) | |
7855 | |
7856 (defalias 'gnus-summary-mark-as-unread-backward | |
7857 'gnus-summary-tick-article-backward) | |
7858 (make-obsolete 'gnus-summary-mark-as-unread-backward | |
7859 'gnus-summary-tick-article-backward) | |
7860 (defun gnus-summary-tick-article-backward (n) | |
7861 "Tick N articles backwards. | |
7862 The difference between N and the number of articles ticked is returned." | |
7863 (interactive "p") | |
7864 (gnus-summary-mark-forward (- n) gnus-ticked-mark)) | |
7865 | |
7866 (defalias 'gnus-summary-mark-as-unread 'gnus-summary-tick-article) | |
7867 (make-obsolete 'gnus-summary-mark-as-unread 'gnus-summary-tick-article) | |
7868 (defun gnus-summary-tick-article (&optional article clear-mark) | |
7869 "Mark current article as unread. | |
7870 Optional 1st argument ARTICLE specifies article number to be marked as unread. | |
7871 Optional 2nd argument CLEAR-MARK remove any kinds of mark." | |
7872 (interactive) | |
7873 (gnus-summary-mark-article article (if clear-mark gnus-unread-mark | |
7874 gnus-ticked-mark))) | |
7875 | |
7876 (defun gnus-summary-mark-as-read-forward (n) | |
7877 "Mark N articles as read forwards. | |
7878 If N is negative, mark backwards instead. | |
7879 The difference between N and the actual number of articles marked is | |
7880 returned." | |
7881 (interactive "p") | |
7882 (gnus-summary-mark-forward n gnus-del-mark t)) | |
7883 | |
7884 (defun gnus-summary-mark-as-read-backward (n) | |
7885 "Mark the N articles as read backwards. | |
7886 The difference between N and the actual number of articles marked is | |
7887 returned." | |
7888 (interactive "p") | |
7889 (gnus-summary-mark-forward (- n) gnus-del-mark t)) | |
7890 | |
7891 (defun gnus-summary-mark-as-read (&optional article mark) | |
7892 "Mark current article as read. | |
7893 ARTICLE specifies the article to be marked as read. | |
7894 MARK specifies a string to be inserted at the beginning of the line." | |
7895 (gnus-summary-mark-article article mark)) | |
7896 | |
7897 (defun gnus-summary-clear-mark-forward (n) | |
7898 "Clear marks from N articles forward. | |
7899 If N is negative, clear backward instead. | |
7900 The difference between N and the number of marks cleared is returned." | |
7901 (interactive "p") | |
7902 (gnus-summary-mark-forward n gnus-unread-mark)) | |
7903 | |
7904 (defun gnus-summary-clear-mark-backward (n) | |
7905 "Clear marks from N articles backward. | |
7906 The difference between N and the number of marks cleared is returned." | |
7907 (interactive "p") | |
7908 (gnus-summary-mark-forward (- n) gnus-unread-mark)) | |
7909 | |
7910 (defun gnus-summary-mark-unread-as-read () | |
7911 "Intended to be used by `gnus-summary-mark-article-hook'." | |
7912 (when (memq gnus-current-article gnus-newsgroup-unreads) | |
7913 (gnus-summary-mark-article gnus-current-article gnus-read-mark))) | |
7914 | |
7915 (defun gnus-summary-mark-read-and-unread-as-read () | |
7916 "Intended to be used by `gnus-summary-mark-article-hook'." | |
7917 (let ((mark (gnus-summary-article-mark))) | |
7918 (when (or (gnus-unread-mark-p mark) | |
7919 (gnus-read-mark-p mark)) | |
7920 (gnus-summary-mark-article gnus-current-article gnus-read-mark)))) | |
7921 | |
7922 (defun gnus-summary-mark-region-as-read (point mark all) | |
7923 "Mark all unread articles between point and mark as read. | |
7924 If given a prefix, mark all articles between point and mark as read, | |
7925 even ticked and dormant ones." | |
7926 (interactive "r\nP") | |
7927 (save-excursion | |
7928 (let (article) | |
7929 (goto-char point) | |
7930 (beginning-of-line) | |
7931 (while (and | |
7932 (< (point) mark) | |
7933 (progn | |
7934 (when (or all | |
7935 (memq (setq article (gnus-summary-article-number)) | |
7936 gnus-newsgroup-unreads)) | |
7937 (gnus-summary-mark-article article gnus-del-mark)) | |
7938 t) | |
7939 (gnus-summary-find-next)))))) | |
7940 | |
7941 (defun gnus-summary-mark-below (score mark) | |
7942 "Mark articles with score less than SCORE with MARK." | |
7943 (interactive "P\ncMark: ") | |
7944 (setq score (if score | |
7945 (prefix-numeric-value score) | |
7946 (or gnus-summary-default-score 0))) | |
7947 (save-excursion | |
7948 (set-buffer gnus-summary-buffer) | |
7949 (goto-char (point-min)) | |
7950 (while | |
7951 (progn | |
7952 (and (< (gnus-summary-article-score) score) | |
7953 (gnus-summary-mark-article nil mark)) | |
7954 (gnus-summary-find-next))))) | |
7955 | |
7956 (defun gnus-summary-kill-below (&optional score) | |
7957 "Mark articles with score below SCORE as read." | |
7958 (interactive "P") | |
7959 (gnus-summary-mark-below score gnus-killed-mark)) | |
7960 | |
7961 (defun gnus-summary-clear-above (&optional score) | |
7962 "Clear all marks from articles with score above SCORE." | |
7963 (interactive "P") | |
7964 (gnus-summary-mark-above score gnus-unread-mark)) | |
7965 | |
7966 (defun gnus-summary-tick-above (&optional score) | |
7967 "Tick all articles with score above SCORE." | |
7968 (interactive "P") | |
7969 (gnus-summary-mark-above score gnus-ticked-mark)) | |
7970 | |
7971 (defun gnus-summary-mark-above (score mark) | |
7972 "Mark articles with score over SCORE with MARK." | |
7973 (interactive "P\ncMark: ") | |
7974 (setq score (if score | |
7975 (prefix-numeric-value score) | |
7976 (or gnus-summary-default-score 0))) | |
7977 (save-excursion | |
7978 (set-buffer gnus-summary-buffer) | |
7979 (goto-char (point-min)) | |
7980 (while (and (progn | |
7981 (when (> (gnus-summary-article-score) score) | |
7982 (gnus-summary-mark-article nil mark)) | |
7983 t) | |
7984 (gnus-summary-find-next))))) | |
7985 | |
7986 ;; Suggested by Daniel Quinlan <quinlan@best.com>. | |
7987 (defalias 'gnus-summary-show-all-expunged 'gnus-summary-limit-include-expunged) | |
7988 (defun gnus-summary-limit-include-expunged (&optional no-error) | |
7989 "Display all the hidden articles that were expunged for low scores." | |
7990 (interactive) | |
7991 (let ((buffer-read-only nil)) | |
7992 (let ((scored gnus-newsgroup-scored) | |
7993 headers h) | |
7994 (while scored | |
7995 (unless (gnus-summary-goto-subject (caar scored)) | |
7996 (and (setq h (gnus-summary-article-header (caar scored))) | |
7997 (< (cdar scored) gnus-summary-expunge-below) | |
7998 (push h headers))) | |
7999 (setq scored (cdr scored))) | |
8000 (if (not headers) | |
8001 (when (not no-error) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8002 (error "No expunged articles hidden")) |
17493 | 8003 (goto-char (point-min)) |
8004 (gnus-summary-prepare-unthreaded (nreverse headers)) | |
8005 (goto-char (point-min)) | |
8006 (gnus-summary-position-point) | |
8007 t)))) | |
8008 | |
8009 (defun gnus-summary-catchup (&optional all quietly to-here not-mark) | |
8010 "Mark all unread articles in this newsgroup as read. | |
8011 If prefix argument ALL is non-nil, ticked and dormant articles will | |
8012 also be marked as read. | |
8013 If QUIETLY is non-nil, no questions will be asked. | |
8014 If TO-HERE is non-nil, it should be a point in the buffer. All | |
8015 articles before this point will be marked as read. | |
8016 Note that this function will only catch up the unread article | |
8017 in the current summary buffer limitation. | |
8018 The number of articles marked as read is returned." | |
8019 (interactive "P") | |
8020 (prog1 | |
8021 (save-excursion | |
8022 (when (or quietly | |
8023 (not gnus-interactive-catchup) ;Without confirmation? | |
8024 gnus-expert-user | |
8025 (gnus-y-or-n-p | |
8026 (if all | |
8027 "Mark absolutely all articles as read? " | |
8028 "Mark all unread articles as read? "))) | |
8029 (if (and not-mark | |
8030 (not gnus-newsgroup-adaptive) | |
8031 (not gnus-newsgroup-auto-expire) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8032 (not gnus-suppress-duplicates) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8033 (or (not gnus-use-cache) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8034 (eq gnus-use-cache 'passive))) |
17493 | 8035 (progn |
8036 (when all | |
8037 (setq gnus-newsgroup-marked nil | |
8038 gnus-newsgroup-dormant nil)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8039 (setq gnus-newsgroup-unreads gnus-newsgroup-downloadable)) |
17493 | 8040 ;; We actually mark all articles as canceled, which we |
8041 ;; have to do when using auto-expiry or adaptive scoring. | |
8042 (gnus-summary-show-all-threads) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8043 (when (gnus-summary-first-subject (not all) t) |
17493 | 8044 (while (and |
8045 (if to-here (< (point) to-here) t) | |
8046 (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
|
8047 (gnus-summary-find-next (not all) nil nil t)))) |
17493 | 8048 (gnus-set-mode-line 'summary)) |
8049 t)) | |
8050 (gnus-summary-position-point))) | |
8051 | |
8052 (defun gnus-summary-catchup-to-here (&optional all) | |
8053 "Mark all unticked articles before the current one as read. | |
8054 If ALL is non-nil, also mark ticked and dormant articles as read." | |
8055 (interactive "P") | |
8056 (save-excursion | |
8057 (gnus-save-hidden-threads | |
8058 (let ((beg (point))) | |
8059 ;; We check that there are unread articles. | |
8060 (when (or all (gnus-summary-find-prev)) | |
8061 (gnus-summary-catchup all t beg))))) | |
8062 (gnus-summary-position-point)) | |
8063 | |
8064 (defun gnus-summary-catchup-all (&optional quietly) | |
8065 "Mark all articles in this newsgroup as read." | |
8066 (interactive "P") | |
8067 (gnus-summary-catchup t quietly)) | |
8068 | |
8069 (defun gnus-summary-catchup-and-exit (&optional all quietly) | |
8070 "Mark all articles not marked as unread in this newsgroup as read, then exit. | |
8071 If prefix argument ALL is non-nil, all articles are marked as read." | |
8072 (interactive "P") | |
8073 (when (gnus-summary-catchup all quietly nil 'fast) | |
8074 ;; Select next newsgroup or exit. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8075 (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
|
8076 (eq gnus-auto-select-next 'quietly)) |
17493 | 8077 (gnus-summary-next-group nil) |
8078 (gnus-summary-exit)))) | |
8079 | |
8080 (defun gnus-summary-catchup-all-and-exit (&optional quietly) | |
8081 "Mark all articles in this newsgroup as read, and then exit." | |
8082 (interactive "P") | |
8083 (gnus-summary-catchup-and-exit t quietly)) | |
8084 | |
8085 ;; Suggested by "Arne Eofsson" <arne@hodgkin.mbi.ucla.edu>. | |
8086 (defun gnus-summary-catchup-and-goto-next-group (&optional all) | |
8087 "Mark all articles in this group as read and select the next group. | |
8088 If given a prefix, mark all articles, unread as well as ticked, as | |
8089 read." | |
8090 (interactive "P") | |
8091 (save-excursion | |
8092 (gnus-summary-catchup all)) | |
8093 (gnus-summary-next-article t nil nil t)) | |
8094 | |
8095 ;; Thread-based commands. | |
8096 | |
8097 (defun gnus-summary-articles-in-thread (&optional article) | |
8098 "Return a list of all articles in the current thread. | |
8099 If ARTICLE is non-nil, return all articles in the thread that starts | |
8100 with that article." | |
8101 (let* ((article (or article (gnus-summary-article-number))) | |
8102 (data (gnus-data-find-list article)) | |
8103 (top-level (gnus-data-level (car data))) | |
8104 (top-subject | |
8105 (cond ((null gnus-thread-operation-ignore-subject) | |
8106 (gnus-simplify-subject-re | |
8107 (mail-header-subject (gnus-data-header (car data))))) | |
8108 ((eq gnus-thread-operation-ignore-subject 'fuzzy) | |
8109 (gnus-simplify-subject-fuzzy | |
8110 (mail-header-subject (gnus-data-header (car data))))) | |
8111 (t nil))) | |
8112 (end-point (save-excursion | |
8113 (if (gnus-summary-go-to-next-thread) | |
8114 (point) (point-max)))) | |
8115 articles) | |
8116 (while (and data | |
8117 (< (gnus-data-pos (car data)) end-point)) | |
8118 (when (or (not top-subject) | |
8119 (string= top-subject | |
8120 (if (eq gnus-thread-operation-ignore-subject 'fuzzy) | |
8121 (gnus-simplify-subject-fuzzy | |
8122 (mail-header-subject | |
8123 (gnus-data-header (car data)))) | |
8124 (gnus-simplify-subject-re | |
8125 (mail-header-subject | |
8126 (gnus-data-header (car data))))))) | |
8127 (push (gnus-data-number (car data)) articles)) | |
8128 (unless (and (setq data (cdr data)) | |
8129 (> (gnus-data-level (car data)) top-level)) | |
8130 (setq data nil))) | |
8131 ;; Return the list of articles. | |
8132 (nreverse articles))) | |
8133 | |
8134 (defun gnus-summary-rethread-current () | |
8135 "Rethread the thread the current article is part of." | |
8136 (interactive) | |
8137 (let* ((gnus-show-threads t) | |
8138 (article (gnus-summary-article-number)) | |
8139 (id (mail-header-id (gnus-summary-article-header))) | |
8140 (gnus-newsgroup-threads (list (gnus-id-to-thread (gnus-root-id id))))) | |
8141 (unless id | |
8142 (error "No article on the current line")) | |
8143 (gnus-rebuild-thread id) | |
8144 (gnus-summary-goto-subject article))) | |
8145 | |
8146 (defun gnus-summary-reparent-thread () | |
8147 "Make the current article child of the marked (or previous) article. | |
8148 | |
8149 Note that the re-threading will only work if `gnus-thread-ignore-subject' | |
8150 is non-nil or the Subject: of both articles are the same." | |
8151 (interactive) | |
8152 (unless (not (gnus-group-read-only-p)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8153 (error "The current newsgroup does not support article editing")) |
17493 | 8154 (unless (<= (length gnus-newsgroup-processable) 1) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8155 (error "No more than one article may be marked")) |
17493 | 8156 (save-window-excursion |
8157 (let ((gnus-article-buffer " *reparent*") | |
8158 (current-article (gnus-summary-article-number)) | |
8159 ;; First grab the marked article, otherwise one line up. | |
8160 (parent-article (if (not (null gnus-newsgroup-processable)) | |
8161 (car gnus-newsgroup-processable) | |
8162 (save-excursion | |
8163 (if (eq (forward-line -1) 0) | |
8164 (gnus-summary-article-number) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8165 (error "Beginning of summary buffer")))))) |
17493 | 8166 (unless (not (eq current-article parent-article)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8167 (error "An article may not be self-referential")) |
17493 | 8168 (let ((message-id (mail-header-id |
8169 (gnus-summary-article-header parent-article)))) | |
8170 (unless (and message-id (not (equal message-id ""))) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8171 (error "No message-id in desired parent")) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8172 ;; We don't want the article to be marked as read. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8173 (let (gnus-mark-article-hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8174 (gnus-summary-select-article t t nil current-article)) |
17493 | 8175 (set-buffer gnus-original-article-buffer) |
8176 (let ((buf (format "%s" (buffer-string)))) | |
8177 (nnheader-temp-write nil | |
8178 (insert buf) | |
8179 (goto-char (point-min)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8180 (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
|
8181 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8182 (re-search-forward "^[^ \t]" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8183 (forward-line -1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8184 (end-of-line) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8185 (insert " " message-id)) |
17493 | 8186 (insert "References: " message-id "\n")) |
8187 (unless (gnus-request-replace-article | |
8188 current-article (car gnus-article-current) | |
8189 (current-buffer)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8190 (error "Couldn't replace article")))) |
17493 | 8191 (set-buffer gnus-summary-buffer) |
8192 (gnus-summary-unmark-all-processable) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8193 (gnus-summary-update-article current-article) |
17493 | 8194 (gnus-summary-rethread-current) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8195 (gnus-message 3 "Article %d is now the child of article %d" |
17493 | 8196 current-article parent-article))))) |
8197 | |
8198 (defun gnus-summary-toggle-threads (&optional arg) | |
8199 "Toggle showing conversation threads. | |
8200 If ARG is positive number, turn showing conversation threads on." | |
8201 (interactive "P") | |
8202 (let ((current (or (gnus-summary-article-number) gnus-newsgroup-end))) | |
8203 (setq gnus-show-threads | |
8204 (if (null arg) (not gnus-show-threads) | |
8205 (> (prefix-numeric-value arg) 0))) | |
8206 (gnus-summary-prepare) | |
8207 (gnus-summary-goto-subject current) | |
8208 (gnus-message 6 "Threading is now %s" (if gnus-show-threads "on" "off")) | |
8209 (gnus-summary-position-point))) | |
8210 | |
8211 (defun gnus-summary-show-all-threads () | |
8212 "Show all threads." | |
8213 (interactive) | |
8214 (save-excursion | |
8215 (let ((buffer-read-only nil)) | |
8216 (subst-char-in-region (point-min) (point-max) ?\^M ?\n t))) | |
8217 (gnus-summary-position-point)) | |
8218 | |
8219 (defun gnus-summary-show-thread () | |
8220 "Show thread subtrees. | |
8221 Returns nil if no thread was there to be shown." | |
8222 (interactive) | |
8223 (let ((buffer-read-only nil) | |
8224 (orig (point)) | |
8225 ;; first goto end then to beg, to have point at beg after let | |
8226 (end (progn (end-of-line) (point))) | |
8227 (beg (progn (beginning-of-line) (point)))) | |
8228 (prog1 | |
8229 ;; Any hidden lines here? | |
8230 (search-forward "\r" end t) | |
8231 (subst-char-in-region beg end ?\^M ?\n t) | |
8232 (goto-char orig) | |
8233 (gnus-summary-position-point)))) | |
8234 | |
8235 (defun gnus-summary-hide-all-threads () | |
8236 "Hide all thread subtrees." | |
8237 (interactive) | |
8238 (save-excursion | |
8239 (goto-char (point-min)) | |
8240 (gnus-summary-hide-thread) | |
8241 (while (zerop (gnus-summary-next-thread 1 t)) | |
8242 (gnus-summary-hide-thread))) | |
8243 (gnus-summary-position-point)) | |
8244 | |
8245 (defun gnus-summary-hide-thread () | |
8246 "Hide thread subtrees. | |
8247 Returns nil if no threads were there to be hidden." | |
8248 (interactive) | |
8249 (let ((buffer-read-only nil) | |
8250 (start (point)) | |
8251 (article (gnus-summary-article-number))) | |
8252 (goto-char start) | |
8253 ;; Go forward until either the buffer ends or the subthread | |
8254 ;; ends. | |
8255 (when (and (not (eobp)) | |
8256 (or (zerop (gnus-summary-next-thread 1 t)) | |
8257 (goto-char (point-max)))) | |
8258 (prog1 | |
8259 (if (and (> (point) start) | |
8260 (search-backward "\n" start t)) | |
8261 (progn | |
8262 (subst-char-in-region start (point) ?\n ?\^M) | |
8263 (gnus-summary-goto-subject article)) | |
8264 (goto-char start) | |
8265 nil) | |
8266 ;;(gnus-summary-position-point) | |
8267 )))) | |
8268 | |
8269 (defun gnus-summary-go-to-next-thread (&optional previous) | |
8270 "Go to the same level (or less) next thread. | |
8271 If PREVIOUS is non-nil, go to previous thread instead. | |
8272 Return the article number moved to, or nil if moving was impossible." | |
8273 (let ((level (gnus-summary-thread-level)) | |
8274 (way (if previous -1 1)) | |
8275 (beg (point))) | |
8276 (forward-line way) | |
8277 (while (and (not (eobp)) | |
8278 (< level (gnus-summary-thread-level))) | |
8279 (forward-line way)) | |
8280 (if (eobp) | |
8281 (progn | |
8282 (goto-char beg) | |
8283 nil) | |
8284 (setq beg (point)) | |
8285 (prog1 | |
8286 (gnus-summary-article-number) | |
8287 (goto-char beg))))) | |
8288 | |
8289 (defun gnus-summary-next-thread (n &optional silent) | |
8290 "Go to the same level next N'th thread. | |
8291 If N is negative, search backward instead. | |
8292 Returns the difference between N and the number of skips actually | |
8293 done. | |
8294 | |
8295 If SILENT, don't output messages." | |
8296 (interactive "p") | |
8297 (let ((backward (< n 0)) | |
8298 (n (abs n))) | |
8299 (while (and (> n 0) | |
8300 (gnus-summary-go-to-next-thread backward)) | |
8301 (decf n)) | |
8302 (unless silent | |
8303 (gnus-summary-position-point)) | |
8304 (when (and (not silent) (/= 0 n)) | |
8305 (gnus-message 7 "No more threads")) | |
8306 n)) | |
8307 | |
8308 (defun gnus-summary-prev-thread (n) | |
8309 "Go to the same level previous N'th thread. | |
8310 Returns the difference between N and the number of skips actually | |
8311 done." | |
8312 (interactive "p") | |
8313 (gnus-summary-next-thread (- n))) | |
8314 | |
8315 (defun gnus-summary-go-down-thread () | |
8316 "Go down one level in the current thread." | |
8317 (let ((children (gnus-summary-article-children))) | |
8318 (when children | |
8319 (gnus-summary-goto-subject (car children))))) | |
8320 | |
8321 (defun gnus-summary-go-up-thread () | |
8322 "Go up one level in the current thread." | |
8323 (let ((parent (gnus-summary-article-parent))) | |
8324 (when parent | |
8325 (gnus-summary-goto-subject parent)))) | |
8326 | |
8327 (defun gnus-summary-down-thread (n) | |
8328 "Go down thread N steps. | |
8329 If N is negative, go up instead. | |
8330 Returns the difference between N and how many steps down that were | |
8331 taken." | |
8332 (interactive "p") | |
8333 (let ((up (< n 0)) | |
8334 (n (abs n))) | |
8335 (while (and (> n 0) | |
8336 (if up (gnus-summary-go-up-thread) | |
8337 (gnus-summary-go-down-thread))) | |
8338 (setq n (1- n))) | |
8339 (gnus-summary-position-point) | |
8340 (when (/= 0 n) | |
8341 (gnus-message 7 "Can't go further")) | |
8342 n)) | |
8343 | |
8344 (defun gnus-summary-up-thread (n) | |
8345 "Go up thread N steps. | |
8346 If N is negative, go up instead. | |
8347 Returns the difference between N and how many steps down that were | |
8348 taken." | |
8349 (interactive "p") | |
8350 (gnus-summary-down-thread (- n))) | |
8351 | |
8352 (defun gnus-summary-top-thread () | |
8353 "Go to the top of the thread." | |
8354 (interactive) | |
8355 (while (gnus-summary-go-up-thread)) | |
8356 (gnus-summary-article-number)) | |
8357 | |
8358 (defun gnus-summary-kill-thread (&optional unmark) | |
8359 "Mark articles under current thread as read. | |
8360 If the prefix argument is positive, remove any kinds of marks. | |
8361 If the prefix argument is negative, tick articles instead." | |
8362 (interactive "P") | |
8363 (when unmark | |
8364 (setq unmark (prefix-numeric-value unmark))) | |
8365 (let ((articles (gnus-summary-articles-in-thread))) | |
8366 (save-excursion | |
8367 ;; Expand the thread. | |
8368 (gnus-summary-show-thread) | |
8369 ;; Mark all the articles. | |
8370 (while articles | |
8371 (gnus-summary-goto-subject (car articles)) | |
8372 (cond ((null unmark) | |
8373 (gnus-summary-mark-article-as-read gnus-killed-mark)) | |
8374 ((> unmark 0) | |
8375 (gnus-summary-mark-article-as-unread gnus-unread-mark)) | |
8376 (t | |
8377 (gnus-summary-mark-article-as-unread gnus-ticked-mark))) | |
8378 (setq articles (cdr articles)))) | |
8379 ;; Hide killed subtrees. | |
8380 (and (null unmark) | |
8381 gnus-thread-hide-killed | |
8382 (gnus-summary-hide-thread)) | |
8383 ;; If marked as read, go to next unread subject. | |
8384 (when (null unmark) | |
8385 ;; Go to next unread subject. | |
8386 (gnus-summary-next-subject 1 t))) | |
8387 (gnus-set-mode-line 'summary)) | |
8388 | |
8389 ;; Summary sorting commands | |
8390 | |
8391 (defun gnus-summary-sort-by-number (&optional reverse) | |
8392 "Sort the summary buffer by article number. | |
8393 Argument REVERSE means reverse order." | |
8394 (interactive "P") | |
8395 (gnus-summary-sort 'number reverse)) | |
8396 | |
8397 (defun gnus-summary-sort-by-author (&optional reverse) | |
8398 "Sort the summary buffer by author name alphabetically. | |
8399 If case-fold-search is non-nil, case of letters is ignored. | |
8400 Argument REVERSE means reverse order." | |
8401 (interactive "P") | |
8402 (gnus-summary-sort 'author reverse)) | |
8403 | |
8404 (defun gnus-summary-sort-by-subject (&optional reverse) | |
8405 "Sort the summary buffer by subject alphabetically. `Re:'s are ignored. | |
8406 If case-fold-search is non-nil, case of letters is ignored. | |
8407 Argument REVERSE means reverse order." | |
8408 (interactive "P") | |
8409 (gnus-summary-sort 'subject reverse)) | |
8410 | |
8411 (defun gnus-summary-sort-by-date (&optional reverse) | |
8412 "Sort the summary buffer by date. | |
8413 Argument REVERSE means reverse order." | |
8414 (interactive "P") | |
8415 (gnus-summary-sort 'date reverse)) | |
8416 | |
8417 (defun gnus-summary-sort-by-score (&optional reverse) | |
8418 "Sort the summary buffer by score. | |
8419 Argument REVERSE means reverse order." | |
8420 (interactive "P") | |
8421 (gnus-summary-sort 'score reverse)) | |
8422 | |
8423 (defun gnus-summary-sort-by-lines (&optional reverse) | |
8424 "Sort the summary buffer by article length. | |
8425 Argument REVERSE means reverse order." | |
8426 (interactive "P") | |
8427 (gnus-summary-sort 'lines reverse)) | |
8428 | |
8429 (defun gnus-summary-sort (predicate reverse) | |
8430 "Sort summary buffer by PREDICATE. REVERSE means reverse order." | |
8431 (let* ((thread (intern (format "gnus-thread-sort-by-%s" predicate))) | |
8432 (article (intern (format "gnus-article-sort-by-%s" predicate))) | |
8433 (gnus-thread-sort-functions | |
8434 (list | |
8435 (if (not reverse) | |
8436 thread | |
8437 `(lambda (t1 t2) | |
8438 (,thread t2 t1))))) | |
8439 (gnus-article-sort-functions | |
8440 (list | |
8441 (if (not reverse) | |
8442 article | |
8443 `(lambda (t1 t2) | |
8444 (,article t2 t1))))) | |
8445 (buffer-read-only) | |
8446 (gnus-summary-prepare-hook nil)) | |
8447 ;; We do the sorting by regenerating the threads. | |
8448 (gnus-summary-prepare) | |
8449 ;; Hide subthreads if needed. | |
8450 (when (and gnus-show-threads gnus-thread-hide-subtree) | |
8451 (gnus-summary-hide-all-threads)))) | |
8452 | |
8453 ;; Summary saving commands. | |
8454 | |
8455 (defun gnus-summary-save-article (&optional n not-saved) | |
8456 "Save the current article using the default saver function. | |
8457 If N is a positive number, save the N next articles. | |
8458 If N is a negative number, save the N previous articles. | |
8459 If N is nil and any articles have been marked with the process mark, | |
8460 save those articles instead. | |
8461 The variable `gnus-default-article-saver' specifies the saver function." | |
8462 (interactive "P") | |
8463 (let* ((articles (gnus-summary-work-articles n)) | |
8464 (save-buffer (save-excursion | |
8465 (nnheader-set-temp-buffer " *Gnus Save*"))) | |
8466 (num (length articles)) | |
8467 header article file) | |
8468 (while articles | |
8469 (setq header (gnus-summary-article-header | |
8470 (setq article (pop articles)))) | |
8471 (if (not (vectorp header)) | |
8472 ;; This is a pseudo-article. | |
8473 (if (assq 'name header) | |
8474 (gnus-copy-file (cdr (assq 'name header))) | |
8475 (gnus-message 1 "Article %d is unsaveable" article)) | |
8476 ;; This is a real article. | |
8477 (save-window-excursion | |
8478 (gnus-summary-select-article t nil nil article)) | |
8479 (save-excursion | |
8480 (set-buffer save-buffer) | |
8481 (erase-buffer) | |
8482 (insert-buffer-substring gnus-original-article-buffer)) | |
8483 (setq file (gnus-article-save save-buffer file num)) | |
8484 (gnus-summary-remove-process-mark article) | |
8485 (unless not-saved | |
8486 (gnus-summary-set-saved-mark article)))) | |
8487 (gnus-kill-buffer save-buffer) | |
8488 (gnus-summary-position-point) | |
8489 (gnus-set-mode-line 'summary) | |
8490 n)) | |
8491 | |
8492 (defun gnus-summary-pipe-output (&optional arg) | |
8493 "Pipe the current article to a subprocess. | |
8494 If N is a positive number, pipe the N next articles. | |
8495 If N is a negative number, pipe the N previous articles. | |
8496 If N is nil and any articles have been marked with the process mark, | |
8497 pipe those articles instead." | |
8498 (interactive "P") | |
8499 (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe)) | |
8500 (gnus-summary-save-article arg t)) | |
8501 (gnus-configure-windows 'pipe)) | |
8502 | |
8503 (defun gnus-summary-save-article-mail (&optional arg) | |
8504 "Append the current article to an mail file. | |
8505 If N is a positive number, save the N next articles. | |
8506 If N is a negative number, save the N previous articles. | |
8507 If N is nil and any articles have been marked with the process mark, | |
8508 save those articles instead." | |
8509 (interactive "P") | |
8510 (let ((gnus-default-article-saver 'gnus-summary-save-in-mail)) | |
8511 (gnus-summary-save-article arg))) | |
8512 | |
8513 (defun gnus-summary-save-article-rmail (&optional arg) | |
8514 "Append the current article to an rmail file. | |
8515 If N is a positive number, save the N next articles. | |
8516 If N is a negative number, save the N previous articles. | |
8517 If N is nil and any articles have been marked with the process mark, | |
8518 save those articles instead." | |
8519 (interactive "P") | |
8520 (let ((gnus-default-article-saver 'gnus-summary-save-in-rmail)) | |
8521 (gnus-summary-save-article arg))) | |
8522 | |
8523 (defun gnus-summary-save-article-file (&optional arg) | |
8524 "Append the current article to a file. | |
8525 If N is a positive number, save the N next articles. | |
8526 If N is a negative number, save the N previous articles. | |
8527 If N is nil and any articles have been marked with the process mark, | |
8528 save those articles instead." | |
8529 (interactive "P") | |
8530 (let ((gnus-default-article-saver 'gnus-summary-save-in-file)) | |
8531 (gnus-summary-save-article arg))) | |
8532 | |
8533 (defun gnus-summary-write-article-file (&optional arg) | |
8534 "Write the current article to a file, deleting the previous file. | |
8535 If N is a positive number, save the N next articles. | |
8536 If N is a negative number, save the N previous articles. | |
8537 If N is nil and any articles have been marked with the process mark, | |
8538 save those articles instead." | |
8539 (interactive "P") | |
8540 (let ((gnus-default-article-saver 'gnus-summary-write-to-file)) | |
8541 (gnus-summary-save-article arg))) | |
8542 | |
8543 (defun gnus-summary-save-article-body-file (&optional arg) | |
8544 "Append the current article body to a file. | |
8545 If N is a positive number, save the N next articles. | |
8546 If N is a negative number, save the N previous articles. | |
8547 If N is nil and any articles have been marked with the process mark, | |
8548 save those articles instead." | |
8549 (interactive "P") | |
8550 (let ((gnus-default-article-saver 'gnus-summary-save-body-in-file)) | |
8551 (gnus-summary-save-article arg))) | |
8552 | |
8553 (defun gnus-summary-pipe-message (program) | |
8554 "Pipe the current article through PROGRAM." | |
8555 (interactive "sProgram: ") | |
8556 (gnus-summary-select-article) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8557 (let ((mail-header-separator "")) |
17493 | 8558 (gnus-eval-in-buffer-window gnus-article-buffer |
8559 (save-restriction | |
8560 (widen) | |
8561 (let ((start (window-start)) | |
8562 buffer-read-only) | |
8563 (message-pipe-buffer-body program) | |
8564 (set-window-start (get-buffer-window (current-buffer)) start)))))) | |
8565 | |
8566 (defun gnus-get-split-value (methods) | |
8567 "Return a value based on the split METHODS." | |
8568 (let (split-name method result match) | |
8569 (when methods | |
8570 (save-excursion | |
8571 (set-buffer gnus-original-article-buffer) | |
8572 (save-restriction | |
8573 (nnheader-narrow-to-headers) | |
8574 (while methods | |
8575 (goto-char (point-min)) | |
8576 (setq method (pop methods)) | |
8577 (setq match (car method)) | |
8578 (when (cond | |
8579 ((stringp match) | |
8580 ;; Regular expression. | |
8581 (ignore-errors | |
8582 (re-search-forward match nil t))) | |
8583 ((gnus-functionp match) | |
8584 ;; Function. | |
8585 (save-restriction | |
8586 (widen) | |
8587 (setq result (funcall match gnus-newsgroup-name)))) | |
8588 ((consp match) | |
8589 ;; Form. | |
8590 (save-restriction | |
8591 (widen) | |
8592 (setq result (eval match))))) | |
8593 (setq split-name (append (cdr method) split-name)) | |
8594 (cond ((stringp result) | |
8595 (push (expand-file-name | |
8596 result gnus-article-save-directory) | |
8597 split-name)) | |
8598 ((consp result) | |
8599 (setq split-name (append result split-name))))))))) | |
8600 split-name)) | |
8601 | |
8602 (defun gnus-valid-move-group-p (group) | |
8603 (and (boundp group) | |
8604 (symbol-name group) | |
8605 (memq 'respool | |
8606 (assoc (symbol-name | |
8607 (car (gnus-find-method-for-group | |
8608 (symbol-name group)))) | |
8609 gnus-valid-select-methods)))) | |
8610 | |
8611 (defun gnus-read-move-group-name (prompt default articles prefix) | |
8612 "Read a group name." | |
8613 (let* ((split-name (gnus-get-split-value gnus-move-split-methods)) | |
8614 (minibuffer-confirm-incomplete nil) ; XEmacs | |
8615 (prom | |
8616 (format "%s %s to:" | |
8617 prompt | |
8618 (if (> (length articles) 1) | |
8619 (format "these %d articles" (length articles)) | |
8620 "this article"))) | |
8621 (to-newsgroup | |
8622 (cond | |
8623 ((null split-name) | |
8624 (gnus-completing-read default prom | |
8625 gnus-active-hashtb | |
8626 'gnus-valid-move-group-p | |
8627 nil prefix | |
8628 'gnus-group-history)) | |
8629 ((= 1 (length split-name)) | |
8630 (gnus-completing-read (car split-name) prom | |
8631 gnus-active-hashtb | |
8632 'gnus-valid-move-group-p | |
8633 nil nil | |
8634 'gnus-group-history)) | |
8635 (t | |
8636 (gnus-completing-read nil prom | |
8637 (mapcar (lambda (el) (list el)) | |
8638 (nreverse split-name)) | |
8639 nil nil nil | |
8640 'gnus-group-history))))) | |
8641 (when to-newsgroup | |
8642 (if (or (string= to-newsgroup "") | |
8643 (string= to-newsgroup prefix)) | |
8644 (setq to-newsgroup default)) | |
8645 (unless to-newsgroup | |
8646 (error "No group name entered")) | |
8647 (or (gnus-active to-newsgroup) | |
8648 (gnus-activate-group to-newsgroup) | |
8649 (if (gnus-y-or-n-p (format "No such group: %s. Create it? " | |
8650 to-newsgroup)) | |
8651 (or (and (gnus-request-create-group | |
8652 to-newsgroup (gnus-group-name-to-method to-newsgroup)) | |
8653 (gnus-activate-group to-newsgroup nil nil | |
8654 (gnus-group-name-to-method | |
8655 to-newsgroup))) | |
8656 (error "Couldn't create group %s" to-newsgroup))) | |
8657 (error "No such group: %s" to-newsgroup))) | |
8658 to-newsgroup)) | |
8659 | |
8660 ;; Summary extract commands | |
8661 | |
8662 (defun gnus-summary-insert-pseudos (pslist &optional not-view) | |
8663 (let ((buffer-read-only nil) | |
8664 (article (gnus-summary-article-number)) | |
8665 after-article b e) | |
8666 (unless (gnus-summary-goto-subject article) | |
8667 (error "No such article: %d" article)) | |
8668 (gnus-summary-position-point) | |
8669 ;; If all commands are to be bunched up on one line, we collect | |
8670 ;; them here. | |
8671 (unless gnus-view-pseudos-separately | |
8672 (let ((ps (setq pslist (sort pslist 'gnus-pseudos<))) | |
8673 files action) | |
8674 (while ps | |
8675 (setq action (cdr (assq 'action (car ps)))) | |
8676 (setq files (list (cdr (assq 'name (car ps))))) | |
8677 (while (and ps (cdr ps) | |
8678 (string= (or action "1") | |
8679 (or (cdr (assq 'action (cadr ps))) "2"))) | |
8680 (push (cdr (assq 'name (cadr ps))) files) | |
8681 (setcdr ps (cddr ps))) | |
8682 (when files | |
8683 (when (not (string-match "%s" action)) | |
8684 (push " " files)) | |
8685 (push " " files) | |
8686 (when (assq 'execute (car ps)) | |
8687 (setcdr (assq 'execute (car ps)) | |
8688 (funcall (if (string-match "%s" action) | |
8689 'format 'concat) | |
8690 action | |
8691 (mapconcat | |
8692 (lambda (f) | |
8693 (if (equal f " ") | |
8694 f | |
8695 (gnus-quote-arg-for-sh-or-csh f))) | |
8696 files " "))))) | |
8697 (setq ps (cdr ps))))) | |
8698 (if (and gnus-view-pseudos (not not-view)) | |
8699 (while pslist | |
8700 (when (assq 'execute (car pslist)) | |
8701 (gnus-execute-command (cdr (assq 'execute (car pslist))) | |
8702 (eq gnus-view-pseudos 'not-confirm))) | |
8703 (setq pslist (cdr pslist))) | |
8704 (save-excursion | |
8705 (while pslist | |
8706 (setq after-article (or (cdr (assq 'article (car pslist))) | |
8707 (gnus-summary-article-number))) | |
8708 (gnus-summary-goto-subject after-article) | |
8709 (forward-line 1) | |
8710 (setq b (point)) | |
8711 (insert " " (file-name-nondirectory | |
8712 (cdr (assq 'name (car pslist)))) | |
8713 ": " (or (cdr (assq 'execute (car pslist))) "") "\n") | |
8714 (setq e (point)) | |
8715 (forward-line -1) ; back to `b' | |
8716 (gnus-add-text-properties | |
8717 b (1- e) (list 'gnus-number gnus-reffed-article-number | |
8718 gnus-mouse-face-prop gnus-mouse-face)) | |
8719 (gnus-data-enter | |
8720 after-article gnus-reffed-article-number | |
8721 gnus-unread-mark b (car pslist) 0 (- e b)) | |
8722 (push gnus-reffed-article-number gnus-newsgroup-unreads) | |
8723 (setq gnus-reffed-article-number (1- gnus-reffed-article-number)) | |
8724 (setq pslist (cdr pslist))))))) | |
8725 | |
8726 (defun gnus-pseudos< (p1 p2) | |
8727 (let ((c1 (cdr (assq 'action p1))) | |
8728 (c2 (cdr (assq 'action p2)))) | |
8729 (and c1 c2 (string< c1 c2)))) | |
8730 | |
8731 (defun gnus-request-pseudo-article (props) | |
8732 (cond ((assq 'execute props) | |
8733 (gnus-execute-command (cdr (assq 'execute props))))) | |
8734 (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
|
8735 (gnus-run-hooks 'gnus-mark-article-hook))) |
17493 | 8736 |
8737 (defun gnus-execute-command (command &optional automatic) | |
8738 (save-excursion | |
8739 (gnus-article-setup-buffer) | |
8740 (set-buffer gnus-article-buffer) | |
8741 (setq buffer-read-only nil) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8742 (let ((command (if automatic command |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8743 (read-string "Command: " (cons command 0))))) |
17493 | 8744 (erase-buffer) |
8745 (insert "$ " command "\n\n") | |
8746 (if gnus-view-pseudo-asynchronously | |
8747 (start-process "gnus-execute" (current-buffer) shell-file-name | |
8748 shell-command-switch command) | |
8749 (call-process shell-file-name nil t nil | |
8750 shell-command-switch command))))) | |
8751 | |
8752 ;; Summary kill commands. | |
8753 | |
8754 (defun gnus-summary-edit-global-kill (article) | |
8755 "Edit the \"global\" kill file." | |
8756 (interactive (list (gnus-summary-article-number))) | |
8757 (gnus-group-edit-global-kill article)) | |
8758 | |
8759 (defun gnus-summary-edit-local-kill () | |
8760 "Edit a local kill file applied to the current newsgroup." | |
8761 (interactive) | |
8762 (setq gnus-current-headers (gnus-summary-article-header)) | |
8763 (gnus-group-edit-local-kill | |
8764 (gnus-summary-article-number) gnus-newsgroup-name)) | |
8765 | |
8766 ;;; Header reading. | |
8767 | |
8768 (defun gnus-read-header (id &optional header) | |
8769 "Read the headers of article ID and enter them into the Gnus system." | |
8770 (let ((group gnus-newsgroup-name) | |
8771 (gnus-override-method | |
8772 (and (gnus-news-group-p gnus-newsgroup-name) | |
8773 gnus-refer-article-method)) | |
8774 where) | |
8775 ;; First we check to see whether the header in question is already | |
8776 ;; fetched. | |
8777 (if (stringp id) | |
8778 ;; This is a Message-ID. | |
8779 (setq header (or header (gnus-id-to-header id))) | |
8780 ;; This is an article number. | |
8781 (setq header (or header (gnus-summary-article-header id)))) | |
8782 (if (and header | |
8783 (not (gnus-summary-article-sparse-p (mail-header-number header)))) | |
8784 ;; We have found the header. | |
8785 header | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8786 ;; 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
|
8787 ;; previous entry in the thread hashtb. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8788 (when (and header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8789 (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
|
8790 (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
|
8791 (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
|
8792 (when thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8793 (delq (assq header thread) thread)))) |
17493 | 8794 ;; We have to really fetch the header to this article. |
8795 (save-excursion | |
8796 (set-buffer nntp-server-buffer) | |
8797 (when (setq where (gnus-request-head id group)) | |
8798 (nnheader-fold-continuation-lines) | |
8799 (goto-char (point-max)) | |
8800 (insert ".\n") | |
8801 (goto-char (point-min)) | |
8802 (insert "211 ") | |
8803 (princ (cond | |
8804 ((numberp id) id) | |
8805 ((cdr where) (cdr where)) | |
8806 (header (mail-header-number header)) | |
8807 (t gnus-reffed-article-number)) | |
8808 (current-buffer)) | |
8809 (insert " Article retrieved.\n")) | |
8810 (if (or (not where) | |
8811 (not (setq header (car (gnus-get-newsgroup-headers nil t))))) | |
8812 () ; Malformed head. | |
8813 (unless (gnus-summary-article-sparse-p (mail-header-number header)) | |
8814 (when (and (stringp id) | |
8815 (not (string= (gnus-group-real-name group) | |
8816 (car where)))) | |
8817 ;; If we fetched by Message-ID and the article came | |
8818 ;; from a different group, we fudge some bogus article | |
8819 ;; numbers for this article. | |
8820 (mail-header-set-number header gnus-reffed-article-number)) | |
8821 (save-excursion | |
8822 (set-buffer gnus-summary-buffer) | |
8823 (decf gnus-reffed-article-number) | |
8824 (gnus-remove-header (mail-header-number header)) | |
8825 (push header gnus-newsgroup-headers) | |
8826 (setq gnus-current-headers header) | |
8827 (push (mail-header-number header) gnus-newsgroup-limit))) | |
8828 header))))) | |
8829 | |
8830 (defun gnus-remove-header (number) | |
8831 "Remove header NUMBER from `gnus-newsgroup-headers'." | |
8832 (if (and gnus-newsgroup-headers | |
8833 (= number (mail-header-number (car gnus-newsgroup-headers)))) | |
8834 (pop gnus-newsgroup-headers) | |
8835 (let ((headers gnus-newsgroup-headers)) | |
8836 (while (and (cdr headers) | |
8837 (not (= number (mail-header-number (cadr headers))))) | |
8838 (pop headers)) | |
8839 (when (cdr headers) | |
8840 (setcdr headers (cddr headers)))))) | |
8841 | |
8842 ;;; | |
8843 ;;; summary highlights | |
8844 ;;; | |
8845 | |
8846 (defun gnus-highlight-selected-summary () | |
8847 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>. | |
8848 ;; Highlight selected article in summary buffer | |
8849 (when gnus-summary-selected-face | |
8850 (save-excursion | |
8851 (let* ((beg (progn (beginning-of-line) (point))) | |
8852 (end (progn (end-of-line) (point))) | |
8853 ;; Fix by Mike Dugan <dugan@bucrf16.bu.edu>. | |
8854 (from (if (get-text-property beg gnus-mouse-face-prop) | |
8855 beg | |
8856 (or (next-single-property-change | |
8857 beg gnus-mouse-face-prop nil end) | |
8858 beg))) | |
8859 (to | |
8860 (if (= from end) | |
8861 (- from 2) | |
8862 (or (next-single-property-change | |
8863 from gnus-mouse-face-prop nil end) | |
8864 end)))) | |
8865 ;; If no mouse-face prop on line we will have to = from = end, | |
8866 ;; so we highlight the entire line instead. | |
8867 (when (= (+ to 2) from) | |
8868 (setq from beg) | |
8869 (setq to end)) | |
8870 (if gnus-newsgroup-selected-overlay | |
8871 ;; Move old overlay. | |
8872 (gnus-move-overlay | |
8873 gnus-newsgroup-selected-overlay from to (current-buffer)) | |
8874 ;; Create new overlay. | |
8875 (gnus-overlay-put | |
8876 (setq gnus-newsgroup-selected-overlay (gnus-make-overlay from to)) | |
8877 'face gnus-summary-selected-face)))))) | |
8878 | |
8879 ;; New implementation by Christian Limpach <Christian.Limpach@nice.ch>. | |
8880 (defun gnus-summary-highlight-line () | |
8881 "Highlight current line according to `gnus-summary-highlight'." | |
8882 (let* ((list gnus-summary-highlight) | |
8883 (p (point)) | |
8884 (end (progn (end-of-line) (point))) | |
8885 ;; now find out where the line starts and leave point there. | |
8886 (beg (progn (beginning-of-line) (point))) | |
8887 (article (gnus-summary-article-number)) | |
8888 (score (or (cdr (assq (or article gnus-current-article) | |
8889 gnus-newsgroup-scored)) | |
8890 gnus-summary-default-score 0)) | |
8891 (mark (or (gnus-summary-article-mark) gnus-unread-mark)) | |
8892 (inhibit-read-only t)) | |
8893 ;; Eval the cars of the lists until we find a match. | |
8894 (let ((default gnus-summary-default-score)) | |
8895 (while (and list | |
8896 (not (eval (caar list)))) | |
8897 (setq list (cdr list)))) | |
8898 (let ((face (cdar list))) | |
8899 (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
|
8900 (gnus-put-text-property-excluding-characters-with-faces |
17493 | 8901 beg end 'face |
8902 (setq face (if (boundp face) (symbol-value face) face))) | |
8903 (when gnus-summary-highlight-line-function | |
8904 (funcall gnus-summary-highlight-line-function article face)))) | |
8905 (goto-char p))) | |
8906 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8907 (defun gnus-update-read-articles (group unread &optional compute) |
17493 | 8908 "Update the list of read articles in GROUP." |
8909 (let* ((active (or gnus-newsgroup-active (gnus-active group))) | |
8910 (entry (gnus-gethash group gnus-newsrc-hashtb)) | |
8911 (info (nth 2 entry)) | |
8912 (prev 1) | |
8913 (unread (sort (copy-sequence unread) '<)) | |
8914 read) | |
8915 (if (or (not info) (not active)) | |
8916 ;; There is no info on this group if it was, in fact, | |
8917 ;; killed. Gnus stores no information on killed groups, so | |
8918 ;; there's nothing to be done. | |
8919 ;; One could store the information somewhere temporarily, | |
8920 ;; perhaps... Hmmm... | |
8921 () | |
8922 ;; Remove any negative articles numbers. | |
8923 (while (and unread (< (car unread) 0)) | |
8924 (setq unread (cdr unread))) | |
8925 ;; Remove any expired article numbers | |
8926 (while (and unread (< (car unread) (car active))) | |
8927 (setq unread (cdr unread))) | |
8928 ;; Compute the ranges of read articles by looking at the list of | |
8929 ;; unread articles. | |
8930 (while unread | |
8931 (when (/= (car unread) prev) | |
8932 (push (if (= prev (1- (car unread))) prev | |
8933 (cons prev (1- (car unread)))) | |
8934 read)) | |
8935 (setq prev (1+ (car unread))) | |
8936 (setq unread (cdr unread))) | |
8937 (when (<= prev (cdr active)) | |
8938 (push (cons prev (cdr active)) read)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8939 (if compute |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8940 (if (> (length read) 1) (nreverse read) read) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8941 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8942 (set-buffer gnus-group-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8943 (gnus-undo-register |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8944 `(progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8945 (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
|
8946 (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
|
8947 (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
|
8948 (gnus-group-update-group ,group t)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8949 ;; Enter this list into the group info. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8950 (gnus-info-set-read |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8951 info (if (> (length read) 1) (nreverse read) read)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8952 ;; 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
|
8953 (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
|
8954 t)))) |
17493 | 8955 |
8956 (defun gnus-offer-save-summaries () | |
8957 "Offer to save all active summary buffers." | |
8958 (save-excursion | |
8959 (let ((buflist (buffer-list)) | |
8960 buffers bufname) | |
8961 ;; Go through all buffers and find all summaries. | |
8962 (while buflist | |
8963 (and (setq bufname (buffer-name (car buflist))) | |
8964 (string-match "Summary" bufname) | |
8965 (save-excursion | |
8966 (set-buffer bufname) | |
8967 ;; We check that this is, indeed, a summary buffer. | |
8968 (and (eq major-mode 'gnus-summary-mode) | |
8969 ;; Also make sure this isn't bogus. | |
8970 gnus-newsgroup-prepared | |
8971 ;; Also make sure that this isn't a dead summary buffer. | |
8972 (not gnus-dead-summary-mode))) | |
8973 (push bufname buffers)) | |
8974 (setq buflist (cdr buflist))) | |
8975 ;; Go through all these summary buffers and offer to save them. | |
8976 (when buffers | |
8977 (map-y-or-n-p | |
8978 "Update summary buffer %s? " | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8979 (lambda (buf) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8980 (switch-to-buffer buf) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8981 (gnus-summary-exit)) |
17493 | 8982 buffers))))) |
8983 | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8984 (gnus-ems-redefine) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8985 |
17493 | 8986 (provide 'gnus-sum) |
8987 | |
8988 (run-hooks 'gnus-sum-load-hook) | |
8989 | |
8990 ;;; gnus-sum.el ends here |