Mercurial > emacs
annotate lisp/gnus/gnus-sum.el @ 33126:30775a7550ec
(nnoo): Require.
(mm-uu-dissect): Autoload.
author | Dave Love <fx@gnu.org> |
---|---|
date | Wed, 01 Nov 2000 19:02:48 +0000 |
parents | 5155c0078eb9 |
children | 8a606f4c8066 |
rev | line source |
---|---|
17493 | 1 ;;; gnus-sum.el --- summary mode commands for Gnus |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3 ;; Free Software Foundation, Inc. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
32975
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
6 ;; Maintainer: bugs@gnus.org |
17493 | 7 ;; Keywords: news |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
25 | |
26 ;;; Commentary: | |
27 | |
28 ;;; Code: | |
29 | |
19521
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
30 (eval-when-compile (require 'cl)) |
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
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) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
39 (require 'mm-decode) |
33126 | 40 ;; Recursive :-(. |
41 ;; (require 'gnus-art) | |
42 (require 'nnoo) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
43 (autoload 'gnus-summary-limit-include-cached "gnus-cache" nil t) |
32975
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
44 (autoload 'gnus-cache-write-active "gnus-cache") |
33126 | 45 (autoload 'mm-uu-dissect "mm-uu") |
17493 | 46 |
47 (defcustom gnus-kill-summary-on-exit t | |
48 "*If non-nil, kill the summary buffer when you exit from it. | |
49 If nil, the summary will become a \"*Dead Summary*\" buffer, and | |
50 it will be killed sometime later." | |
51 :group 'gnus-summary-exit | |
52 :type 'boolean) | |
53 | |
54 (defcustom gnus-fetch-old-headers nil | |
55 "*Non-nil means that Gnus will try to build threads by grabbing old headers. | |
56 If an unread article in the group refers to an older, already read (or | |
57 just marked as read) article, the old article will not normally be | |
58 displayed in the Summary buffer. If this variable is non-nil, Gnus | |
59 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
|
60 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
|
61 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
|
62 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
|
63 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
|
64 old headers will be fetched, but none will be displayed. |
17493 | 65 |
66 The server has to support NOV for any of this to work." | |
67 :group 'gnus-thread | |
68 :type '(choice (const :tag "off" nil) | |
69 (const some) | |
70 number | |
71 (sexp :menu-tag "other" t))) | |
72 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
73 (defcustom gnus-refer-thread-limit 200 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
74 "*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
|
75 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
|
76 :group 'gnus-thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
77 :type '(choice number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
78 (sexp :menu-tag "other" t))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
79 |
17493 | 80 (defcustom gnus-summary-make-false-root 'adopt |
81 "*nil means that Gnus won't gather loose threads. | |
82 If the root of a thread has expired or been read in a previous | |
83 session, the information necessary to build a complete thread has been | |
84 lost. Instead of having many small sub-threads from this original thread | |
85 scattered all over the summary buffer, Gnus can gather them. | |
86 | |
87 If non-nil, Gnus will try to gather all loose sub-threads from an | |
88 original thread into one large thread. | |
89 | |
90 If this variable is non-nil, it should be one of `none', `adopt', | |
91 `dummy' or `empty'. | |
92 | |
93 If this variable is `none', Gnus will not make a false root, but just | |
94 present the sub-threads after another. | |
95 If this variable is `dummy', Gnus will create a dummy root that will | |
96 have all the sub-threads as children. | |
97 If this variable is `adopt', Gnus will make one of the \"children\" | |
98 the parent and mark all the step-children as such. | |
99 If this variable is `empty', the \"children\" are printed with empty | |
100 subject fields. (Or rather, they will be printed with a string | |
101 given by the `gnus-summary-same-subject' variable.)" | |
102 :group 'gnus-thread | |
103 :type '(choice (const :tag "off" nil) | |
104 (const none) | |
105 (const dummy) | |
106 (const adopt) | |
107 (const empty))) | |
108 | |
109 (defcustom gnus-summary-gather-exclude-subject "^ *$\\|^(none)$" | |
110 "*A regexp to match subjects to be excluded from loose thread gathering. | |
111 As loose thread gathering is done on subjects only, that means that | |
112 there can be many false gatherings performed. By rooting out certain | |
113 common subjects, gathering might become saner." | |
114 :group 'gnus-thread | |
115 :type 'regexp) | |
116 | |
117 (defcustom gnus-summary-gather-subject-limit nil | |
118 "*Maximum length of subject comparisons when gathering loose threads. | |
119 Use nil to compare full subjects. Setting this variable to a low | |
120 number will help gather threads that have been corrupted by | |
121 newsreaders chopping off subject lines, but it might also mean that | |
122 unrelated articles that have subject that happen to begin with the | |
123 same few characters will be incorrectly gathered. | |
124 | |
125 If this variable is `fuzzy', Gnus will use a fuzzy algorithm when | |
126 comparing subjects." | |
127 :group 'gnus-thread | |
128 :type '(choice (const :tag "off" nil) | |
129 (const fuzzy) | |
130 (sexp :menu-tag "on" t))) | |
131 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
132 (defcustom gnus-simplify-subject-functions nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
133 "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
|
134 The functions are applied recursively. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
135 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
136 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
|
137 `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
|
138 :group 'gnus-thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
139 :type '(repeat function)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
140 |
17493 | 141 (defcustom gnus-simplify-ignored-prefixes nil |
142 "*Regexp, matches for which are removed from subject lines when simplifying fuzzily." | |
143 :group 'gnus-thread | |
144 :type '(choice (const :tag "off" nil) | |
145 regexp)) | |
146 | |
147 (defcustom gnus-build-sparse-threads nil | |
148 "*If non-nil, fill in the gaps in threads. | |
149 If `some', only fill in the gaps that are needed to tie loose threads | |
150 together. If `more', fill in all leaf nodes that Gnus can find. If | |
151 non-nil and non-`some', fill in all gaps that Gnus manages to guess." | |
152 :group 'gnus-thread | |
153 :type '(choice (const :tag "off" nil) | |
154 (const some) | |
155 (const more) | |
156 (sexp :menu-tag "all" t))) | |
157 | |
158 (defcustom gnus-summary-thread-gathering-function | |
159 'gnus-gather-threads-by-subject | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
160 "*Function used for gathering loose threads. |
17493 | 161 There are two pre-defined functions: `gnus-gather-threads-by-subject', |
162 which only takes Subjects into consideration; and | |
163 `gnus-gather-threads-by-references', which compared the References | |
164 headers of the articles to find matches." | |
165 :group 'gnus-thread | |
19912
4355457d9749
(gnus-summary-thread-gathering-function): Fix customize type.
Richard M. Stallman <rms@gnu.org>
parents:
19594
diff
changeset
|
166 :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
|
167 (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
|
168 (function :tag "other"))) |
17493 | 169 |
170 (defcustom gnus-summary-same-subject "" | |
171 "*String indicating that the current article has the same subject as the previous. | |
172 This variable will only be used if the value of | |
173 `gnus-summary-make-false-root' is `empty'." | |
174 :group 'gnus-summary-format | |
175 :type 'string) | |
176 | |
177 (defcustom gnus-summary-goto-unread t | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
178 "*If t, many commands will go to the next unread article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
179 This applies to marking commands as well as other commands that |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
180 \"naturally\" select the next article, like, for instance, `SPC' at |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
181 the end of an article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
182 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
183 If nil, the marking commands do NOT go to the next unread article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
184 (they go to the next article instead). If `never', commands that |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
185 usually go to the next unread article, will go to the next article, |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
186 whether it is read or not." |
17493 | 187 :group 'gnus-summary-marks |
188 :link '(custom-manual "(gnus)Setting Marks") | |
189 :type '(choice (const :tag "off" nil) | |
190 (const never) | |
191 (sexp :menu-tag "on" t))) | |
192 | |
193 (defcustom gnus-summary-default-score 0 | |
194 "*Default article score level. | |
195 All scores generated by the score files will be added to this score. | |
196 If this variable is nil, scoring will be disabled." | |
197 :group 'gnus-score-default | |
198 :type '(choice (const :tag "disable") | |
199 integer)) | |
200 | |
201 (defcustom gnus-summary-zcore-fuzz 0 | |
202 "*Fuzziness factor for the zcore in the summary buffer. | |
203 Articles with scores closer than this to `gnus-summary-default-score' | |
204 will not be marked." | |
205 :group 'gnus-summary-format | |
206 :type 'integer) | |
207 | |
208 (defcustom gnus-simplify-subject-fuzzy-regexp nil | |
209 "*Strings to be removed when doing fuzzy matches. | |
210 This can either be a regular expression or list of regular expressions | |
211 that will be removed from subject strings if fuzzy subject | |
212 simplification is selected." | |
213 :group 'gnus-thread | |
214 :type '(repeat regexp)) | |
215 | |
216 (defcustom gnus-show-threads t | |
217 "*If non-nil, display threads in summary mode." | |
218 :group 'gnus-thread | |
219 :type 'boolean) | |
220 | |
221 (defcustom gnus-thread-hide-subtree nil | |
222 "*If non-nil, hide all threads initially. | |
223 If threads are hidden, you have to run the command | |
224 `gnus-summary-show-thread' by hand or use `gnus-select-article-hook' | |
225 to expose hidden threads." | |
226 :group 'gnus-thread | |
227 :type 'boolean) | |
228 | |
229 (defcustom gnus-thread-hide-killed t | |
230 "*If non-nil, hide killed threads automatically." | |
231 :group 'gnus-thread | |
232 :type 'boolean) | |
233 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
234 (defcustom gnus-thread-ignore-subject t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
235 "*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
|
236 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
|
237 start separate threads." |
17493 | 238 :group 'gnus-thread |
239 :type 'boolean) | |
240 | |
241 (defcustom gnus-thread-operation-ignore-subject t | |
242 "*If non-nil, subjects will be ignored when doing thread commands. | |
243 This affects commands like `gnus-summary-kill-thread' and | |
244 `gnus-summary-lower-thread'. | |
245 | |
246 If this variable is nil, articles in the same thread with different | |
247 subjects will not be included in the operation in question. If this | |
248 variable is `fuzzy', only articles that have subjects that are fuzzily | |
249 equal will be included." | |
250 :group 'gnus-thread | |
251 :type '(choice (const :tag "off" nil) | |
252 (const fuzzy) | |
253 (sexp :tag "on" t))) | |
254 | |
255 (defcustom gnus-thread-indent-level 4 | |
256 "*Number that says how much each sub-thread should be indented." | |
257 :group 'gnus-thread | |
258 :type 'integer) | |
259 | |
260 (defcustom gnus-auto-extend-newsgroup t | |
261 "*If non-nil, extend newsgroup forward and backward when requested." | |
262 :group 'gnus-summary-choose | |
263 :type 'boolean) | |
264 | |
265 (defcustom gnus-auto-select-first t | |
266 "*If nil, don't select the first unread article when entering a group. | |
267 If this variable is `best', select the highest-scored unread article | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
268 in the group. If t, select the first unread article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
269 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
270 This variable can also be a function to place point on a likely |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
271 subject line. Useful values include `gnus-summary-first-unread-subject', |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
272 `gnus-summary-first-unread-article' and |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
273 `gnus-summary-best-unread-article'. |
17493 | 274 |
275 If you want to prevent automatic selection of the first unread article | |
276 in some newsgroups, set the variable to nil in | |
277 `gnus-select-group-hook'." | |
278 :group 'gnus-group-select | |
279 :type '(choice (const :tag "none" nil) | |
280 (const best) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
281 (sexp :menu-tag "first" t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
282 (function-item gnus-summary-first-unread-subject) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
283 (function-item gnus-summary-first-unread-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
284 (function-item gnus-summary-best-unread-article))) |
17493 | 285 |
286 (defcustom gnus-auto-select-next t | |
287 "*If non-nil, offer to go to the next group from the end of the previous. | |
288 If the value is t and the next newsgroup is empty, Gnus will exit | |
289 summary mode and go back to group mode. If the value is neither nil | |
290 nor t, Gnus will select the following unread newsgroup. In | |
291 particular, if the value is the symbol `quietly', the next unread | |
292 newsgroup will be selected without any confirmation, and if it is | |
293 `almost-quietly', the next group will be selected without any | |
294 confirmation if you are located on the last article in the group. | |
295 Finally, if this variable is `slightly-quietly', the `Z n' command | |
296 will go to the next group without confirmation." | |
297 :group 'gnus-summary-maneuvering | |
298 :type '(choice (const :tag "off" nil) | |
299 (const quietly) | |
300 (const almost-quietly) | |
301 (const slightly-quietly) | |
302 (sexp :menu-tag "on" t))) | |
303 | |
304 (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
|
305 "*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
|
306 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
|
307 the first unread article." |
17493 | 308 :group 'gnus-summary-maneuvering |
309 :type 'boolean) | |
310 | |
311 (defcustom gnus-summary-check-current nil | |
312 "*If non-nil, consider the current article when moving. | |
313 The \"unread\" movement commands will stay on the same line if the | |
314 current article is unread." | |
315 :group 'gnus-summary-maneuvering | |
316 :type 'boolean) | |
317 | |
318 (defcustom gnus-auto-center-summary t | |
319 "*If non-nil, always center the current summary buffer. | |
320 In particular, if `vertical' do only vertical recentering. If non-nil | |
321 and non-`vertical', do both horizontal and vertical recentering." | |
322 :group 'gnus-summary-maneuvering | |
323 :type '(choice (const :tag "none" nil) | |
324 (const vertical) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
325 (integer :tag "height") |
17493 | 326 (sexp :menu-tag "both" t))) |
327 | |
328 (defcustom gnus-show-all-headers nil | |
329 "*If non-nil, don't hide any headers." | |
330 :group 'gnus-article-hiding | |
331 :group 'gnus-article-headers | |
332 :type 'boolean) | |
333 | |
334 (defcustom gnus-summary-ignore-duplicates nil | |
335 "*If non-nil, ignore articles with identical Message-ID headers." | |
336 :group 'gnus-summary | |
337 :type 'boolean) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
338 |
17493 | 339 (defcustom gnus-single-article-buffer t |
340 "*If non-nil, display all articles in the same buffer. | |
341 If nil, each group will get its own article buffer." | |
342 :group 'gnus-article-various | |
343 :type 'boolean) | |
344 | |
345 (defcustom gnus-break-pages t | |
346 "*If non-nil, do page breaking on articles. | |
347 The page delimiter is specified by the `gnus-page-delimiter' | |
348 variable." | |
349 :group 'gnus-article-various | |
350 :type 'boolean) | |
351 | |
352 (defcustom gnus-move-split-methods nil | |
353 "*Variable used to suggest where articles are to be moved to. | |
354 It uses the same syntax as the `gnus-split-methods' variable." | |
355 :group 'gnus-summary-mail | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
356 :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
|
357 (cons :value ("" "") regexp (repeat string)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
358 (sexp :value nil)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
359 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
360 (defcustom gnus-unread-mark ? ;Whitespace |
17493 | 361 "*Mark used for unread articles." |
362 :group 'gnus-summary-marks | |
363 :type 'character) | |
364 | |
365 (defcustom gnus-ticked-mark ?! | |
366 "*Mark used for ticked articles." | |
367 :group 'gnus-summary-marks | |
368 :type 'character) | |
369 | |
370 (defcustom gnus-dormant-mark ?? | |
371 "*Mark used for dormant articles." | |
372 :group 'gnus-summary-marks | |
373 :type 'character) | |
374 | |
375 (defcustom gnus-del-mark ?r | |
376 "*Mark used for del'd articles." | |
377 :group 'gnus-summary-marks | |
378 :type 'character) | |
379 | |
380 (defcustom gnus-read-mark ?R | |
381 "*Mark used for read articles." | |
382 :group 'gnus-summary-marks | |
383 :type 'character) | |
384 | |
385 (defcustom gnus-expirable-mark ?E | |
386 "*Mark used for expirable articles." | |
387 :group 'gnus-summary-marks | |
388 :type 'character) | |
389 | |
390 (defcustom gnus-killed-mark ?K | |
391 "*Mark used for killed articles." | |
392 :group 'gnus-summary-marks | |
393 :type 'character) | |
394 | |
395 (defcustom gnus-souped-mark ?F | |
396 "*Mark used for killed articles." | |
397 :group 'gnus-summary-marks | |
398 :type 'character) | |
399 | |
400 (defcustom gnus-kill-file-mark ?X | |
401 "*Mark used for articles killed by kill files." | |
402 :group 'gnus-summary-marks | |
403 :type 'character) | |
404 | |
405 (defcustom gnus-low-score-mark ?Y | |
406 "*Mark used for articles with a low score." | |
407 :group 'gnus-summary-marks | |
408 :type 'character) | |
409 | |
410 (defcustom gnus-catchup-mark ?C | |
411 "*Mark used for articles that are caught up." | |
412 :group 'gnus-summary-marks | |
413 :type 'character) | |
414 | |
415 (defcustom gnus-replied-mark ?A | |
416 "*Mark used for articles that have been replied to." | |
417 :group 'gnus-summary-marks | |
418 :type 'character) | |
419 | |
420 (defcustom gnus-cached-mark ?* | |
421 "*Mark used for articles that are in the cache." | |
422 :group 'gnus-summary-marks | |
423 :type 'character) | |
424 | |
425 (defcustom gnus-saved-mark ?S | |
426 "*Mark used for articles that have been saved to." | |
427 :group 'gnus-summary-marks | |
428 :type 'character) | |
429 | |
430 (defcustom gnus-ancient-mark ?O | |
431 "*Mark used for ancient articles." | |
432 :group 'gnus-summary-marks | |
433 :type 'character) | |
434 | |
435 (defcustom gnus-sparse-mark ?Q | |
436 "*Mark used for sparsely reffed articles." | |
437 :group 'gnus-summary-marks | |
438 :type 'character) | |
439 | |
440 (defcustom gnus-canceled-mark ?G | |
441 "*Mark used for canceled articles." | |
442 :group 'gnus-summary-marks | |
443 :type 'character) | |
444 | |
445 (defcustom gnus-duplicate-mark ?M | |
446 "*Mark used for duplicate articles." | |
447 :group 'gnus-summary-marks | |
448 :type 'character) | |
449 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
450 (defcustom gnus-undownloaded-mark ?@ |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
451 "*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
|
452 :group 'gnus-summary-marks |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
453 :type 'character) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
454 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
455 (defcustom gnus-downloadable-mark ?% |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
456 "*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
|
457 :group 'gnus-summary-marks |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
458 :type 'character) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
459 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
460 (defcustom gnus-unsendable-mark ?= |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
461 "*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
|
462 :group 'gnus-summary-marks |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
463 :type 'character) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
464 |
17493 | 465 (defcustom gnus-score-over-mark ?+ |
466 "*Score mark used for articles with high scores." | |
467 :group 'gnus-summary-marks | |
468 :type 'character) | |
469 | |
470 (defcustom gnus-score-below-mark ?- | |
471 "*Score mark used for articles with low scores." | |
472 :group 'gnus-summary-marks | |
473 :type 'character) | |
474 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
475 (defcustom gnus-empty-thread-mark ? ;Whitespace |
17493 | 476 "*There is no thread under the article." |
477 :group 'gnus-summary-marks | |
478 :type 'character) | |
479 | |
480 (defcustom gnus-not-empty-thread-mark ?= | |
481 "*There is a thread under the article." | |
482 :group 'gnus-summary-marks | |
483 :type 'character) | |
484 | |
485 (defcustom gnus-view-pseudo-asynchronously nil | |
486 "*If non-nil, Gnus will view pseudo-articles asynchronously." | |
487 :group 'gnus-extract-view | |
488 :type 'boolean) | |
489 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
490 (defcustom gnus-auto-expirable-marks |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
491 (list gnus-killed-mark gnus-del-mark gnus-catchup-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
492 gnus-low-score-mark gnus-ancient-mark gnus-read-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
493 gnus-souped-mark gnus-duplicate-mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
494 "*The list of marks converted into expiration if a group is auto-expirable." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
495 :group 'gnus-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
496 :type '(repeat character)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
497 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
498 (defcustom gnus-inhibit-user-auto-expire t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
499 "*If non-nil, user marking commands will not mark an article as expirable, even if the group has auto-expire turned on." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
500 :group 'gnus-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
501 :type 'boolean) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
502 |
17493 | 503 (defcustom gnus-view-pseudos nil |
504 "*If `automatic', pseudo-articles will be viewed automatically. | |
505 If `not-confirm', pseudos will be viewed automatically, and the user | |
506 will not be asked to confirm the command." | |
507 :group 'gnus-extract-view | |
508 :type '(choice (const :tag "off" nil) | |
509 (const automatic) | |
510 (const not-confirm))) | |
511 | |
512 (defcustom gnus-view-pseudos-separately t | |
513 "*If non-nil, one pseudo-article will be created for each file to be viewed. | |
514 If nil, all files that use the same viewing command will be given as a | |
515 list of parameters to that command." | |
516 :group 'gnus-extract-view | |
517 :type 'boolean) | |
518 | |
519 (defcustom gnus-insert-pseudo-articles t | |
520 "*If non-nil, insert pseudo-articles when decoding articles." | |
521 :group 'gnus-extract-view | |
522 :type 'boolean) | |
523 | |
524 (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
|
525 " %(: :%) %S\n" |
17493 | 526 "*The format specification for the dummy roots in the summary buffer. |
527 It works along the same lines as a normal formatting string, | |
528 with some simple extensions. | |
529 | |
530 %S The subject" | |
531 :group 'gnus-threading | |
532 :type 'string) | |
533 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
534 (defcustom gnus-summary-mode-line-format "Gnus: %g [%A] %Z" |
17493 | 535 "*The format specification for the summary mode line. |
536 It works along the same lines as a normal formatting string, | |
537 with some simple extensions: | |
538 | |
539 %G Group name | |
540 %p Unprefixed group name | |
541 %A Current article number | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
542 %z Current article score |
17493 | 543 %V Gnus version |
544 %U Number of unread articles in the group | |
545 %e Number of unselected articles in the group | |
546 %Z A string with unread/unselected article counts | |
547 %g Shortish group name | |
548 %S Subject of the current article | |
549 %u User-defined spec | |
550 %s Current score file name | |
551 %d Number of dormant articles | |
552 %r Number of articles that have been marked as read in this session | |
553 %E Number of articles expunged by the score files" | |
554 :group 'gnus-summary-format | |
555 :type 'string) | |
556 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
557 (defcustom gnus-list-identifiers nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
558 "Regexp that matches list identifiers to be removed from subject. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
559 This can also be a list of regexps." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
560 :group 'gnus-summary-format |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
561 :group 'gnus-article-hiding |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
562 :type '(choice (const :tag "none" nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
563 (regexp :value ".*") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
564 (repeat :value (".*") regexp))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
565 |
17493 | 566 (defcustom gnus-summary-mark-below 0 |
567 "*Mark all articles with a score below this variable as read. | |
568 This variable is local to each summary buffer and usually set by the | |
569 score file." | |
570 :group 'gnus-score-default | |
571 :type 'integer) | |
572 | |
573 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number) | |
574 "*List of functions used for sorting articles in the summary buffer. | |
575 This variable is only used when not using a threaded display." | |
576 :group 'gnus-summary-sort | |
577 :type '(repeat (choice (function-item gnus-article-sort-by-number) | |
578 (function-item gnus-article-sort-by-author) | |
579 (function-item gnus-article-sort-by-subject) | |
580 (function-item gnus-article-sort-by-date) | |
581 (function-item gnus-article-sort-by-score) | |
582 (function :tag "other")))) | |
583 | |
584 (defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number) | |
585 "*List of functions used for sorting threads in the summary buffer. | |
586 By default, threads are sorted by article number. | |
587 | |
588 Each function takes two threads and return non-nil if the first thread | |
589 should be sorted before the other. If you use more than one function, | |
590 the primary sort function should be the last. You should probably | |
591 always include `gnus-thread-sort-by-number' in the list of sorting | |
592 functions -- preferably first. | |
593 | |
594 Ready-made functions include `gnus-thread-sort-by-number', | |
595 `gnus-thread-sort-by-author', `gnus-thread-sort-by-subject', | |
596 `gnus-thread-sort-by-date', `gnus-thread-sort-by-score' and | |
597 `gnus-thread-sort-by-total-score' (see `gnus-thread-score-function')." | |
598 :group 'gnus-summary-sort | |
599 :type '(repeat (choice (function-item gnus-thread-sort-by-number) | |
600 (function-item gnus-thread-sort-by-author) | |
601 (function-item gnus-thread-sort-by-subject) | |
602 (function-item gnus-thread-sort-by-date) | |
603 (function-item gnus-thread-sort-by-score) | |
604 (function-item gnus-thread-sort-by-total-score) | |
605 (function :tag "other")))) | |
606 | |
607 (defcustom gnus-thread-score-function '+ | |
608 "*Function used for calculating the total score of a thread. | |
609 | |
610 The function is called with the scores of the article and each | |
611 subthread and should then return the score of the thread. | |
612 | |
613 Some functions you can use are `+', `max', or `min'." | |
614 :group 'gnus-summary-sort | |
615 :type 'function) | |
616 | |
617 (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
|
618 "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
|
619 This variable is local to the summary buffers." |
17493 | 620 :group 'gnus-score-default |
621 :type '(choice (const :tag "off" nil) | |
622 integer)) | |
623 | |
624 (defcustom gnus-thread-expunge-below nil | |
625 "All threads that have a total score less than this variable will be expunged. | |
626 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
|
627 \"thread score\" is. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
628 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
629 This variable is local to the summary buffers." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
630 :group 'gnus-threading |
17493 | 631 :group 'gnus-score-default |
632 :type '(choice (const :tag "off" nil) | |
633 integer)) | |
634 | |
635 (defcustom gnus-summary-mode-hook nil | |
636 "*A hook for Gnus summary mode. | |
637 This hook is run before any variables are set in the summary buffer." | |
638 :group 'gnus-summary-various | |
639 :type 'hook) | |
640 | |
641 (defcustom gnus-summary-menu-hook nil | |
642 "*Hook run after the creation of the summary mode menu." | |
643 :group 'gnus-summary-visual | |
644 :type 'hook) | |
645 | |
646 (defcustom gnus-summary-exit-hook nil | |
647 "*A hook called on exit from the summary buffer. | |
648 It will be called with point in the group buffer." | |
649 :group 'gnus-summary-exit | |
650 :type 'hook) | |
651 | |
652 (defcustom gnus-summary-prepare-hook nil | |
653 "*A hook called after the summary buffer has been generated. | |
654 If you want to modify the summary buffer, you can use this hook." | |
655 :group 'gnus-summary-various | |
656 :type 'hook) | |
657 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
658 (defcustom gnus-summary-prepared-hook nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
659 "*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
|
660 :group 'gnus-summary-various |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
661 :type 'hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
662 |
17493 | 663 (defcustom gnus-summary-generate-hook nil |
664 "*A hook run just before generating the summary buffer. | |
665 This hook is commonly used to customize threading variables and the | |
666 like." | |
667 :group 'gnus-summary-various | |
668 :type 'hook) | |
669 | |
670 (defcustom gnus-select-group-hook nil | |
671 "*A hook called when a newsgroup is selected. | |
672 | |
673 If you'd like to simplify subjects like the | |
674 `gnus-summary-next-same-subject' command does, you can use the | |
675 following hook: | |
676 | |
677 (setq gnus-select-group-hook | |
678 (list | |
679 (lambda () | |
680 (mapcar (lambda (header) | |
681 (mail-header-set-subject | |
682 header | |
683 (gnus-simplify-subject | |
684 (mail-header-subject header) 're-only))) | |
685 gnus-newsgroup-headers))))" | |
686 :group 'gnus-group-select | |
687 :type 'hook) | |
688 | |
689 (defcustom gnus-select-article-hook nil | |
690 "*A hook called when an article is selected." | |
691 :group 'gnus-summary-choose | |
692 :type 'hook) | |
693 | |
694 (defcustom gnus-visual-mark-article-hook | |
695 (list 'gnus-highlight-selected-summary) | |
696 "*Hook run after selecting an article in the summary buffer. | |
697 It is meant to be used for highlighting the article in some way. It | |
698 is not run if `gnus-visual' is nil." | |
699 :group 'gnus-summary-visual | |
700 :type 'hook) | |
701 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
702 (defcustom gnus-parse-headers-hook nil |
17493 | 703 "*A hook called before parsing the headers." |
704 :group 'gnus-various | |
705 :type 'hook) | |
706 | |
707 (defcustom gnus-exit-group-hook nil | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
708 "*A hook called when exiting summary mode. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
709 This hook is not called from the non-updating exit commands like `Q'." |
17493 | 710 :group 'gnus-various |
711 :type 'hook) | |
712 | |
713 (defcustom gnus-summary-update-hook | |
714 (list 'gnus-summary-highlight-line) | |
715 "*A hook called when a summary line is changed. | |
716 The hook will not be called if `gnus-visual' is nil. | |
717 | |
718 The default function `gnus-summary-highlight-line' will | |
719 highlight the line according to the `gnus-summary-highlight' | |
720 variable." | |
721 :group 'gnus-summary-visual | |
722 :type 'hook) | |
723 | |
724 (defcustom gnus-mark-article-hook '(gnus-summary-mark-read-and-unread-as-read) | |
725 "*A hook called when an article is selected for the first time. | |
726 The hook is intended to mark an article as read (or unread) | |
727 automatically when it is selected." | |
728 :group 'gnus-summary-choose | |
729 :type 'hook) | |
730 | |
731 (defcustom gnus-group-no-more-groups-hook nil | |
732 "*A hook run when returning to group mode having no more (unread) groups." | |
733 :group 'gnus-group-select | |
734 :type 'hook) | |
735 | |
736 (defcustom gnus-ps-print-hook nil | |
737 "*A hook run before ps-printing something from Gnus." | |
738 :group 'gnus-summary | |
739 :type 'hook) | |
740 | |
741 (defcustom gnus-summary-selected-face 'gnus-summary-selected-face | |
742 "Face used for highlighting the current article in the summary buffer." | |
743 :group 'gnus-summary-visual | |
744 :type 'face) | |
745 | |
746 (defcustom gnus-summary-highlight | |
747 '(((= mark gnus-canceled-mark) | |
748 . gnus-summary-cancelled-face) | |
749 ((and (> score default) | |
750 (or (= mark gnus-dormant-mark) | |
751 (= mark gnus-ticked-mark))) | |
752 . gnus-summary-high-ticked-face) | |
753 ((and (< score default) | |
754 (or (= mark gnus-dormant-mark) | |
755 (= mark gnus-ticked-mark))) | |
756 . gnus-summary-low-ticked-face) | |
757 ((or (= mark gnus-dormant-mark) | |
758 (= mark gnus-ticked-mark)) | |
759 . gnus-summary-normal-ticked-face) | |
760 ((and (> score default) (= mark gnus-ancient-mark)) | |
761 . gnus-summary-high-ancient-face) | |
762 ((and (< score default) (= mark gnus-ancient-mark)) | |
763 . gnus-summary-low-ancient-face) | |
764 ((= mark gnus-ancient-mark) | |
765 . gnus-summary-normal-ancient-face) | |
766 ((and (> score default) (= mark gnus-unread-mark)) | |
767 . gnus-summary-high-unread-face) | |
768 ((and (< score default) (= mark gnus-unread-mark)) | |
769 . gnus-summary-low-unread-face) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
770 ((= mark gnus-unread-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
771 . gnus-summary-normal-unread-face) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
772 ((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
|
773 gnus-undownloaded-mark))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
774 . gnus-summary-high-unread-face) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
775 ((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
|
776 gnus-undownloaded-mark))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
777 . gnus-summary-low-unread-face) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
778 ((memq mark (list gnus-downloadable-mark gnus-undownloaded-mark)) |
17493 | 779 . gnus-summary-normal-unread-face) |
780 ((> score default) | |
781 . gnus-summary-high-read-face) | |
782 ((< score default) | |
783 . gnus-summary-low-read-face) | |
784 (t | |
785 . gnus-summary-normal-read-face)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
786 "*Controls the highlighting of summary buffer lines. |
17493 | 787 |
788 A list of (FORM . FACE) pairs. When deciding how a a particular | |
789 summary line should be displayed, each form is evaluated. The content | |
790 of the face field after the first true form is used. You can change | |
791 how those summary lines are displayed, by editing the face field. | |
792 | |
793 You can use the following variables in the FORM field. | |
794 | |
795 score: The articles score | |
796 default: The default article score. | |
797 below: The score below which articles are automatically marked as read. | |
798 mark: The articles mark." | |
799 :group 'gnus-summary-visual | |
800 :type '(repeat (cons (sexp :tag "Form" nil) | |
801 face))) | |
802 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
803 (defcustom gnus-alter-header-function nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
804 "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
|
805 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
|
806 which it may alter in any way.") |
17493 | 807 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
808 (defvar gnus-decode-encoded-word-function 'mail-decode-encoded-word-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
809 "Variable that says which function should be used to decode a string with encoded words.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
810 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
811 (defcustom gnus-extra-headers nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
812 "*Extra headers to parse." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
813 :group 'gnus-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
814 :type '(repeat symbol)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
815 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
816 (defcustom gnus-ignored-from-addresses |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
817 (and user-mail-address (regexp-quote user-mail-address)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
818 "*Regexp of From headers that may be suppressed in favor of To headers." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
819 :group 'gnus-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
820 :type 'regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
821 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
822 (defcustom gnus-group-charset-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
823 '(("^hk\\>\\|^tw\\>\\|\\<big5\\>" cn-big5) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
824 ("^cn\\>\\|\\<chinese\\>" cn-gb-2312) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
825 ("^fj\\>\\|^japan\\>" iso-2022-jp-2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
826 ("^tnn\\>\\|^pin\\>\\|^sci.lang.japan" iso-2022-7bit) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
827 ("^relcom\\>" koi8-r) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
828 ("^fido7\\>" koi8-r) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
829 ("^\\(cz\\|hun\\|pl\\|sk\\|hr\\)\\>" iso-8859-2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
830 ("^israel\\>" iso-8859-1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
831 ("^han\\>" euc-kr) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
832 ("^alt.chinese.text.big5\\>" chinese-big5) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
833 ("^soc.culture.vietnamese\\>" vietnamese-viqr) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
834 ("^\\(comp\\|rec\\|alt\\|sci\\|soc\\|news\\|gnu\\|bofh\\)\\>" iso-8859-1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
835 (".*" iso-8859-1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
836 "Alist of regexps (to match group names) and default charsets to be used when reading." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
837 :type '(repeat (list (regexp :tag "Group") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
838 (symbol :tag "Charset"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
839 :group 'gnus-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
840 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
841 (defcustom gnus-newsgroup-ignored-charsets '(unknown-8bit x-unknown) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
842 "List of charsets that should be ignored. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
843 When these charsets are used in the \"charset\" parameter, the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
844 default charset will be used instead." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
845 :type '(repeat symbol) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
846 :group 'gnus-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
847 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
848 (defcustom gnus-group-ignored-charsets-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
849 '(("alt\\.chinese\\.text" iso-8859-1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
850 "Alist of regexps (to match group names) and charsets that should be ignored. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
851 When these charsets are used in the \"charset\" parameter, the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
852 default charset will be used instead." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
853 :type '(repeat (cons (regexp :tag "Group") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
854 (repeat symbol))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
855 :group 'gnus-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
856 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
857 (defcustom gnus-group-highlight-words-alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
858 "Alist of group regexps and highlight regexps. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
859 This variable uses the same syntax as `gnus-emphasis-alist'." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
860 :type '(repeat (cons (regexp :tag "Group") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
861 (repeat (list (regexp :tag "Highlight regexp") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
862 (number :tag "Group for entire word" 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
863 (number :tag "Group for displayed part" 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
864 (symbol :tag "Face" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
865 gnus-emphasis-highlight-words))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
866 :group 'gnus-summary-visual) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
867 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
868 (defcustom gnus-summary-show-article-charset-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
869 nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
870 "Alist of number and charset. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
871 The article will be shown with the charset corresponding to the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
872 numbered argument. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
873 For example: ((1 . cn-gb-2312) (2 . big5))." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
874 :type '(repeat (cons (number :tag "Argument" 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
875 (symbol :tag "Charset"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
876 :group 'gnus-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
877 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
878 (defcustom gnus-preserve-marks t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
879 "Whether marks are preserved when moving, copying and respooling messages." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
880 :type 'boolean |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
881 :group 'gnus-summary-marks) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
882 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
883 (defcustom gnus-alter-articles-to-read-function nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
884 "Function to be called to alter the list of articles to be selected." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
885 :type 'function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
886 :group 'gnus-summary) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
887 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
888 (defcustom gnus-orphan-score nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
889 "*All orphans get this score added. Set in the score file." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
890 :group 'gnus-score-default |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
891 :type '(choice (const nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
892 integer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
893 |
31785 | 894 (defcustom gnus-summary-save-parts-default-mime "image/.*" |
895 "*A regexp to match MIME parts when saving multiple parts of a message | |
896 with gnus-summary-save-parts (X m). This regexp will be used by default | |
897 when prompting the user for which type of files to save." | |
898 :group 'gnus-summary | |
899 :type 'regexp) | |
900 | |
901 | |
17493 | 902 ;;; Internal variables |
903 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
904 (defvar gnus-article-mime-handles nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
905 (defvar gnus-article-decoded-p nil) |
17493 | 906 (defvar gnus-scores-exclude-files nil) |
907 (defvar gnus-page-broken nil) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
908 (defvar gnus-inhibit-mime-unbuttonizing nil) |
17493 | 909 |
910 (defvar gnus-original-article nil) | |
911 (defvar gnus-article-internal-prepare-hook nil) | |
912 (defvar gnus-newsgroup-process-stack nil) | |
913 | |
914 (defvar gnus-thread-indent-array nil) | |
915 (defvar gnus-thread-indent-array-level gnus-thread-indent-level) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
916 (defvar gnus-sort-gathered-threads-function 'gnus-thread-sort-by-number |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
917 "Function called to sort the articles within a thread after it has been gathered together.") |
17493 | 918 |
31785 | 919 (defvar gnus-summary-save-parts-type-history nil) |
920 (defvar gnus-summary-save-parts-last-directory nil) | |
921 | |
17493 | 922 ;; Avoid highlighting in kill files. |
923 (defvar gnus-summary-inhibit-highlight nil) | |
924 (defvar gnus-newsgroup-selected-overlay nil) | |
925 (defvar gnus-inhibit-limiting nil) | |
926 (defvar gnus-newsgroup-adaptive-score-file nil) | |
927 (defvar gnus-current-score-file nil) | |
928 (defvar gnus-current-move-group nil) | |
929 (defvar gnus-current-copy-group nil) | |
930 (defvar gnus-current-crosspost-group nil) | |
931 | |
932 (defvar gnus-newsgroup-dependencies nil) | |
933 (defvar gnus-newsgroup-adaptive nil) | |
934 (defvar gnus-summary-display-article-function nil) | |
935 (defvar gnus-summary-highlight-line-function nil | |
936 "Function called after highlighting a summary line.") | |
937 | |
938 (defvar gnus-summary-line-format-alist | |
939 `((?N ,(macroexpand '(mail-header-number gnus-tmp-header)) ?d) | |
940 (?S ,(macroexpand '(mail-header-subject gnus-tmp-header)) ?s) | |
941 (?s gnus-tmp-subject-or-nil ?s) | |
942 (?n gnus-tmp-name ?s) | |
943 (?A (car (cdr (funcall gnus-extract-address-components gnus-tmp-from))) | |
944 ?s) | |
945 (?a (or (car (funcall gnus-extract-address-components gnus-tmp-from)) | |
946 gnus-tmp-from) ?s) | |
947 (?F gnus-tmp-from ?s) | |
948 (?x ,(macroexpand '(mail-header-xref gnus-tmp-header)) ?s) | |
949 (?D ,(macroexpand '(mail-header-date gnus-tmp-header)) ?s) | |
950 (?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
|
951 (?o (gnus-date-iso8601 (mail-header-date gnus-tmp-header)) ?s) |
17493 | 952 (?M ,(macroexpand '(mail-header-id gnus-tmp-header)) ?s) |
953 (?r ,(macroexpand '(mail-header-references gnus-tmp-header)) ?s) | |
954 (?c (or (mail-header-chars gnus-tmp-header) 0) ?d) | |
955 (?L gnus-tmp-lines ?d) | |
956 (?I gnus-tmp-indentation ?s) | |
957 (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s) | |
958 (?R gnus-tmp-replied ?c) | |
959 (?\[ gnus-tmp-opening-bracket ?c) | |
960 (?\] gnus-tmp-closing-bracket ?c) | |
961 (?\> (make-string gnus-tmp-level ? ) ?s) | |
962 (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s) | |
963 (?i gnus-tmp-score ?d) | |
964 (?z gnus-tmp-score-char ?c) | |
965 (?l (bbb-grouplens-score gnus-tmp-header) ?s) | |
966 (?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d) | |
967 (?U gnus-tmp-unread ?c) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
968 (?f (gnus-summary-from-or-to-or-newsgroups gnus-tmp-header) ?s) |
17493 | 969 (?t (gnus-summary-number-of-articles-in-thread |
970 (and (boundp 'thread) (car thread)) gnus-tmp-level) | |
971 ?d) | |
972 (?e (gnus-summary-number-of-articles-in-thread | |
973 (and (boundp 'thread) (car thread)) gnus-tmp-level t) | |
974 ?c) | |
975 (?u gnus-tmp-user-defined ?s) | |
976 (?P (gnus-pick-line-number) ?d)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
977 "An alist of format specifications that can appear in summary lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
978 These are paired with what variables they correspond with, along with |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
979 the type of the variable (string, integer, character, etc).") |
17493 | 980 |
981 (defvar gnus-summary-dummy-line-format-alist | |
982 `((?S gnus-tmp-subject ?s) | |
983 (?N gnus-tmp-number ?d) | |
984 (?u gnus-tmp-user-defined ?s))) | |
985 | |
986 (defvar gnus-summary-mode-line-format-alist | |
987 `((?G gnus-tmp-group-name ?s) | |
988 (?g (gnus-short-group-name gnus-tmp-group-name) ?s) | |
989 (?p (gnus-group-real-name gnus-tmp-group-name) ?s) | |
990 (?A gnus-tmp-article-number ?d) | |
991 (?Z gnus-tmp-unread-and-unselected ?s) | |
992 (?V gnus-version ?s) | |
993 (?U gnus-tmp-unread-and-unticked ?d) | |
994 (?S gnus-tmp-subject ?s) | |
995 (?e gnus-tmp-unselected ?d) | |
996 (?u gnus-tmp-user-defined ?s) | |
997 (?d (length gnus-newsgroup-dormant) ?d) | |
998 (?t (length gnus-newsgroup-marked) ?d) | |
999 (?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
|
1000 (?z (gnus-summary-article-score gnus-tmp-article-number) ?d) |
17493 | 1001 (?E gnus-newsgroup-expunged-tally ?d) |
1002 (?s (gnus-current-score-file-nondirectory) ?s))) | |
1003 | |
1004 (defvar gnus-last-search-regexp nil | |
1005 "Default regexp for article search command.") | |
1006 | |
1007 (defvar gnus-last-shell-command nil | |
1008 "Default shell command on article.") | |
1009 | |
1010 (defvar gnus-newsgroup-begin nil) | |
1011 (defvar gnus-newsgroup-end nil) | |
1012 (defvar gnus-newsgroup-last-rmail nil) | |
1013 (defvar gnus-newsgroup-last-mail nil) | |
1014 (defvar gnus-newsgroup-last-folder nil) | |
1015 (defvar gnus-newsgroup-last-file nil) | |
1016 (defvar gnus-newsgroup-auto-expire nil) | |
1017 (defvar gnus-newsgroup-active nil) | |
1018 | |
1019 (defvar gnus-newsgroup-data nil) | |
1020 (defvar gnus-newsgroup-data-reverse nil) | |
1021 (defvar gnus-newsgroup-limit nil) | |
1022 (defvar gnus-newsgroup-limits nil) | |
1023 | |
1024 (defvar gnus-newsgroup-unreads nil | |
1025 "List of unread articles in the current newsgroup.") | |
1026 | |
1027 (defvar gnus-newsgroup-unselected nil | |
1028 "List of unselected unread articles in the current newsgroup.") | |
1029 | |
1030 (defvar gnus-newsgroup-reads nil | |
1031 "Alist of read articles and article marks in the current newsgroup.") | |
1032 | |
1033 (defvar gnus-newsgroup-expunged-tally nil) | |
1034 | |
1035 (defvar gnus-newsgroup-marked nil | |
1036 "List of ticked articles in the current newsgroup (a subset of unread art).") | |
1037 | |
1038 (defvar gnus-newsgroup-killed nil | |
1039 "List of ranges of articles that have been through the scoring process.") | |
1040 | |
1041 (defvar gnus-newsgroup-cached nil | |
1042 "List of articles that come from the article cache.") | |
1043 | |
1044 (defvar gnus-newsgroup-saved nil | |
1045 "List of articles that have been saved.") | |
1046 | |
1047 (defvar gnus-newsgroup-kill-headers nil) | |
1048 | |
1049 (defvar gnus-newsgroup-replied nil | |
1050 "List of articles that have been replied to in the current newsgroup.") | |
1051 | |
1052 (defvar gnus-newsgroup-expirable nil | |
1053 "List of articles in the current newsgroup that can be expired.") | |
1054 | |
1055 (defvar gnus-newsgroup-processable nil | |
1056 "List of articles in the current newsgroup that can be processed.") | |
1057 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1058 (defvar gnus-newsgroup-downloadable nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1059 "List of articles in the current newsgroup that can be processed.") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1060 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1061 (defvar gnus-newsgroup-undownloaded nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1062 "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
|
1063 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1064 (defvar gnus-newsgroup-unsendable nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1065 "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
|
1066 |
17493 | 1067 (defvar gnus-newsgroup-bookmarks nil |
1068 "List of articles in the current newsgroup that have bookmarks.") | |
1069 | |
1070 (defvar gnus-newsgroup-dormant nil | |
1071 "List of dormant articles in the current newsgroup.") | |
1072 | |
1073 (defvar gnus-newsgroup-scored nil | |
1074 "List of scored articles in the current newsgroup.") | |
1075 | |
1076 (defvar gnus-newsgroup-headers nil | |
1077 "List of article headers in the current newsgroup.") | |
1078 | |
1079 (defvar gnus-newsgroup-threads nil) | |
1080 | |
1081 (defvar gnus-newsgroup-prepared nil | |
1082 "Whether the current group has been prepared properly.") | |
1083 | |
1084 (defvar gnus-newsgroup-ancient nil | |
1085 "List of `gnus-fetch-old-headers' articles in the current newsgroup.") | |
1086 | |
1087 (defvar gnus-newsgroup-sparse nil) | |
1088 | |
1089 (defvar gnus-current-article nil) | |
1090 (defvar gnus-article-current nil) | |
1091 (defvar gnus-current-headers nil) | |
1092 (defvar gnus-have-all-headers nil) | |
1093 (defvar gnus-last-article nil) | |
1094 (defvar gnus-newsgroup-history nil) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1095 (defvar gnus-newsgroup-charset nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1096 (defvar gnus-newsgroup-ephemeral-charset nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1097 (defvar gnus-newsgroup-ephemeral-ignored-charsets nil) |
17493 | 1098 |
1099 (defconst gnus-summary-local-variables | |
1100 '(gnus-newsgroup-name | |
1101 gnus-newsgroup-begin gnus-newsgroup-end | |
1102 gnus-newsgroup-last-rmail gnus-newsgroup-last-mail | |
1103 gnus-newsgroup-last-folder gnus-newsgroup-last-file | |
1104 gnus-newsgroup-auto-expire gnus-newsgroup-unreads | |
1105 gnus-newsgroup-unselected gnus-newsgroup-marked | |
1106 gnus-newsgroup-reads gnus-newsgroup-saved | |
1107 gnus-newsgroup-replied gnus-newsgroup-expirable | |
1108 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
|
1109 gnus-newsgroup-downloadable gnus-newsgroup-undownloaded |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1110 gnus-newsgroup-unsendable |
17493 | 1111 gnus-newsgroup-bookmarks gnus-newsgroup-dormant |
1112 gnus-newsgroup-headers gnus-newsgroup-threads | |
1113 gnus-newsgroup-prepared gnus-summary-highlight-line-function | |
1114 gnus-current-article gnus-current-headers gnus-have-all-headers | |
1115 gnus-last-article gnus-article-internal-prepare-hook | |
1116 gnus-newsgroup-dependencies gnus-newsgroup-selected-overlay | |
1117 gnus-newsgroup-scored gnus-newsgroup-kill-headers | |
1118 gnus-thread-expunge-below | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1119 gnus-score-alist gnus-current-score-file |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1120 (gnus-summary-expunge-below . global) |
17493 | 1121 (gnus-summary-mark-below . global) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1122 (gnus-orphan-score . global) |
17493 | 1123 gnus-newsgroup-active gnus-scores-exclude-files |
1124 gnus-newsgroup-history gnus-newsgroup-ancient | |
1125 gnus-newsgroup-sparse gnus-newsgroup-process-stack | |
1126 (gnus-newsgroup-adaptive . gnus-use-adaptive-scoring) | |
1127 gnus-newsgroup-adaptive-score-file (gnus-reffed-article-number . -1) | |
1128 (gnus-newsgroup-expunged-tally . 0) | |
1129 gnus-cache-removable-articles gnus-newsgroup-cached | |
1130 gnus-newsgroup-data gnus-newsgroup-data-reverse | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1131 gnus-newsgroup-limit gnus-newsgroup-limits |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1132 gnus-newsgroup-charset) |
17493 | 1133 "Variables that are buffer-local to the summary buffers.") |
1134 | |
1135 ;; Byte-compiler warning. | |
1136 (defvar gnus-article-mode-map) | |
1137 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1138 ;; MIME stuff. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1139 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1140 (defvar gnus-decode-encoded-word-methods |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1141 '(mail-decode-encoded-word-string) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1142 "List of methods used to decode encoded words. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1143 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1144 This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item is |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1145 FUNCTION, FUNCTION will be apply to all newsgroups. If item is a |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1146 (REGEXP . FUNCTION), FUNCTION will be only apply to thes newsgroups |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1147 whose names match REGEXP. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1148 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1149 For example: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1150 ((\"chinese\" . gnus-decode-encoded-word-string-by-guess) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1151 mail-decode-encoded-word-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1152 (\"chinese\" . rfc1843-decode-string))") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1153 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1154 (defvar gnus-decode-encoded-word-methods-cache nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1155 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1156 (defun gnus-multi-decode-encoded-word-string (string) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1157 "Apply the functions from `gnus-encoded-word-methods' that match." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1158 (unless (and gnus-decode-encoded-word-methods-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1159 (eq gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1160 (car gnus-decode-encoded-word-methods-cache))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1161 (setq gnus-decode-encoded-word-methods-cache (list gnus-newsgroup-name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1162 (mapcar (lambda (x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1163 (if (symbolp x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1164 (nconc gnus-decode-encoded-word-methods-cache (list x)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1165 (if (and gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1166 (string-match (car x) gnus-newsgroup-name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1167 (nconc gnus-decode-encoded-word-methods-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1168 (list (cdr x)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1169 gnus-decode-encoded-word-methods)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1170 (let ((xlist gnus-decode-encoded-word-methods-cache)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1171 (pop xlist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1172 (while xlist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1173 (setq string (funcall (pop xlist) string)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1174 string) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1175 |
17493 | 1176 ;; Subject simplification. |
1177 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1178 (defun gnus-simplify-whitespace (str) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1179 "Remove excessive whitespace from STR." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1180 (let ((mystr str)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1181 ;; Multiple spaces. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1182 (while (string-match "[ \t][ \t]+" mystr) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1183 (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
|
1184 " " |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1185 (substring mystr (match-end 0))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1186 ;; Leading spaces. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1187 (when (string-match "^[ \t]+" mystr) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1188 (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
|
1189 ;; Trailing spaces. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1190 (when (string-match "[ \t]+$" mystr) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1191 (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
|
1192 mystr)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1193 |
17493 | 1194 (defsubst gnus-simplify-subject-re (subject) |
1195 "Remove \"Re:\" from subject lines." | |
1196 (if (string-match "^[Rr][Ee]: *" subject) | |
1197 (substring subject (match-end 0)) | |
1198 subject)) | |
1199 | |
1200 (defun gnus-simplify-subject (subject &optional re-only) | |
1201 "Remove `Re:' and words in parentheses. | |
1202 If RE-ONLY is non-nil, strip leading `Re:'s only." | |
1203 (let ((case-fold-search t)) ;Ignore case. | |
1204 ;; Remove `Re:', `Re^N:', `Re(n)', and `Re[n]:'. | |
1205 (when (string-match "\\`\\(re\\([[(^][0-9]+[])]?\\)?:[ \t]*\\)+" subject) | |
1206 (setq subject (substring subject (match-end 0)))) | |
1207 ;; Remove uninteresting prefixes. | |
1208 (when (and (not re-only) | |
1209 gnus-simplify-ignored-prefixes | |
1210 (string-match gnus-simplify-ignored-prefixes subject)) | |
1211 (setq subject (substring subject (match-end 0)))) | |
1212 ;; Remove words in parentheses from end. | |
1213 (unless re-only | |
1214 (while (string-match "[ \t\n]*([^()]*)[ \t\n]*\\'" subject) | |
1215 (setq subject (substring subject 0 (match-beginning 0))))) | |
1216 ;; Return subject string. | |
1217 subject)) | |
1218 | |
1219 ;; Remove any leading "re:"s, any trailing paren phrases, and simplify | |
1220 ;; all whitespace. | |
1221 (defsubst gnus-simplify-buffer-fuzzy-step (regexp &optional newtext) | |
1222 (goto-char (point-min)) | |
1223 (while (re-search-forward regexp nil t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1224 (replace-match (or newtext "")))) |
17493 | 1225 |
1226 (defun gnus-simplify-buffer-fuzzy () | |
1227 "Simplify string in the buffer fuzzily. | |
1228 The string in the accessible portion of the current buffer is simplified. | |
1229 It is assumed to be a single-line subject. | |
1230 Whitespace is generally cleaned up, and miscellaneous leading/trailing | |
1231 matter is removed. Additional things can be deleted by setting | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1232 `gnus-simplify-subject-fuzzy-regexp'." |
17493 | 1233 (let ((case-fold-search t) |
1234 (modified-tick)) | |
1235 (gnus-simplify-buffer-fuzzy-step "\t" " ") | |
1236 | |
1237 (while (not (eq modified-tick (buffer-modified-tick))) | |
1238 (setq modified-tick (buffer-modified-tick)) | |
1239 (cond | |
1240 ((listp gnus-simplify-subject-fuzzy-regexp) | |
1241 (mapcar 'gnus-simplify-buffer-fuzzy-step | |
1242 gnus-simplify-subject-fuzzy-regexp)) | |
1243 (gnus-simplify-subject-fuzzy-regexp | |
1244 (gnus-simplify-buffer-fuzzy-step gnus-simplify-subject-fuzzy-regexp))) | |
1245 (gnus-simplify-buffer-fuzzy-step "^ *\\[[-+?*!][-+?*!]\\] *") | |
1246 (gnus-simplify-buffer-fuzzy-step | |
1247 "^ *\\(re\\|fw\\|fwd\\)[[{(^0-9]*[])}]?[:;] *") | |
1248 (gnus-simplify-buffer-fuzzy-step "^[[].*:\\( .*\\)[]]$" "\\1")) | |
1249 | |
1250 (gnus-simplify-buffer-fuzzy-step " *[[{(][^()\n]*[]})] *$") | |
1251 (gnus-simplify-buffer-fuzzy-step " +" " ") | |
1252 (gnus-simplify-buffer-fuzzy-step " $") | |
1253 (gnus-simplify-buffer-fuzzy-step "^ +"))) | |
1254 | |
1255 (defun gnus-simplify-subject-fuzzy (subject) | |
1256 "Simplify a subject string fuzzily. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1257 See `gnus-simplify-buffer-fuzzy' for details." |
17493 | 1258 (save-excursion |
1259 (gnus-set-work-buffer) | |
1260 (let ((case-fold-search t)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1261 ;; Remove uninteresting prefixes. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1262 (when (and gnus-simplify-ignored-prefixes |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1263 (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
|
1264 (setq subject (substring subject (match-end 0)))) |
17493 | 1265 (insert subject) |
1266 (inline (gnus-simplify-buffer-fuzzy)) | |
1267 (buffer-string)))) | |
1268 | |
1269 (defsubst gnus-simplify-subject-fully (subject) | |
1270 "Simplify a subject string according to gnus-summary-gather-subject-limit." | |
1271 (cond | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1272 (gnus-simplify-subject-functions |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1273 (gnus-map-function gnus-simplify-subject-functions subject)) |
17493 | 1274 ((null gnus-summary-gather-subject-limit) |
1275 (gnus-simplify-subject-re subject)) | |
1276 ((eq gnus-summary-gather-subject-limit 'fuzzy) | |
1277 (gnus-simplify-subject-fuzzy subject)) | |
1278 ((numberp gnus-summary-gather-subject-limit) | |
1279 (gnus-limit-string (gnus-simplify-subject-re subject) | |
1280 gnus-summary-gather-subject-limit)) | |
1281 (t | |
1282 subject))) | |
1283 | |
1284 (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
|
1285 "Check whether two subjects are equal. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1286 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
|
1287 simplified." |
17493 | 1288 (cond |
1289 ((null simple-first) | |
1290 (equal (gnus-simplify-subject-fully s1) | |
1291 (gnus-simplify-subject-fully s2))) | |
1292 (t | |
1293 (equal s1 | |
1294 (gnus-simplify-subject-fully s2))))) | |
1295 | |
1296 (defun gnus-summary-bubble-group () | |
1297 "Increase the score of the current group. | |
1298 This is a handy function to add to `gnus-summary-exit-hook' to | |
1299 increase the score of each group you read." | |
1300 (gnus-group-add-score gnus-newsgroup-name)) | |
1301 | |
1302 | |
1303 ;;; | |
1304 ;;; Gnus summary mode | |
1305 ;;; | |
1306 | |
1307 (put 'gnus-summary-mode 'mode-class 'special) | |
1308 | |
1309 (when t | |
1310 ;; Non-orthogonal keys | |
1311 | |
1312 (gnus-define-keys gnus-summary-mode-map | |
1313 " " gnus-summary-next-page | |
1314 "\177" gnus-summary-prev-page | |
1315 [delete] gnus-summary-prev-page | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1316 [backspace] gnus-summary-prev-page |
17493 | 1317 "\r" gnus-summary-scroll-up |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1318 "\M-\r" gnus-summary-scroll-down |
17493 | 1319 "n" gnus-summary-next-unread-article |
1320 "p" gnus-summary-prev-unread-article | |
1321 "N" gnus-summary-next-article | |
1322 "P" gnus-summary-prev-article | |
1323 "\M-\C-n" gnus-summary-next-same-subject | |
1324 "\M-\C-p" gnus-summary-prev-same-subject | |
1325 "\M-n" gnus-summary-next-unread-subject | |
1326 "\M-p" gnus-summary-prev-unread-subject | |
1327 "." gnus-summary-first-unread-article | |
1328 "," gnus-summary-best-unread-article | |
1329 "\M-s" gnus-summary-search-article-forward | |
1330 "\M-r" gnus-summary-search-article-backward | |
1331 "<" gnus-summary-beginning-of-article | |
1332 ">" gnus-summary-end-of-article | |
1333 "j" gnus-summary-goto-article | |
1334 "^" gnus-summary-refer-parent-article | |
1335 "\M-^" gnus-summary-refer-article | |
1336 "u" gnus-summary-tick-article-forward | |
1337 "!" gnus-summary-tick-article-forward | |
1338 "U" gnus-summary-tick-article-backward | |
1339 "d" gnus-summary-mark-as-read-forward | |
1340 "D" gnus-summary-mark-as-read-backward | |
1341 "E" gnus-summary-mark-as-expirable | |
1342 "\M-u" gnus-summary-clear-mark-forward | |
1343 "\M-U" gnus-summary-clear-mark-backward | |
1344 "k" gnus-summary-kill-same-subject-and-select | |
1345 "\C-k" gnus-summary-kill-same-subject | |
1346 "\M-\C-k" gnus-summary-kill-thread | |
1347 "\M-\C-l" gnus-summary-lower-thread | |
1348 "e" gnus-summary-edit-article | |
1349 "#" gnus-summary-mark-as-processable | |
1350 "\M-#" gnus-summary-unmark-as-processable | |
1351 "\M-\C-t" gnus-summary-toggle-threads | |
1352 "\M-\C-s" gnus-summary-show-thread | |
1353 "\M-\C-h" gnus-summary-hide-thread | |
1354 "\M-\C-f" gnus-summary-next-thread | |
1355 "\M-\C-b" gnus-summary-prev-thread | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1356 [(meta down)] gnus-summary-next-thread |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1357 [(meta up)] gnus-summary-prev-thread |
17493 | 1358 "\M-\C-u" gnus-summary-up-thread |
1359 "\M-\C-d" gnus-summary-down-thread | |
1360 "&" gnus-summary-execute-command | |
1361 "c" gnus-summary-catchup-and-exit | |
1362 "\C-w" gnus-summary-mark-region-as-read | |
1363 "\C-t" gnus-summary-toggle-truncation | |
1364 "?" gnus-summary-mark-as-dormant | |
1365 "\C-c\M-\C-s" gnus-summary-limit-include-expunged | |
1366 "\C-c\C-s\C-n" gnus-summary-sort-by-number | |
1367 "\C-c\C-s\C-l" gnus-summary-sort-by-lines | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1368 "\C-c\C-s\C-c" gnus-summary-sort-by-chars |
17493 | 1369 "\C-c\C-s\C-a" gnus-summary-sort-by-author |
1370 "\C-c\C-s\C-s" gnus-summary-sort-by-subject | |
1371 "\C-c\C-s\C-d" gnus-summary-sort-by-date | |
1372 "\C-c\C-s\C-i" gnus-summary-sort-by-score | |
1373 "=" gnus-summary-expand-window | |
1374 "\C-x\C-s" gnus-summary-reselect-current-group | |
1375 "\M-g" gnus-summary-rescan-group | |
1376 "w" gnus-summary-stop-page-breaking | |
1377 "\C-c\C-r" gnus-summary-caesar-message | |
1378 "f" gnus-summary-followup | |
1379 "F" gnus-summary-followup-with-original | |
1380 "C" gnus-summary-cancel-article | |
1381 "r" gnus-summary-reply | |
1382 "R" gnus-summary-reply-with-original | |
1383 "\C-c\C-f" gnus-summary-mail-forward | |
1384 "o" gnus-summary-save-article | |
1385 "\C-o" gnus-summary-save-article-mail | |
1386 "|" gnus-summary-pipe-output | |
1387 "\M-k" gnus-summary-edit-local-kill | |
1388 "\M-K" gnus-summary-edit-global-kill | |
1389 ;; "V" gnus-version | |
1390 "\C-c\C-d" gnus-summary-describe-group | |
1391 "q" gnus-summary-exit | |
1392 "Q" gnus-summary-exit-no-update | |
1393 "\C-c\C-i" gnus-info-find-node | |
1394 gnus-mouse-2 gnus-mouse-pick-article | |
1395 "m" gnus-summary-mail-other-window | |
1396 "a" gnus-summary-post-news | |
1397 "x" gnus-summary-limit-to-unread | |
1398 "s" gnus-summary-isearch-article | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1399 "t" gnus-summary-toggle-header |
17493 | 1400 "g" gnus-summary-show-article |
1401 "l" gnus-summary-goto-last-article | |
1402 "\C-c\C-v\C-v" gnus-uu-decode-uu-view | |
1403 "\C-d" gnus-summary-enter-digest-group | |
1404 "\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
|
1405 "\M-\C-e" gnus-summary-edit-parameters |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1406 "\M-\C-a" gnus-summary-customize-parameters |
17493 | 1407 "\C-c\C-b" gnus-bug |
1408 "*" gnus-cache-enter-article | |
1409 "\M-*" gnus-cache-remove-article | |
1410 "\M-&" gnus-summary-universal-argument | |
1411 "\C-l" gnus-recenter | |
1412 "I" gnus-summary-increase-score | |
1413 "L" gnus-summary-lower-score | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1414 "\M-i" gnus-symbolic-argument |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1415 "h" gnus-summary-select-article-buffer |
17493 | 1416 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1417 "b" gnus-article-view-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1418 "\M-t" gnus-summary-toggle-display-buttonized |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1419 |
17493 | 1420 "V" gnus-summary-score-map |
1421 "X" gnus-uu-extract-map | |
1422 "S" gnus-summary-send-map) | |
1423 | |
1424 ;; Sort of orthogonal keymap | |
1425 (gnus-define-keys (gnus-summary-mark-map "M" gnus-summary-mode-map) | |
1426 "t" gnus-summary-tick-article-forward | |
1427 "!" gnus-summary-tick-article-forward | |
1428 "d" gnus-summary-mark-as-read-forward | |
1429 "r" gnus-summary-mark-as-read-forward | |
1430 "c" gnus-summary-clear-mark-forward | |
1431 " " gnus-summary-clear-mark-forward | |
1432 "e" gnus-summary-mark-as-expirable | |
1433 "x" gnus-summary-mark-as-expirable | |
1434 "?" gnus-summary-mark-as-dormant | |
1435 "b" gnus-summary-set-bookmark | |
1436 "B" gnus-summary-remove-bookmark | |
1437 "#" gnus-summary-mark-as-processable | |
1438 "\M-#" gnus-summary-unmark-as-processable | |
1439 "S" gnus-summary-limit-include-expunged | |
1440 "C" gnus-summary-catchup | |
1441 "H" gnus-summary-catchup-to-here | |
1442 "\C-c" gnus-summary-catchup-all | |
1443 "k" gnus-summary-kill-same-subject-and-select | |
1444 "K" gnus-summary-kill-same-subject | |
1445 "P" gnus-uu-mark-map) | |
1446 | |
1447 (gnus-define-keys (gnus-summary-mscore-map "V" gnus-summary-mark-map) | |
1448 "c" gnus-summary-clear-above | |
1449 "u" gnus-summary-tick-above | |
1450 "m" gnus-summary-mark-above | |
1451 "k" gnus-summary-kill-below) | |
1452 | |
1453 (gnus-define-keys (gnus-summary-limit-map "/" gnus-summary-mode-map) | |
1454 "/" gnus-summary-limit-to-subject | |
1455 "n" gnus-summary-limit-to-articles | |
1456 "w" gnus-summary-pop-limit | |
1457 "s" gnus-summary-limit-to-subject | |
1458 "a" gnus-summary-limit-to-author | |
1459 "u" gnus-summary-limit-to-unread | |
1460 "m" gnus-summary-limit-to-marks | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1461 "M" gnus-summary-limit-exclude-marks |
17493 | 1462 "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
|
1463 "*" gnus-summary-limit-include-cached |
17493 | 1464 "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
|
1465 "T" gnus-summary-limit-include-thread |
17493 | 1466 "d" gnus-summary-limit-exclude-dormant |
1467 "t" gnus-summary-limit-to-age | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1468 "x" gnus-summary-limit-to-extra |
17493 | 1469 "E" gnus-summary-limit-include-expunged |
1470 "c" gnus-summary-limit-exclude-childless-dormant | |
1471 "C" gnus-summary-limit-mark-excluded-as-read) | |
1472 | |
1473 (gnus-define-keys (gnus-summary-goto-map "G" gnus-summary-mode-map) | |
1474 "n" gnus-summary-next-unread-article | |
1475 "p" gnus-summary-prev-unread-article | |
1476 "N" gnus-summary-next-article | |
1477 "P" gnus-summary-prev-article | |
1478 "\C-n" gnus-summary-next-same-subject | |
1479 "\C-p" gnus-summary-prev-same-subject | |
1480 "\M-n" gnus-summary-next-unread-subject | |
1481 "\M-p" gnus-summary-prev-unread-subject | |
1482 "f" gnus-summary-first-unread-article | |
1483 "b" gnus-summary-best-unread-article | |
1484 "j" gnus-summary-goto-article | |
1485 "g" gnus-summary-goto-subject | |
1486 "l" gnus-summary-goto-last-article | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
1487 "o" gnus-summary-pop-article) |
17493 | 1488 |
1489 (gnus-define-keys (gnus-summary-thread-map "T" gnus-summary-mode-map) | |
1490 "k" gnus-summary-kill-thread | |
1491 "l" gnus-summary-lower-thread | |
1492 "i" gnus-summary-raise-thread | |
1493 "T" gnus-summary-toggle-threads | |
1494 "t" gnus-summary-rethread-current | |
1495 "^" gnus-summary-reparent-thread | |
1496 "s" gnus-summary-show-thread | |
1497 "S" gnus-summary-show-all-threads | |
1498 "h" gnus-summary-hide-thread | |
1499 "H" gnus-summary-hide-all-threads | |
1500 "n" gnus-summary-next-thread | |
1501 "p" gnus-summary-prev-thread | |
1502 "u" gnus-summary-up-thread | |
1503 "o" gnus-summary-top-thread | |
1504 "d" gnus-summary-down-thread | |
1505 "#" gnus-uu-mark-thread | |
1506 "\M-#" gnus-uu-unmark-thread) | |
1507 | |
1508 (gnus-define-keys (gnus-summary-buffer-map "Y" gnus-summary-mode-map) | |
1509 "g" gnus-summary-prepare | |
1510 "c" gnus-summary-insert-cached-articles) | |
1511 | |
1512 (gnus-define-keys (gnus-summary-exit-map "Z" gnus-summary-mode-map) | |
1513 "c" gnus-summary-catchup-and-exit | |
1514 "C" gnus-summary-catchup-all-and-exit | |
1515 "E" gnus-summary-exit-no-update | |
1516 "Q" gnus-summary-exit | |
1517 "Z" gnus-summary-exit | |
1518 "n" gnus-summary-catchup-and-goto-next-group | |
1519 "R" gnus-summary-reselect-current-group | |
1520 "G" gnus-summary-rescan-group | |
1521 "N" gnus-summary-next-group | |
1522 "s" gnus-summary-save-newsrc | |
1523 "P" gnus-summary-prev-group) | |
1524 | |
1525 (gnus-define-keys (gnus-summary-article-map "A" gnus-summary-mode-map) | |
1526 " " gnus-summary-next-page | |
1527 "n" gnus-summary-next-page | |
1528 "\177" gnus-summary-prev-page | |
1529 [delete] gnus-summary-prev-page | |
1530 "p" gnus-summary-prev-page | |
1531 "\r" gnus-summary-scroll-up | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1532 "\M-\r" gnus-summary-scroll-down |
17493 | 1533 "<" gnus-summary-beginning-of-article |
1534 ">" gnus-summary-end-of-article | |
1535 "b" gnus-summary-beginning-of-article | |
1536 "e" gnus-summary-end-of-article | |
1537 "^" gnus-summary-refer-parent-article | |
1538 "r" gnus-summary-refer-parent-article | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1539 "D" gnus-summary-enter-digest-group |
17493 | 1540 "R" gnus-summary-refer-references |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1541 "T" gnus-summary-refer-thread |
17493 | 1542 "g" gnus-summary-show-article |
1543 "s" gnus-summary-isearch-article | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1544 "P" gnus-summary-print-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1545 "t" gnus-article-babel) |
17493 | 1546 |
1547 (gnus-define-keys (gnus-summary-wash-map "W" gnus-summary-mode-map) | |
1548 "b" gnus-article-add-buttons | |
1549 "B" gnus-article-add-buttons-to-head | |
1550 "o" gnus-article-treat-overstrike | |
1551 "e" gnus-article-emphasize | |
1552 "w" gnus-article-fill-cited-article | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1553 "Q" gnus-article-fill-long-lines |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1554 "C" gnus-article-capitalize-sentences |
17493 | 1555 "c" gnus-article-remove-cr |
1556 "q" gnus-article-de-quoted-unreadable | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1557 "6" gnus-article-de-base64-unreadable |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1558 "Z" gnus-article-decode-HZ |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1559 "h" gnus-article-wash-html |
17493 | 1560 "f" gnus-article-display-x-face |
1561 "l" gnus-summary-stop-page-breaking | |
1562 "r" gnus-summary-caesar-message | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1563 "t" gnus-summary-toggle-header |
17493 | 1564 "v" gnus-summary-verbose-headers |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1565 "H" gnus-article-strip-headers-in-body |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1566 "d" gnus-article-treat-dumbquotes) |
17493 | 1567 |
1568 (gnus-define-keys (gnus-summary-wash-hide-map "W" gnus-summary-wash-map) | |
1569 "a" gnus-article-hide | |
1570 "h" gnus-article-hide-headers | |
1571 "b" gnus-article-hide-boring-headers | |
1572 "s" gnus-article-hide-signature | |
1573 "c" gnus-article-hide-citation | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1574 "C" gnus-article-hide-citation-in-followups |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1575 "l" gnus-article-hide-list-identifiers |
17493 | 1576 "p" gnus-article-hide-pgp |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1577 "B" gnus-article-strip-banner |
17493 | 1578 "P" gnus-article-hide-pem |
1579 "\C-c" gnus-article-hide-citation-maybe) | |
1580 | |
1581 (gnus-define-keys (gnus-summary-wash-highlight-map "H" gnus-summary-wash-map) | |
1582 "a" gnus-article-highlight | |
1583 "h" gnus-article-highlight-headers | |
1584 "c" gnus-article-highlight-citation | |
1585 "s" gnus-article-highlight-signature) | |
1586 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1587 (gnus-define-keys (gnus-summary-wash-mime-map "M" gnus-summary-wash-map) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1588 "w" gnus-article-decode-mime-words |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1589 "c" gnus-article-decode-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1590 "v" gnus-mime-view-all-parts |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1591 "b" gnus-article-view-part) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1592 |
17493 | 1593 (gnus-define-keys (gnus-summary-wash-time-map "T" gnus-summary-wash-map) |
1594 "z" gnus-article-date-ut | |
1595 "u" gnus-article-date-ut | |
1596 "l" gnus-article-date-local | |
1597 "e" gnus-article-date-lapsed | |
1598 "o" gnus-article-date-original | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1599 "i" gnus-article-date-iso8601 |
17493 | 1600 "s" gnus-article-date-user) |
1601 | |
1602 (gnus-define-keys (gnus-summary-wash-empty-map "E" gnus-summary-wash-map) | |
1603 "t" gnus-article-remove-trailing-blank-lines | |
1604 "l" gnus-article-strip-leading-blank-lines | |
1605 "m" gnus-article-strip-multiple-blank-lines | |
1606 "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
|
1607 "A" gnus-article-strip-all-blank-lines |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1608 "s" gnus-article-strip-leading-space |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1609 "e" gnus-article-strip-trailing-space) |
17493 | 1610 |
1611 (gnus-define-keys (gnus-summary-help-map "H" gnus-summary-mode-map) | |
1612 "v" gnus-version | |
1613 "f" gnus-summary-fetch-faq | |
1614 "d" gnus-summary-describe-group | |
1615 "h" gnus-summary-describe-briefly | |
1616 "i" gnus-info-find-node) | |
1617 | |
1618 (gnus-define-keys (gnus-summary-backend-map "B" gnus-summary-mode-map) | |
1619 "e" gnus-summary-expire-articles | |
1620 "\M-\C-e" gnus-summary-expire-articles-now | |
1621 "\177" gnus-summary-delete-article | |
1622 [delete] gnus-summary-delete-article | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1623 [backspace] gnus-summary-delete-article |
17493 | 1624 "m" gnus-summary-move-article |
1625 "r" gnus-summary-respool-article | |
1626 "w" gnus-summary-edit-article | |
1627 "c" gnus-summary-copy-article | |
1628 "B" gnus-summary-crosspost-article | |
1629 "q" gnus-summary-respool-query | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1630 "t" gnus-summary-respool-trace |
17493 | 1631 "i" gnus-summary-import-article |
1632 "p" gnus-summary-article-posted-p) | |
1633 | |
1634 (gnus-define-keys (gnus-summary-save-map "O" gnus-summary-mode-map) | |
1635 "o" gnus-summary-save-article | |
1636 "m" gnus-summary-save-article-mail | |
1637 "F" gnus-summary-write-article-file | |
1638 "r" gnus-summary-save-article-rmail | |
1639 "f" gnus-summary-save-article-file | |
1640 "b" gnus-summary-save-article-body-file | |
1641 "h" gnus-summary-save-article-folder | |
1642 "v" gnus-summary-save-article-vm | |
1643 "p" gnus-summary-pipe-output | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1644 "s" gnus-soup-add-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1645 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1646 (gnus-define-keys (gnus-summary-mime-map "K" gnus-summary-mode-map) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1647 "b" gnus-summary-display-buttonized |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1648 "m" gnus-summary-repair-multipart |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1649 "v" gnus-article-view-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1650 "o" gnus-article-save-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1651 "c" gnus-article-copy-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1652 "e" gnus-article-externalize-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1653 "i" gnus-article-inline-part |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1654 "|" gnus-article-pipe-part)) |
17493 | 1655 |
1656 (defun gnus-summary-make-menu-bar () | |
1657 (gnus-turn-off-edit-menu 'summary) | |
1658 | |
1659 (unless (boundp 'gnus-summary-misc-menu) | |
1660 | |
1661 (easy-menu-define | |
1662 gnus-summary-kill-menu gnus-summary-mode-map "" | |
1663 (cons | |
1664 "Score" | |
1665 (nconc | |
1666 (list | |
1667 ["Enter score..." gnus-summary-score-entry t] | |
1668 ["Customize" gnus-score-customize t]) | |
1669 (gnus-make-score-map 'increase) | |
1670 (gnus-make-score-map 'lower) | |
1671 '(("Mark" | |
1672 ["Kill below" gnus-summary-kill-below t] | |
1673 ["Mark above" gnus-summary-mark-above t] | |
1674 ["Tick above" gnus-summary-tick-above t] | |
1675 ["Clear above" gnus-summary-clear-above t]) | |
1676 ["Current score" gnus-summary-current-score t] | |
1677 ["Set score" gnus-summary-set-score t] | |
1678 ["Switch current score file..." gnus-score-change-score-file t] | |
1679 ["Set mark below..." gnus-score-set-mark-below t] | |
1680 ["Set expunge below..." gnus-score-set-expunge-below t] | |
1681 ["Edit current score file" gnus-score-edit-current-scores t] | |
1682 ["Edit score file" gnus-score-edit-file t] | |
1683 ["Trace score" gnus-score-find-trace t] | |
1684 ["Find words" gnus-score-find-favourite-words t] | |
1685 ["Rescore buffer" gnus-summary-rescore t] | |
1686 ["Increase score..." gnus-summary-increase-score t] | |
1687 ["Lower score..." gnus-summary-lower-score t])))) | |
1688 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1689 ;; 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
|
1690 ;; 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
|
1691 (let ((innards |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1692 '(("Hide" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1693 ["All" gnus-article-hide t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1694 ["Headers" gnus-article-hide-headers t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1695 ["Signature" gnus-article-hide-signature t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1696 ["Citation" gnus-article-hide-citation t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1697 ["List identifiers" gnus-article-hide-list-identifiers t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1698 ["PGP" gnus-article-hide-pgp t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1699 ["Banner" gnus-article-strip-banner t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1700 ["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
|
1701 ("Highlight" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1702 ["All" gnus-article-highlight t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1703 ["Headers" gnus-article-highlight-headers t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1704 ["Signature" gnus-article-highlight-signature t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1705 ["Citation" gnus-article-highlight-citation t]) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1706 ("MIME" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1707 ["Words" gnus-article-decode-mime-words t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1708 ["Charset" gnus-article-decode-charset t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1709 ["QP" gnus-article-de-quoted-unreadable t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1710 ["Base64" gnus-article-de-base64-unreadable t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1711 ["View all" gnus-mime-view-all-parts t]) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1712 ("Date" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1713 ["Local" gnus-article-date-local t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1714 ["ISO8601" gnus-article-date-iso8601 t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1715 ["UT" gnus-article-date-ut t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1716 ["Original" gnus-article-date-original t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1717 ["Lapsed" gnus-article-date-lapsed t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1718 ["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
|
1719 ("Washing" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1720 ("Remove Blanks" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1721 ["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
|
1722 ["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
|
1723 ["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
|
1724 ["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
|
1725 ["All" gnus-article-strip-all-blank-lines t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1726 ["Leading space" gnus-article-strip-leading-space t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1727 ["Trailing space" gnus-article-strip-trailing-space t]) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1728 ["Overstrike" gnus-article-treat-overstrike t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1729 ["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
|
1730 ["Emphasis" gnus-article-emphasize t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1731 ["Word wrap" gnus-article-fill-cited-article t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1732 ["Fill long lines" gnus-article-fill-long-lines t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1733 ["Capitalize sentences" gnus-article-capitalize-sentences t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1734 ["CR" gnus-article-remove-cr t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1735 ["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
|
1736 ["Quoted-Printable" gnus-article-de-quoted-unreadable t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1737 ["Base64" gnus-article-de-base64-unreadable t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1738 ["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
|
1739 ["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
|
1740 ["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
|
1741 ["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
|
1742 ["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
|
1743 ["Verbose header" gnus-summary-verbose-headers t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1744 ["Toggle header" gnus-summary-toggle-header t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1745 ["Html" gnus-article-wash-html t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1746 ["HZ" gnus-article-decode-HZ t]) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1747 ("Output" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1748 ["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
|
1749 ["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
|
1750 ["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
|
1751 ["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
|
1752 ["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
|
1753 ["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
|
1754 ["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
|
1755 ["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
|
1756 ["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
|
1757 ["Print" gnus-summary-print-article t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1758 ("Backend" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1759 ["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
|
1760 ["Move article..." gnus-summary-move-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1761 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1762 'request-move-article gnus-newsgroup-name)] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1763 ["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
|
1764 ["Crosspost article..." gnus-summary-crosspost-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1765 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1766 'request-replace-article gnus-newsgroup-name)] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1767 ["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
|
1768 ["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
|
1769 ["Edit article" gnus-summary-edit-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1770 (not (gnus-group-read-only-p))] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1771 ["Delete article" gnus-summary-delete-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1772 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1773 'request-expire-articles gnus-newsgroup-name)] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1774 ["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
|
1775 ["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
|
1776 ["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
|
1777 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1778 'request-expire-articles gnus-newsgroup-name)]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1779 ("Extract" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1780 ["Uudecode" gnus-uu-decode-uu t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1781 ["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
|
1782 ["Unshar" gnus-uu-decode-unshar t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1783 ["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
|
1784 ["Save" gnus-uu-decode-save t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1785 ["Binhex" gnus-uu-decode-binhex t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1786 ["Postscript" gnus-uu-decode-postscript t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1787 ("Cache" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1788 ["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
|
1789 ["Remove article" gnus-cache-remove-article t]) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1790 ["Translate" gnus-article-babel t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1791 ["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
|
1792 ["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
|
1793 ["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
|
1794 ["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
|
1795 ["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
|
1796 ["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
|
1797 ["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
|
1798 ["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
|
1799 ["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
|
1800 ["Redisplay" gnus-summary-show-article t]))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1801 (easy-menu-define |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1802 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
|
1803 (cons "Article" innards)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1804 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1805 (easy-menu-define |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1806 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
|
1807 (cons "Commands" innards))) |
17493 | 1808 |
1809 (easy-menu-define | |
1810 gnus-summary-thread-menu gnus-summary-mode-map "" | |
1811 '("Threads" | |
1812 ["Toggle threading" gnus-summary-toggle-threads t] | |
1813 ["Hide threads" gnus-summary-hide-all-threads t] | |
1814 ["Show threads" gnus-summary-show-all-threads t] | |
1815 ["Hide thread" gnus-summary-hide-thread t] | |
1816 ["Show thread" gnus-summary-show-thread t] | |
1817 ["Go to next thread" gnus-summary-next-thread t] | |
1818 ["Go to previous thread" gnus-summary-prev-thread t] | |
1819 ["Go down thread" gnus-summary-down-thread t] | |
1820 ["Go up thread" gnus-summary-up-thread t] | |
1821 ["Top of thread" gnus-summary-top-thread t] | |
1822 ["Mark thread as read" gnus-summary-kill-thread t] | |
1823 ["Lower thread score" gnus-summary-lower-thread t] | |
1824 ["Raise thread score" gnus-summary-raise-thread t] | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1825 ["Rethread current" gnus-summary-rethread-current t])) |
17493 | 1826 |
1827 (easy-menu-define | |
1828 gnus-summary-post-menu gnus-summary-mode-map "" | |
1829 '("Post" | |
1830 ["Post an article" gnus-summary-post-news t] | |
1831 ["Followup" gnus-summary-followup t] | |
1832 ["Followup and yank" gnus-summary-followup-with-original t] | |
1833 ["Supersede article" gnus-summary-supersede-article t] | |
1834 ["Cancel article" gnus-summary-cancel-article t] | |
1835 ["Reply" gnus-summary-reply t] | |
1836 ["Reply and yank" gnus-summary-reply-with-original t] | |
1837 ["Wide reply" gnus-summary-wide-reply t] | |
1838 ["Wide reply and yank" gnus-summary-wide-reply-with-original t] | |
1839 ["Mail forward" gnus-summary-mail-forward t] | |
1840 ["Post forward" gnus-summary-post-forward t] | |
1841 ["Digest and mail" gnus-uu-digest-mail-forward t] | |
1842 ["Digest and post" gnus-uu-digest-post-forward t] | |
1843 ["Resend message" gnus-summary-resend-message t] | |
1844 ["Send bounced mail" gnus-summary-resend-bounced-mail t] | |
1845 ["Send a mail" gnus-summary-mail-other-window t] | |
1846 ["Uuencode and post" gnus-uu-post-news t] | |
1847 ["Followup via news" gnus-summary-followup-to-mail t] | |
1848 ["Followup via news and yank" | |
1849 gnus-summary-followup-to-mail-with-original t] | |
1850 ;;("Draft" | |
1851 ;;["Send" gnus-summary-send-draft t] | |
1852 ;;["Send bounced" gnus-resend-bounced-mail t]) | |
1853 )) | |
1854 | |
1855 (easy-menu-define | |
1856 gnus-summary-misc-menu gnus-summary-mode-map "" | |
1857 '("Misc" | |
1858 ("Mark Read" | |
1859 ["Mark as read" gnus-summary-mark-as-read-forward t] | |
1860 ["Mark same subject and select" | |
1861 gnus-summary-kill-same-subject-and-select t] | |
1862 ["Mark same subject" gnus-summary-kill-same-subject t] | |
1863 ["Catchup" gnus-summary-catchup t] | |
1864 ["Catchup all" gnus-summary-catchup-all t] | |
1865 ["Catchup to here" gnus-summary-catchup-to-here t] | |
1866 ["Catchup region" gnus-summary-mark-region-as-read t] | |
1867 ["Mark excluded" gnus-summary-limit-mark-excluded-as-read t]) | |
1868 ("Mark Various" | |
1869 ["Tick" gnus-summary-tick-article-forward t] | |
1870 ["Mark as dormant" gnus-summary-mark-as-dormant t] | |
1871 ["Remove marks" gnus-summary-clear-mark-forward t] | |
1872 ["Set expirable mark" gnus-summary-mark-as-expirable t] | |
1873 ["Set bookmark" gnus-summary-set-bookmark t] | |
1874 ["Remove bookmark" gnus-summary-remove-bookmark t]) | |
1875 ("Mark Limit" | |
1876 ["Marks..." gnus-summary-limit-to-marks t] | |
1877 ["Subject..." gnus-summary-limit-to-subject t] | |
1878 ["Author..." gnus-summary-limit-to-author t] | |
1879 ["Age..." gnus-summary-limit-to-age t] | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1880 ["Extra..." gnus-summary-limit-to-extra t] |
17493 | 1881 ["Score" gnus-summary-limit-to-score t] |
1882 ["Unread" gnus-summary-limit-to-unread t] | |
1883 ["Non-dormant" gnus-summary-limit-exclude-dormant t] | |
1884 ["Articles" gnus-summary-limit-to-articles t] | |
1885 ["Pop limit" gnus-summary-pop-limit t] | |
1886 ["Show dormant" gnus-summary-limit-include-dormant t] | |
1887 ["Hide childless dormant" | |
1888 gnus-summary-limit-exclude-childless-dormant t] | |
1889 ;;["Hide thread" gnus-summary-limit-exclude-thread t] | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1890 ["Hide marked" gnus-summary-limit-exclude-marks t] |
17493 | 1891 ["Show expunged" gnus-summary-show-all-expunged t]) |
1892 ("Process Mark" | |
1893 ["Set mark" gnus-summary-mark-as-processable t] | |
1894 ["Remove mark" gnus-summary-unmark-as-processable t] | |
1895 ["Remove all marks" gnus-summary-unmark-all-processable t] | |
1896 ["Mark above" gnus-uu-mark-over t] | |
1897 ["Mark series" gnus-uu-mark-series t] | |
1898 ["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
|
1899 ["Unmark region" gnus-uu-unmark-region t] |
17493 | 1900 ["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
|
1901 ["Unmark by regexp..." gnus-uu-unmark-by-regexp t] |
17493 | 1902 ["Mark all" gnus-uu-mark-all t] |
1903 ["Mark buffer" gnus-uu-mark-buffer t] | |
1904 ["Mark sparse" gnus-uu-mark-sparse t] | |
1905 ["Mark thread" gnus-uu-mark-thread t] | |
1906 ["Unmark thread" gnus-uu-unmark-thread t] | |
1907 ("Process Mark Sets" | |
1908 ["Kill" gnus-summary-kill-process-mark t] | |
1909 ["Yank" gnus-summary-yank-process-mark | |
1910 gnus-newsgroup-process-stack] | |
1911 ["Save" gnus-summary-save-process-mark t])) | |
1912 ("Scroll article" | |
1913 ["Page forward" gnus-summary-next-page t] | |
1914 ["Page backward" gnus-summary-prev-page t] | |
1915 ["Line forward" gnus-summary-scroll-up t]) | |
1916 ("Move" | |
1917 ["Next unread article" gnus-summary-next-unread-article t] | |
1918 ["Previous unread article" gnus-summary-prev-unread-article t] | |
1919 ["Next article" gnus-summary-next-article t] | |
1920 ["Previous article" gnus-summary-prev-article t] | |
1921 ["Next unread subject" gnus-summary-next-unread-subject t] | |
1922 ["Previous unread subject" gnus-summary-prev-unread-subject t] | |
1923 ["Next article same subject" gnus-summary-next-same-subject t] | |
1924 ["Previous article same subject" gnus-summary-prev-same-subject t] | |
1925 ["First unread article" gnus-summary-first-unread-article t] | |
1926 ["Best unread article" gnus-summary-best-unread-article t] | |
1927 ["Go to subject number..." gnus-summary-goto-subject t] | |
1928 ["Go to article number..." gnus-summary-goto-article t] | |
1929 ["Go to the last article" gnus-summary-goto-last-article t] | |
1930 ["Pop article off history" gnus-summary-pop-article t]) | |
1931 ("Sort" | |
1932 ["Sort by number" gnus-summary-sort-by-number t] | |
1933 ["Sort by author" gnus-summary-sort-by-author t] | |
1934 ["Sort by subject" gnus-summary-sort-by-subject t] | |
1935 ["Sort by date" gnus-summary-sort-by-date t] | |
1936 ["Sort by score" gnus-summary-sort-by-score t] | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1937 ["Sort by lines" gnus-summary-sort-by-lines t] |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1938 ["Sort by characters" gnus-summary-sort-by-chars t]) |
17493 | 1939 ("Help" |
1940 ["Fetch group FAQ" gnus-summary-fetch-faq t] | |
1941 ["Describe group" gnus-summary-describe-group t] | |
1942 ["Read manual" gnus-info-find-node t]) | |
1943 ("Modes" | |
1944 ["Pick and read" gnus-pick-mode t] | |
1945 ["Binary" gnus-binary-mode t]) | |
1946 ("Regeneration" | |
1947 ["Regenerate" gnus-summary-prepare t] | |
1948 ["Insert cached articles" gnus-summary-insert-cached-articles t] | |
1949 ["Toggle threading" gnus-summary-toggle-threads t]) | |
1950 ["Filter articles..." gnus-summary-execute-command t] | |
1951 ["Run command on subjects..." gnus-summary-universal-argument t] | |
1952 ["Search articles forward..." gnus-summary-search-article-forward t] | |
1953 ["Search articles backward..." gnus-summary-search-article-backward t] | |
1954 ["Toggle line truncation" gnus-summary-toggle-truncation t] | |
1955 ["Expand window" gnus-summary-expand-window t] | |
1956 ["Expire expirable articles" gnus-summary-expire-articles | |
1957 (gnus-check-backend-function | |
1958 'request-expire-articles gnus-newsgroup-name)] | |
1959 ["Edit local kill file" gnus-summary-edit-local-kill t] | |
1960 ["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
|
1961 ["Edit group parameters" gnus-summary-edit-parameters t] |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1962 ["Customize group parameters" gnus-summary-customize-parameters t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1963 ["Send a bug report" gnus-bug t] |
17493 | 1964 ("Exit" |
1965 ["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
|
1966 ["Catchup all and exit" gnus-summary-catchup-all-and-exit t] |
17493 | 1967 ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t] |
1968 ["Exit group" gnus-summary-exit t] | |
1969 ["Exit group without updating" gnus-summary-exit-no-update t] | |
1970 ["Exit and goto next group" gnus-summary-next-group t] | |
1971 ["Exit and goto prev group" gnus-summary-prev-group t] | |
1972 ["Reselect group" gnus-summary-reselect-current-group t] | |
1973 ["Rescan group" gnus-summary-rescan-group t] | |
1974 ["Update dribble" gnus-summary-save-newsrc t]))) | |
1975 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1976 (gnus-run-hooks 'gnus-summary-menu-hook))) |
17493 | 1977 |
1978 (defun gnus-score-set-default (var value) | |
1979 "A version of set that updates the GNU Emacs menu-bar." | |
1980 (set var value) | |
1981 ;; It is the message that forces the active status to be updated. | |
1982 (message "")) | |
1983 | |
1984 (defun gnus-make-score-map (type) | |
1985 "Make a summary score map of type TYPE." | |
1986 (if t | |
1987 nil | |
1988 (let ((headers '(("author" "from" string) | |
1989 ("subject" "subject" string) | |
1990 ("article body" "body" string) | |
1991 ("article head" "head" string) | |
1992 ("xref" "xref" string) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1993 ("extra header" "extra" string) |
17493 | 1994 ("lines" "lines" number) |
1995 ("followups to author" "followup" string))) | |
1996 (types '((number ("less than" <) | |
1997 ("greater than" >) | |
1998 ("equal" =)) | |
1999 (string ("substring" s) | |
2000 ("exact string" e) | |
2001 ("fuzzy string" f) | |
2002 ("regexp" r)))) | |
2003 (perms '(("temporary" (current-time-string)) | |
2004 ("permanent" nil) | |
2005 ("immediate" now))) | |
2006 header) | |
2007 (list | |
2008 (apply | |
2009 'nconc | |
2010 (list | |
2011 (if (eq type 'lower) | |
2012 "Lower score" | |
2013 "Increase score")) | |
2014 (let (outh) | |
2015 (while headers | |
2016 (setq header (car headers)) | |
2017 (setq outh | |
2018 (cons | |
2019 (apply | |
2020 'nconc | |
2021 (list (car header)) | |
2022 (let ((ts (cdr (assoc (nth 2 header) types))) | |
2023 outt) | |
2024 (while ts | |
2025 (setq outt | |
2026 (cons | |
2027 (apply | |
2028 'nconc | |
2029 (list (caar ts)) | |
2030 (let ((ps perms) | |
2031 outp) | |
2032 (while ps | |
2033 (setq outp | |
2034 (cons | |
2035 (vector | |
2036 (caar ps) | |
2037 (list | |
2038 'gnus-summary-score-entry | |
2039 (nth 1 header) | |
2040 (if (or (string= (nth 1 header) | |
2041 "head") | |
2042 (string= (nth 1 header) | |
2043 "body")) | |
2044 "" | |
2045 (list 'gnus-summary-header | |
2046 (nth 1 header))) | |
2047 (list 'quote (nth 1 (car ts))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2048 (list 'gnus-score-delta-default |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2049 nil) |
17493 | 2050 (nth 1 (car ps)) |
2051 t) | |
2052 t) | |
2053 outp)) | |
2054 (setq ps (cdr ps))) | |
2055 (list (nreverse outp)))) | |
2056 outt)) | |
2057 (setq ts (cdr ts))) | |
2058 (list (nreverse outt)))) | |
2059 outh)) | |
2060 (setq headers (cdr headers))) | |
2061 (list (nreverse outh)))))))) | |
2062 | |
2063 | |
2064 | |
2065 (defun gnus-summary-mode (&optional group) | |
2066 "Major mode for reading articles. | |
2067 | |
2068 All normal editing commands are switched off. | |
2069 \\<gnus-summary-mode-map> | |
2070 Each line in this buffer represents one article. To read an | |
2071 article, you can, for instance, type `\\[gnus-summary-next-page]'. To move forwards | |
2072 and backwards while displaying articles, type `\\[gnus-summary-next-unread-article]' and `\\[gnus-summary-prev-unread-article]', | |
2073 respectively. | |
2074 | |
2075 You can also post articles and send mail from this buffer. To | |
2076 follow up an article, type `\\[gnus-summary-followup]'. To mail a reply to the author | |
2077 of an article, type `\\[gnus-summary-reply]'. | |
2078 | |
2079 There are approx. one gazillion commands you can execute in this | |
2080 buffer; read the info pages for more information (`\\[gnus-info-find-node]'). | |
2081 | |
2082 The following commands are available: | |
2083 | |
2084 \\{gnus-summary-mode-map}" | |
2085 (interactive) | |
2086 (when (gnus-visual-p 'summary-menu 'menu) | |
2087 (gnus-summary-make-menu-bar)) | |
2088 (kill-all-local-variables) | |
2089 (gnus-summary-make-local-variables) | |
2090 (gnus-make-thread-indent-array) | |
2091 (gnus-simplify-mode-line) | |
2092 (setq major-mode 'gnus-summary-mode) | |
2093 (setq mode-name "Summary") | |
2094 (make-local-variable 'minor-mode-alist) | |
2095 (use-local-map gnus-summary-mode-map) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2096 (buffer-disable-undo) |
17493 | 2097 (setq buffer-read-only t) ;Disable modification |
2098 (setq truncate-lines t) | |
2099 (setq selective-display t) | |
2100 (setq selective-display-ellipses t) ;Display `...' | |
2101 (gnus-summary-set-display-table) | |
2102 (gnus-set-default-directory) | |
2103 (setq gnus-newsgroup-name group) | |
2104 (make-local-variable 'gnus-summary-line-format) | |
2105 (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
|
2106 (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
|
2107 (make-local-variable 'gnus-summary-dummy-line-format-spec) |
17493 | 2108 (make-local-variable 'gnus-summary-mark-positions) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2109 (make-local-hook 'pre-command-hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2110 (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
|
2111 (gnus-run-hooks 'gnus-summary-mode-hook) |
32975
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
2112 (mm-enable-multibyte-mule4) |
17493 | 2113 (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy) |
2114 (gnus-update-summary-mark-positions)) | |
2115 | |
2116 (defun gnus-summary-make-local-variables () | |
2117 "Make all the local summary buffer variables." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2118 (let (global) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2119 (dolist (local gnus-summary-local-variables) |
17493 | 2120 (if (consp local) |
2121 (progn | |
2122 (if (eq (cdr local) 'global) | |
2123 ;; Copy the global value of the variable. | |
2124 (setq global (symbol-value (car local))) | |
2125 ;; Use the value from the list. | |
2126 (setq global (eval (cdr local)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2127 (set (make-local-variable (car local)) global)) |
17493 | 2128 ;; Simple nil-valued local variable. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2129 (set (make-local-variable local) nil))))) |
17493 | 2130 |
2131 (defun gnus-summary-clear-local-variables () | |
2132 (let ((locals gnus-summary-local-variables)) | |
2133 (while locals | |
2134 (if (consp (car locals)) | |
2135 (and (vectorp (caar locals)) | |
2136 (set (caar locals) nil)) | |
2137 (and (vectorp (car locals)) | |
2138 (set (car locals) nil))) | |
2139 (setq locals (cdr locals))))) | |
2140 | |
2141 ;; Summary data functions. | |
2142 | |
2143 (defmacro gnus-data-number (data) | |
2144 `(car ,data)) | |
2145 | |
2146 (defmacro gnus-data-set-number (data number) | |
2147 `(setcar ,data ,number)) | |
2148 | |
2149 (defmacro gnus-data-mark (data) | |
2150 `(nth 1 ,data)) | |
2151 | |
2152 (defmacro gnus-data-set-mark (data mark) | |
2153 `(setcar (nthcdr 1 ,data) ,mark)) | |
2154 | |
2155 (defmacro gnus-data-pos (data) | |
2156 `(nth 2 ,data)) | |
2157 | |
2158 (defmacro gnus-data-set-pos (data pos) | |
2159 `(setcar (nthcdr 2 ,data) ,pos)) | |
2160 | |
2161 (defmacro gnus-data-header (data) | |
2162 `(nth 3 ,data)) | |
2163 | |
2164 (defmacro gnus-data-set-header (data header) | |
2165 `(setf (nth 3 ,data) ,header)) | |
2166 | |
2167 (defmacro gnus-data-level (data) | |
2168 `(nth 4 ,data)) | |
2169 | |
2170 (defmacro gnus-data-unread-p (data) | |
2171 `(= (nth 1 ,data) gnus-unread-mark)) | |
2172 | |
2173 (defmacro gnus-data-read-p (data) | |
2174 `(/= (nth 1 ,data) gnus-unread-mark)) | |
2175 | |
2176 (defmacro gnus-data-pseudo-p (data) | |
2177 `(consp (nth 3 ,data))) | |
2178 | |
2179 (defmacro gnus-data-find (number) | |
2180 `(assq ,number gnus-newsgroup-data)) | |
2181 | |
2182 (defmacro gnus-data-find-list (number &optional data) | |
2183 `(let ((bdata ,(or data 'gnus-newsgroup-data))) | |
2184 (memq (assq ,number bdata) | |
2185 bdata))) | |
2186 | |
2187 (defmacro gnus-data-make (number mark pos header level) | |
2188 `(list ,number ,mark ,pos ,header ,level)) | |
2189 | |
2190 (defun gnus-data-enter (after-article number mark pos header level offset) | |
2191 (let ((data (gnus-data-find-list after-article))) | |
2192 (unless data | |
2193 (error "No such article: %d" after-article)) | |
2194 (setcdr data (cons (gnus-data-make number mark pos header level) | |
2195 (cdr data))) | |
2196 (setq gnus-newsgroup-data-reverse nil) | |
2197 (gnus-data-update-list (cddr data) offset))) | |
2198 | |
2199 (defun gnus-data-enter-list (after-article list &optional offset) | |
2200 (when list | |
2201 (let ((data (and after-article (gnus-data-find-list after-article))) | |
2202 (ilist list)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2203 (if (not (or data |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2204 after-article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2205 (let ((odata gnus-newsgroup-data)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2206 (setq gnus-newsgroup-data (nconc list gnus-newsgroup-data)) |
17493 | 2207 (when offset |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2208 (gnus-data-update-list odata offset))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2209 ;; 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
|
2210 ;; list. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2211 (while (cdr list) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2212 (setq list (cdr list))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2213 (if (not data) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2214 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2215 (setcdr list gnus-newsgroup-data) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2216 (setq gnus-newsgroup-data ilist) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2217 (when offset |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2218 (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
|
2219 (setcdr list (cdr data)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2220 (setcdr data ilist) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2221 (when offset |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2222 (gnus-data-update-list (cdr list) offset)))) |
17493 | 2223 (setq gnus-newsgroup-data-reverse nil)))) |
2224 | |
2225 (defun gnus-data-remove (article &optional offset) | |
2226 (let ((data gnus-newsgroup-data)) | |
2227 (if (= (gnus-data-number (car data)) article) | |
2228 (progn | |
2229 (setq gnus-newsgroup-data (cdr gnus-newsgroup-data) | |
2230 gnus-newsgroup-data-reverse nil) | |
2231 (when offset | |
2232 (gnus-data-update-list gnus-newsgroup-data offset))) | |
2233 (while (cdr data) | |
2234 (when (= (gnus-data-number (cadr data)) article) | |
2235 (setcdr data (cddr data)) | |
2236 (when offset | |
2237 (gnus-data-update-list (cdr data) offset)) | |
2238 (setq data nil | |
2239 gnus-newsgroup-data-reverse nil)) | |
2240 (setq data (cdr data)))))) | |
2241 | |
2242 (defmacro gnus-data-list (backward) | |
2243 `(if ,backward | |
2244 (or gnus-newsgroup-data-reverse | |
2245 (setq gnus-newsgroup-data-reverse | |
2246 (reverse gnus-newsgroup-data))) | |
2247 gnus-newsgroup-data)) | |
2248 | |
2249 (defun gnus-data-update-list (data offset) | |
2250 "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
|
2251 (setq gnus-newsgroup-data-reverse nil) |
17493 | 2252 (while data |
2253 (setcar (nthcdr 2 (car data)) (+ offset (nth 2 (car data)))) | |
2254 (setq data (cdr data)))) | |
2255 | |
2256 (defun gnus-summary-article-pseudo-p (article) | |
2257 "Say whether this article is a pseudo article or not." | |
2258 (not (vectorp (gnus-data-header (gnus-data-find article))))) | |
2259 | |
2260 (defmacro gnus-summary-article-sparse-p (article) | |
2261 "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
|
2262 `(memq ,article gnus-newsgroup-sparse)) |
17493 | 2263 |
2264 (defmacro gnus-summary-article-ancient-p (article) | |
2265 "Say whether this article is a sparse article or not." | |
2266 `(memq ,article gnus-newsgroup-ancient)) | |
2267 | |
2268 (defun gnus-article-parent-p (number) | |
2269 "Say whether this article is a parent or not." | |
2270 (let ((data (gnus-data-find-list number))) | |
2271 (and (cdr data) ; There has to be an article after... | |
2272 (< (gnus-data-level (car data)) ; And it has to have a higher level. | |
2273 (gnus-data-level (nth 1 data)))))) | |
2274 | |
2275 (defun gnus-article-children (number) | |
2276 "Return a list of all children to NUMBER." | |
2277 (let* ((data (gnus-data-find-list number)) | |
2278 (level (gnus-data-level (car data))) | |
2279 children) | |
2280 (setq data (cdr data)) | |
2281 (while (and data | |
2282 (= (gnus-data-level (car data)) (1+ level))) | |
2283 (push (gnus-data-number (car data)) children) | |
2284 (setq data (cdr data))) | |
2285 children)) | |
2286 | |
2287 (defmacro gnus-summary-skip-intangible () | |
2288 "If the current article is intangible, then jump to a different article." | |
2289 '(let ((to (get-text-property (point) 'gnus-intangible))) | |
2290 (and to (gnus-summary-goto-subject to)))) | |
2291 | |
2292 (defmacro gnus-summary-article-intangible-p () | |
2293 "Say whether this article is intangible or not." | |
2294 '(get-text-property (point) 'gnus-intangible)) | |
2295 | |
2296 (defun gnus-article-read-p (article) | |
2297 "Say whether ARTICLE is read or not." | |
2298 (not (or (memq article gnus-newsgroup-marked) | |
2299 (memq article gnus-newsgroup-unreads) | |
2300 (memq article gnus-newsgroup-unselected) | |
2301 (memq article gnus-newsgroup-dormant)))) | |
2302 | |
2303 ;; Some summary mode macros. | |
2304 | |
2305 (defmacro gnus-summary-article-number () | |
2306 "The article number of the article on the current line. | |
2307 If there isn's an article number here, then we return the current | |
2308 article number." | |
2309 '(progn | |
2310 (gnus-summary-skip-intangible) | |
2311 (or (get-text-property (point) 'gnus-number) | |
2312 (gnus-summary-last-subject)))) | |
2313 | |
2314 (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
|
2315 "Return the header of article NUMBER." |
17493 | 2316 `(gnus-data-header (gnus-data-find |
2317 ,(or number '(gnus-summary-article-number))))) | |
2318 | |
2319 (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
|
2320 "Return the level of thread that starts with article NUMBER." |
17493 | 2321 `(if (and (eq gnus-summary-make-false-root 'dummy) |
2322 (get-text-property (point) 'gnus-intangible)) | |
2323 0 | |
2324 (gnus-data-level (gnus-data-find | |
2325 ,(or number '(gnus-summary-article-number)))))) | |
2326 | |
2327 (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
|
2328 "Return the mark of article NUMBER." |
17493 | 2329 `(gnus-data-mark (gnus-data-find |
2330 ,(or number '(gnus-summary-article-number))))) | |
2331 | |
2332 (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
|
2333 "Return the position of the line of article NUMBER." |
17493 | 2334 `(gnus-data-pos (gnus-data-find |
2335 ,(or number '(gnus-summary-article-number))))) | |
2336 | |
2337 (defalias 'gnus-summary-subject-string 'gnus-summary-article-subject) | |
2338 (defmacro gnus-summary-article-subject (&optional number) | |
2339 "Return current subject string or nil if nothing." | |
2340 `(let ((headers | |
2341 ,(if number | |
2342 `(gnus-data-header (assq ,number gnus-newsgroup-data)) | |
2343 '(gnus-data-header (assq (gnus-summary-article-number) | |
2344 gnus-newsgroup-data))))) | |
2345 (and headers | |
2346 (vectorp headers) | |
2347 (mail-header-subject headers)))) | |
2348 | |
2349 (defmacro gnus-summary-article-score (&optional number) | |
2350 "Return current article score." | |
2351 `(or (cdr (assq ,(or number '(gnus-summary-article-number)) | |
2352 gnus-newsgroup-scored)) | |
2353 gnus-summary-default-score 0)) | |
2354 | |
2355 (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
|
2356 "Return a list of article numbers that are children of article NUMBER." |
17493 | 2357 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number)))) |
2358 (level (gnus-data-level (car data))) | |
2359 l children) | |
2360 (while (and (setq data (cdr data)) | |
2361 (> (setq l (gnus-data-level (car data))) level)) | |
2362 (and (= (1+ level) l) | |
2363 (push (gnus-data-number (car data)) | |
2364 children))) | |
2365 (nreverse children))) | |
2366 | |
2367 (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
|
2368 "Return the article number of the parent of article NUMBER." |
17493 | 2369 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number)) |
2370 (gnus-data-list t))) | |
2371 (level (gnus-data-level (car data)))) | |
2372 (if (zerop level) | |
2373 () ; This is a root. | |
2374 ;; We search until we find an article with a level less than | |
2375 ;; this one. That function has to be the parent. | |
2376 (while (and (setq data (cdr data)) | |
2377 (not (< (gnus-data-level (car data)) level)))) | |
2378 (and data (gnus-data-number (car data)))))) | |
2379 | |
2380 (defun gnus-unread-mark-p (mark) | |
2381 "Say whether MARK is the unread mark." | |
2382 (= mark gnus-unread-mark)) | |
2383 | |
2384 (defun gnus-read-mark-p (mark) | |
2385 "Say whether MARK is one of the marks that mark as read. | |
2386 This is all marks except unread, ticked, dormant, and expirable." | |
2387 (not (or (= mark gnus-unread-mark) | |
2388 (= mark gnus-ticked-mark) | |
2389 (= mark gnus-dormant-mark) | |
2390 (= mark gnus-expirable-mark)))) | |
2391 | |
2392 (defmacro gnus-article-mark (number) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2393 "Return the MARK of article NUMBER. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2394 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
|
2395 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
|
2396 `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
|
2397 marks of articles." |
17493 | 2398 `(cond |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2399 ((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
|
2400 ((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
|
2401 ((memq ,number gnus-newsgroup-downloadable) gnus-downloadable-mark) |
17493 | 2402 ((memq ,number gnus-newsgroup-unreads) gnus-unread-mark) |
2403 ((memq ,number gnus-newsgroup-marked) gnus-ticked-mark) | |
2404 ((memq ,number gnus-newsgroup-dormant) gnus-dormant-mark) | |
2405 ((memq ,number gnus-newsgroup-expirable) gnus-expirable-mark) | |
2406 (t (or (cdr (assq ,number gnus-newsgroup-reads)) | |
2407 gnus-ancient-mark)))) | |
2408 | |
2409 ;; Saving hidden threads. | |
2410 | |
2411 (put 'gnus-save-hidden-threads 'lisp-indent-function 0) | |
2412 (put 'gnus-save-hidden-threads 'edebug-form-spec '(body)) | |
2413 | |
2414 (defmacro gnus-save-hidden-threads (&rest forms) | |
2415 "Save hidden threads, eval FORMS, and restore the hidden threads." | |
2416 (let ((config (make-symbol "config"))) | |
2417 `(let ((,config (gnus-hidden-threads-configuration))) | |
2418 (unwind-protect | |
2419 (save-excursion | |
2420 ,@forms) | |
2421 (gnus-restore-hidden-threads-configuration ,config))))) | |
2422 | |
24552
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2423 (defun gnus-data-compute-positions () |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2424 "Compute the positions of all articles." |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2425 (setq gnus-newsgroup-data-reverse nil) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2426 (let ((data gnus-newsgroup-data)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2427 (save-excursion |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2428 (gnus-save-hidden-threads |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2429 (gnus-summary-show-all-threads) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2430 (goto-char (point-min)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2431 (while data |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2432 (while (get-text-property (point) 'gnus-intangible) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2433 (forward-line 1)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2434 (gnus-data-set-pos (car data) (+ (point) 3)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2435 (setq data (cdr data)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2436 (forward-line 1)))))) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2437 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2438 (defun gnus-hidden-threads-configuration () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2439 "Return the current hidden threads configuration." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2440 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2441 (let (config) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2442 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2443 (while (search-forward "\r" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2444 (push (1- (point)) config)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2445 config))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2446 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2447 (defun gnus-restore-hidden-threads-configuration (config) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2448 "Restore hidden threads configuration from CONFIG." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2449 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2450 (let (point buffer-read-only) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2451 (while (setq point (pop config)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2452 (when (and (< point (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2453 (goto-char point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2454 (eq (char-after) ?\n)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2455 (subst-char-in-region point (1+ point) ?\n ?\r)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2456 |
17493 | 2457 ;; Various summary mode internalish functions. |
2458 | |
2459 (defun gnus-mouse-pick-article (e) | |
2460 (interactive "e") | |
2461 (mouse-set-point e) | |
2462 (gnus-summary-next-page nil t)) | |
2463 | |
2464 (defun gnus-summary-set-display-table () | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2465 "Change the display table. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2466 Odd characters have a tendency to mess |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2467 up nicely formatted displays - we make all possible glyphs |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2468 display only a single character." |
17493 | 2469 |
2470 ;; We start from the standard display table, if any. | |
2471 (let ((table (or (copy-sequence standard-display-table) | |
2472 (make-display-table))) | |
2473 (i 32)) | |
2474 ;; Nix out all the control chars... | |
2475 (while (>= (setq i (1- i)) 0) | |
2476 (aset table i [??])) | |
2477 ;; ... but not newline and cr, of course. (cr is necessary for the | |
2478 ;; selective display). | |
2479 (aset table ?\n nil) | |
2480 (aset table ?\r nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2481 ;; We keep TAB as well. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2482 (aset table ?\t nil) |
17493 | 2483 ;; We nix out any glyphs over 126 that are not set already. |
2484 (let ((i 256)) | |
2485 (while (>= (setq i (1- i)) 127) | |
2486 ;; Only modify if the entry is nil. | |
2487 (unless (aref table i) | |
2488 (aset table i [??])))) | |
2489 (setq buffer-display-table table))) | |
2490 | |
2491 (defun gnus-summary-setup-buffer (group) | |
2492 "Initialize summary buffer." | |
2493 (let ((buffer (concat "*Summary " group "*"))) | |
2494 (if (get-buffer buffer) | |
2495 (progn | |
2496 (set-buffer buffer) | |
2497 (setq gnus-summary-buffer (current-buffer)) | |
2498 (not gnus-newsgroup-prepared)) | |
2499 ;; 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
|
2500 (setq gnus-summary-buffer (set-buffer (gnus-get-buffer-create buffer))) |
17493 | 2501 (gnus-summary-mode group) |
2502 (when gnus-carpal | |
2503 (gnus-carpal-setup-buffer 'summary)) | |
2504 (unless gnus-single-article-buffer | |
2505 (make-local-variable 'gnus-article-buffer) | |
2506 (make-local-variable 'gnus-article-current) | |
2507 (make-local-variable 'gnus-original-article-buffer)) | |
2508 (setq gnus-newsgroup-name group) | |
2509 t))) | |
2510 | |
2511 (defun gnus-set-global-variables () | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2512 "Set the global equivalents of the buffer-local variables. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2513 They are set to the latest values they had. These reflect the summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2514 buffer that was in action when the last article was fetched." |
17493 | 2515 (when (eq major-mode 'gnus-summary-mode) |
2516 (setq gnus-summary-buffer (current-buffer)) | |
2517 (let ((name gnus-newsgroup-name) | |
2518 (marked gnus-newsgroup-marked) | |
2519 (unread gnus-newsgroup-unreads) | |
2520 (headers gnus-current-headers) | |
2521 (data gnus-newsgroup-data) | |
2522 (summary gnus-summary-buffer) | |
2523 (article-buffer gnus-article-buffer) | |
2524 (original gnus-original-article-buffer) | |
2525 (gac gnus-article-current) | |
2526 (reffed gnus-reffed-article-number) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2527 (score-file gnus-current-score-file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2528 (default-charset gnus-newsgroup-charset)) |
17493 | 2529 (save-excursion |
2530 (set-buffer gnus-group-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2531 (setq gnus-newsgroup-name name |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2532 gnus-newsgroup-marked marked |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2533 gnus-newsgroup-unreads unread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2534 gnus-current-headers headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2535 gnus-newsgroup-data data |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2536 gnus-article-current gac |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2537 gnus-summary-buffer summary |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2538 gnus-article-buffer article-buffer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2539 gnus-original-article-buffer original |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2540 gnus-reffed-article-number reffed |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2541 gnus-current-score-file score-file |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2542 gnus-newsgroup-charset default-charset) |
17493 | 2543 ;; The article buffer also has local variables. |
2544 (when (gnus-buffer-live-p gnus-article-buffer) | |
2545 (set-buffer gnus-article-buffer) | |
2546 (setq gnus-summary-buffer summary)))))) | |
2547 | |
2548 (defun gnus-summary-article-unread-p (article) | |
2549 "Say whether ARTICLE is unread or not." | |
2550 (memq article gnus-newsgroup-unreads)) | |
2551 | |
2552 (defun gnus-summary-first-article-p (&optional article) | |
2553 "Return whether ARTICLE is the first article in the buffer." | |
2554 (if (not (setq article (or article (gnus-summary-article-number)))) | |
2555 nil | |
2556 (eq article (caar gnus-newsgroup-data)))) | |
2557 | |
2558 (defun gnus-summary-last-article-p (&optional article) | |
2559 "Return whether ARTICLE is the last article in the buffer." | |
2560 (if (not (setq article (or article (gnus-summary-article-number)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2561 ;; All non-existent numbers are the last article. :-) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2562 t |
17493 | 2563 (not (cdr (gnus-data-find-list article))))) |
2564 | |
2565 (defun gnus-make-thread-indent-array () | |
2566 (let ((n 200)) | |
2567 (unless (and gnus-thread-indent-array | |
2568 (= gnus-thread-indent-level gnus-thread-indent-array-level)) | |
2569 (setq gnus-thread-indent-array (make-vector 201 "") | |
2570 gnus-thread-indent-array-level gnus-thread-indent-level) | |
2571 (while (>= n 0) | |
2572 (aset gnus-thread-indent-array n | |
2573 (make-string (* n gnus-thread-indent-level) ? )) | |
2574 (setq n (1- n)))))) | |
2575 | |
2576 (defun gnus-update-summary-mark-positions () | |
2577 "Compute where the summary marks are to go." | |
2578 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2579 (when (gnus-buffer-exists-p gnus-summary-buffer) |
17493 | 2580 (set-buffer gnus-summary-buffer)) |
2581 (let ((gnus-replied-mark 129) | |
2582 (gnus-score-below-mark 130) | |
2583 (gnus-score-over-mark 130) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2584 (gnus-download-mark 131) |
17493 | 2585 (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
|
2586 gnus-visual pos) |
17493 | 2587 (save-excursion |
2588 (gnus-set-work-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2589 (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
|
2590 (gnus-newsgroup-downloadable '((0 . t)))) |
17493 | 2591 (gnus-summary-insert-line |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2592 [0 "" "" "" "" "" 0 0 "" nil] 0 nil 128 t nil "" nil 1) |
17493 | 2593 (goto-char (point-min)) |
2594 (setq pos (list (cons 'unread (and (search-forward "\200" nil t) | |
2595 (- (point) 2))))) | |
2596 (goto-char (point-min)) | |
2597 (push (cons 'replied (and (search-forward "\201" nil t) | |
2598 (- (point) 2))) | |
2599 pos) | |
2600 (goto-char (point-min)) | |
2601 (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
|
2602 pos) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2603 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2604 (push (cons 'download |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2605 (and (search-forward "\203" nil t) (- (point) 2))) |
17493 | 2606 pos))) |
2607 (setq gnus-summary-mark-positions pos)))) | |
2608 | |
2609 (defun gnus-summary-insert-dummy-line (gnus-tmp-subject gnus-tmp-number) | |
2610 "Insert a dummy root in the summary buffer." | |
2611 (beginning-of-line) | |
2612 (gnus-add-text-properties | |
2613 (point) (progn (eval gnus-summary-dummy-line-format-spec) (point)) | |
2614 (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number))) | |
2615 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2616 (defun gnus-summary-from-or-to-or-newsgroups (header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2617 (let ((to (cdr (assq 'To (mail-header-extra header)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2618 (newsgroups (cdr (assq 'Newsgroups (mail-header-extra header)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2619 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2620 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2621 (save-excursion (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2622 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2623 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2624 ((and to |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2625 gnus-ignored-from-addresses |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2626 (string-match gnus-ignored-from-addresses |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2627 (mail-header-from header))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2628 (concat "-> " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2629 (or (car (funcall gnus-extract-address-components |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2630 (funcall |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2631 gnus-decode-encoded-word-function to))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2632 (funcall gnus-decode-encoded-word-function to)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2633 ((and newsgroups |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2634 gnus-ignored-from-addresses |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2635 (string-match gnus-ignored-from-addresses |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2636 (mail-header-from header))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2637 (concat "=> " newsgroups)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2638 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2639 (or (car (funcall gnus-extract-address-components |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2640 (mail-header-from header))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2641 (mail-header-from header)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2642 |
17493 | 2643 (defun gnus-summary-insert-line (gnus-tmp-header |
2644 gnus-tmp-level gnus-tmp-current | |
2645 gnus-tmp-unread gnus-tmp-replied | |
2646 gnus-tmp-expirable gnus-tmp-subject-or-nil | |
2647 &optional gnus-tmp-dummy gnus-tmp-score | |
2648 gnus-tmp-process) | |
2649 (let* ((gnus-tmp-indentation (aref gnus-thread-indent-array gnus-tmp-level)) | |
2650 (gnus-tmp-lines (mail-header-lines gnus-tmp-header)) | |
2651 (gnus-tmp-score (or gnus-tmp-score gnus-summary-default-score 0)) | |
2652 (gnus-tmp-score-char | |
2653 (if (or (null gnus-summary-default-score) | |
2654 (<= (abs (- gnus-tmp-score gnus-summary-default-score)) | |
2655 gnus-summary-zcore-fuzz)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2656 ? ;Whitespace |
17493 | 2657 (if (< gnus-tmp-score gnus-summary-default-score) |
2658 gnus-score-below-mark gnus-score-over-mark))) | |
2659 (gnus-tmp-replied | |
2660 (cond (gnus-tmp-process gnus-process-mark) | |
2661 ((memq gnus-tmp-current gnus-newsgroup-cached) | |
2662 gnus-cached-mark) | |
2663 (gnus-tmp-replied gnus-replied-mark) | |
2664 ((memq gnus-tmp-current gnus-newsgroup-saved) | |
2665 gnus-saved-mark) | |
2666 (t gnus-unread-mark))) | |
2667 (gnus-tmp-from (mail-header-from gnus-tmp-header)) | |
2668 (gnus-tmp-name | |
2669 (cond | |
2670 ((string-match "<[^>]+> *$" gnus-tmp-from) | |
2671 (let ((beg (match-beginning 0))) | |
2672 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from) | |
2673 (substring gnus-tmp-from (1+ (match-beginning 0)) | |
2674 (1- (match-end 0)))) | |
2675 (substring gnus-tmp-from 0 beg)))) | |
2676 ((string-match "(.+)" gnus-tmp-from) | |
2677 (substring gnus-tmp-from | |
2678 (1+ (match-beginning 0)) (1- (match-end 0)))) | |
2679 (t gnus-tmp-from))) | |
2680 (gnus-tmp-subject (mail-header-subject gnus-tmp-header)) | |
2681 (gnus-tmp-number (mail-header-number gnus-tmp-header)) | |
2682 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[)) | |
2683 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\])) | |
2684 (buffer-read-only nil)) | |
2685 (when (string= gnus-tmp-name "") | |
2686 (setq gnus-tmp-name gnus-tmp-from)) | |
2687 (unless (numberp gnus-tmp-lines) | |
2688 (setq gnus-tmp-lines 0)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2689 (gnus-put-text-property |
17493 | 2690 (point) |
2691 (progn (eval gnus-summary-line-format-spec) (point)) | |
2692 'gnus-number gnus-tmp-number) | |
2693 (when (gnus-visual-p 'summary-highlight 'highlight) | |
2694 (forward-line -1) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2695 (gnus-run-hooks 'gnus-summary-update-hook) |
17493 | 2696 (forward-line 1)))) |
2697 | |
2698 (defun gnus-summary-update-line (&optional dont-update) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2699 "Update summary line after change." |
17493 | 2700 (when (and gnus-summary-default-score |
2701 (not gnus-summary-inhibit-highlight)) | |
2702 (let* ((gnus-summary-inhibit-highlight t) ; Prevent recursion. | |
2703 (article (gnus-summary-article-number)) | |
2704 (score (gnus-summary-article-score article))) | |
2705 (unless dont-update | |
2706 (if (and gnus-summary-mark-below | |
2707 (< (gnus-summary-article-score) | |
2708 gnus-summary-mark-below)) | |
2709 ;; This article has a low score, so we mark it as read. | |
2710 (when (memq article gnus-newsgroup-unreads) | |
2711 (gnus-summary-mark-article-as-read gnus-low-score-mark)) | |
2712 (when (eq (gnus-summary-article-mark) gnus-low-score-mark) | |
2713 ;; This article was previously marked as read on account | |
2714 ;; of a low score, but now it has risen, so we mark it as | |
2715 ;; unread. | |
2716 (gnus-summary-mark-article-as-unread gnus-unread-mark))) | |
2717 (gnus-summary-update-mark | |
2718 (if (or (null gnus-summary-default-score) | |
2719 (<= (abs (- score gnus-summary-default-score)) | |
2720 gnus-summary-zcore-fuzz)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2721 ? ;Whitespace |
17493 | 2722 (if (< score gnus-summary-default-score) |
2723 gnus-score-below-mark gnus-score-over-mark)) | |
2724 'score)) | |
2725 ;; Do visual highlighting. | |
2726 (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
|
2727 (gnus-run-hooks 'gnus-summary-update-hook))))) |
17493 | 2728 |
2729 (defvar gnus-tmp-new-adopts nil) | |
2730 | |
2731 (defun gnus-summary-number-of-articles-in-thread (thread &optional level char) | |
2732 "Return the number of articles in THREAD. | |
2733 This may be 0 in some cases -- if none of the articles in | |
2734 the thread are to be displayed." | |
2735 (let* ((number | |
2736 ;; Fix by Luc Van Eycken <Luc.VanEycken@esat.kuleuven.ac.be>. | |
2737 (cond | |
2738 ((not (listp thread)) | |
2739 1) | |
2740 ((and (consp thread) (cdr thread)) | |
2741 (apply | |
2742 '+ 1 (mapcar | |
2743 'gnus-summary-number-of-articles-in-thread (cdr thread)))) | |
2744 ((null thread) | |
2745 1) | |
2746 ((memq (mail-header-number (car thread)) gnus-newsgroup-limit) | |
2747 1) | |
2748 (t 0)))) | |
2749 (when (and level (zerop level) gnus-tmp-new-adopts) | |
2750 (incf number | |
2751 (apply '+ (mapcar | |
2752 'gnus-summary-number-of-articles-in-thread | |
2753 gnus-tmp-new-adopts)))) | |
2754 (if char | |
2755 (if (> number 1) gnus-not-empty-thread-mark | |
2756 gnus-empty-thread-mark) | |
2757 number))) | |
2758 | |
2759 (defun gnus-summary-set-local-parameters (group) | |
2760 "Go through the local params of GROUP and set all variable specs in that list." | |
2761 (let ((params (gnus-group-find-parameter group)) | |
2762 elem) | |
2763 (while params | |
2764 (setq elem (car params) | |
2765 params (cdr params)) | |
2766 (and (consp elem) ; Has to be a cons. | |
2767 (consp (cdr elem)) ; The cdr has to be a list. | |
2768 (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
|
2769 (not (memq (car elem) '(quit-config))) ; Ignore quit-config. |
17493 | 2770 (ignore-errors ; So we set it. |
2771 (make-local-variable (car elem)) | |
2772 (set (car elem) (eval (nth 1 elem)))))))) | |
2773 | |
2774 (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
|
2775 kill-buffer no-display backward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2776 select-articles) |
17493 | 2777 "Start reading news in newsgroup GROUP. |
2778 If SHOW-ALL is non-nil, already read articles are also listed. | |
2779 If NO-ARTICLE is non-nil, no article is selected initially. | |
2780 If NO-DISPLAY, don't generate a summary buffer." | |
2781 (let (result) | |
2782 (while (and group | |
2783 (null (setq result | |
2784 (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
|
2785 (or (gnus-summary-read-group-1 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2786 group show-all no-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2787 kill-buffer no-display |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2788 select-articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2789 (setq show-all nil |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2790 select-articles nil))))) |
17493 | 2791 (eq gnus-auto-select-next 'quietly)) |
2792 (set-buffer gnus-group-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2793 ;; 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
|
2794 ;; 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
|
2795 ;; 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
|
2796 (when backward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2797 (gnus-group-prev-unread-group 2)) |
17493 | 2798 (if (not (equal group (gnus-group-group-name))) |
2799 (setq group (gnus-group-group-name)) | |
2800 (setq group nil))) | |
2801 result)) | |
2802 | |
2803 (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
|
2804 kill-buffer no-display |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2805 &optional select-articles) |
17493 | 2806 ;; Killed foreign groups can't be entered. |
2807 (when (and (not (gnus-group-native-p group)) | |
2808 (not (gnus-gethash group gnus-newsrc-hashtb))) | |
2809 (error "Dead non-native groups can't be entered")) | |
2810 (gnus-message 5 "Retrieving newsgroup: %s..." group) | |
2811 (let* ((new-group (gnus-summary-setup-buffer group)) | |
2812 (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
|
2813 (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
|
2814 group show-all select-articles)))) |
17493 | 2815 (cond |
2816 ;; This summary buffer exists already, so we just select it. | |
2817 ((not new-group) | |
2818 (gnus-set-global-variables) | |
2819 (when kill-buffer | |
2820 (gnus-kill-or-deaden-summary kill-buffer)) | |
2821 (gnus-configure-windows 'summary 'force) | |
2822 (gnus-set-mode-line 'summary) | |
2823 (gnus-summary-position-point) | |
2824 (message "") | |
2825 t) | |
2826 ;; We couldn't select this group. | |
2827 ((null did-select) | |
2828 (when (and (eq major-mode 'gnus-summary-mode) | |
2829 (not (equal (current-buffer) kill-buffer))) | |
2830 (kill-buffer (current-buffer)) | |
2831 (if (not quit-config) | |
2832 (progn | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2833 ;; 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
|
2834 ;; for instance. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2835 (gnus-summary-update-info) |
17493 | 2836 (set-buffer gnus-group-buffer) |
2837 (gnus-group-jump-to-group group) | |
2838 (gnus-group-next-unread-group 1)) | |
2839 (gnus-handle-ephemeral-exit quit-config))) | |
2840 (gnus-message 3 "Can't select group") | |
2841 nil) | |
2842 ;; The user did a `C-g' while prompting for number of articles, | |
2843 ;; so we exit this group. | |
2844 ((eq did-select 'quit) | |
2845 (and (eq major-mode 'gnus-summary-mode) | |
2846 (not (equal (current-buffer) kill-buffer)) | |
2847 (kill-buffer (current-buffer))) | |
2848 (when kill-buffer | |
2849 (gnus-kill-or-deaden-summary kill-buffer)) | |
2850 (if (not quit-config) | |
2851 (progn | |
2852 (set-buffer gnus-group-buffer) | |
2853 (gnus-group-jump-to-group group) | |
2854 (gnus-group-next-unread-group 1) | |
2855 (gnus-configure-windows 'group 'force)) | |
2856 (gnus-handle-ephemeral-exit quit-config)) | |
2857 ;; Finally signal the quit. | |
2858 (signal 'quit nil)) | |
2859 ;; The group was successfully selected. | |
2860 (t | |
2861 (gnus-set-global-variables) | |
2862 ;; Save the active value in effect when the group was entered. | |
2863 (setq gnus-newsgroup-active | |
2864 (gnus-copy-sequence | |
2865 (gnus-active gnus-newsgroup-name))) | |
2866 ;; 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
|
2867 (gnus-run-hooks 'gnus-select-group-hook) |
17493 | 2868 ;; Set any local variables in the group parameters. |
2869 (gnus-summary-set-local-parameters gnus-newsgroup-name) | |
2870 (gnus-update-format-specifications | |
2871 nil 'summary 'summary-mode 'summary-dummy) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2872 (gnus-update-summary-mark-positions) |
17493 | 2873 ;; Do score processing. |
2874 (when gnus-use-scoring | |
2875 (gnus-possibly-score-headers)) | |
2876 ;; Check whether to fill in the gaps in the threads. | |
2877 (when gnus-build-sparse-threads | |
2878 (gnus-build-sparse-threads)) | |
2879 ;; Find the initial limit. | |
2880 (if gnus-show-threads | |
2881 (if show-all | |
2882 (let ((gnus-newsgroup-dormant nil)) | |
2883 (gnus-summary-initial-limit show-all)) | |
2884 (gnus-summary-initial-limit show-all)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2885 ;; When untreaded, all articles are always shown. |
17493 | 2886 (setq gnus-newsgroup-limit |
2887 (mapcar | |
2888 (lambda (header) (mail-header-number header)) | |
2889 gnus-newsgroup-headers))) | |
2890 ;; Generate the summary buffer. | |
2891 (unless no-display | |
2892 (gnus-summary-prepare)) | |
2893 (when gnus-use-trees | |
2894 (gnus-tree-open group) | |
2895 (setq gnus-summary-highlight-line-function | |
2896 'gnus-tree-highlight-article)) | |
2897 ;; If the summary buffer is empty, but there are some low-scored | |
2898 ;; articles or some excluded dormants, we include these in the | |
2899 ;; buffer. | |
2900 (when (and (zerop (buffer-size)) | |
2901 (not no-display)) | |
2902 (cond (gnus-newsgroup-dormant | |
2903 (gnus-summary-limit-include-dormant)) | |
2904 ((and gnus-newsgroup-scored show-all) | |
2905 (gnus-summary-limit-include-expunged t)))) | |
2906 ;; 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
|
2907 (gnus-run-hooks 'gnus-apply-kill-hook) |
17493 | 2908 (if (and (zerop (buffer-size)) |
2909 (not no-display)) | |
2910 (progn | |
2911 ;; This newsgroup is empty. | |
2912 (gnus-summary-catchup-and-exit nil t) | |
2913 (gnus-message 6 "No unread news") | |
2914 (when kill-buffer | |
2915 (gnus-kill-or-deaden-summary kill-buffer)) | |
2916 ;; Return nil from this function. | |
2917 nil) | |
2918 ;; Hide conversation thread subtrees. We cannot do this in | |
2919 ;; gnus-summary-prepare-hook since kill processing may not | |
2920 ;; work with hidden articles. | |
2921 (and gnus-show-threads | |
2922 gnus-thread-hide-subtree | |
2923 (gnus-summary-hide-all-threads)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2924 (when kill-buffer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2925 (gnus-kill-or-deaden-summary kill-buffer)) |
17493 | 2926 ;; Show first unread article if requested. |
2927 (if (and (not no-article) | |
2928 (not no-display) | |
2929 gnus-newsgroup-unreads | |
2930 gnus-auto-select-first) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2931 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2932 (gnus-configure-windows 'summary) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2933 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2934 ((eq gnus-auto-select-first 'best) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2935 (gnus-summary-best-unread-article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2936 ((eq gnus-auto-select-first t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2937 (gnus-summary-first-unread-article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2938 ((gnus-functionp gnus-auto-select-first) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2939 (funcall gnus-auto-select-first)))) |
17493 | 2940 ;; Don't select any articles, just move point to the first |
2941 ;; article in the group. | |
2942 (goto-char (point-min)) | |
2943 (gnus-summary-position-point) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2944 (gnus-configure-windows 'summary 'force) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2945 (gnus-set-mode-line 'summary)) |
17493 | 2946 (when (get-buffer-window gnus-group-buffer t) |
2947 ;; Gotta use windows, because recenter does weird stuff if | |
2948 ;; the current buffer ain't the displayed window. | |
2949 (let ((owin (selected-window))) | |
2950 (select-window (get-buffer-window gnus-group-buffer t)) | |
2951 (when (gnus-group-goto-group group) | |
2952 (recenter)) | |
2953 (select-window owin))) | |
2954 ;; Mark this buffer as "prepared". | |
2955 (setq gnus-newsgroup-prepared t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2956 (gnus-run-hooks 'gnus-summary-prepared-hook) |
17493 | 2957 t))))) |
2958 | |
2959 (defun gnus-summary-prepare () | |
2960 "Generate the summary buffer." | |
2961 (interactive) | |
2962 (let ((buffer-read-only nil)) | |
2963 (erase-buffer) | |
2964 (setq gnus-newsgroup-data nil | |
2965 gnus-newsgroup-data-reverse nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2966 (gnus-run-hooks 'gnus-summary-generate-hook) |
17493 | 2967 ;; Generate the buffer, either with threads or without. |
2968 (when gnus-newsgroup-headers | |
2969 (gnus-summary-prepare-threads | |
2970 (if gnus-show-threads | |
2971 (gnus-sort-gathered-threads | |
2972 (funcall gnus-summary-thread-gathering-function | |
2973 (gnus-sort-threads | |
2974 (gnus-cut-threads (gnus-make-threads))))) | |
2975 ;; Unthreaded display. | |
2976 (gnus-sort-articles gnus-newsgroup-headers)))) | |
2977 (setq gnus-newsgroup-data (nreverse gnus-newsgroup-data)) | |
2978 ;; Call hooks for modifying summary buffer. | |
2979 (goto-char (point-min)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2980 (gnus-run-hooks 'gnus-summary-prepare-hook))) |
17493 | 2981 |
2982 (defsubst gnus-general-simplify-subject (subject) | |
2983 "Simply subject by the same rules as gnus-gather-threads-by-subject." | |
2984 (setq subject | |
2985 (cond | |
2986 ;; Truncate the subject. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2987 (gnus-simplify-subject-functions |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2988 (gnus-map-function gnus-simplify-subject-functions subject)) |
17493 | 2989 ((numberp gnus-summary-gather-subject-limit) |
2990 (setq subject (gnus-simplify-subject-re subject)) | |
2991 (if (> (length subject) gnus-summary-gather-subject-limit) | |
2992 (substring subject 0 gnus-summary-gather-subject-limit) | |
2993 subject)) | |
2994 ;; Fuzzily simplify it. | |
2995 ((eq 'fuzzy gnus-summary-gather-subject-limit) | |
2996 (gnus-simplify-subject-fuzzy subject)) | |
2997 ;; Just remove the leading "Re:". | |
2998 (t | |
2999 (gnus-simplify-subject-re subject)))) | |
3000 | |
3001 (if (and gnus-summary-gather-exclude-subject | |
3002 (string-match gnus-summary-gather-exclude-subject subject)) | |
3003 nil ; This article shouldn't be gathered | |
3004 subject)) | |
3005 | |
3006 (defun gnus-summary-simplify-subject-query () | |
3007 "Query where the respool algorithm would put this article." | |
3008 (interactive) | |
3009 (gnus-summary-select-article) | |
3010 (message (gnus-general-simplify-subject (gnus-summary-article-subject)))) | |
3011 | |
3012 (defun gnus-gather-threads-by-subject (threads) | |
3013 "Gather threads by looking at Subject headers." | |
3014 (if (not gnus-summary-make-false-root) | |
3015 threads | |
3016 (let ((hashtb (gnus-make-hashtable 1024)) | |
3017 (prev threads) | |
3018 (result threads) | |
3019 subject hthread whole-subject) | |
3020 (while threads | |
3021 (setq subject (gnus-general-simplify-subject | |
3022 (setq whole-subject (mail-header-subject | |
3023 (caar threads))))) | |
3024 (when subject | |
3025 (if (setq hthread (gnus-gethash subject hashtb)) | |
3026 (progn | |
3027 ;; We enter a dummy root into the thread, if we | |
3028 ;; haven't done that already. | |
3029 (unless (stringp (caar hthread)) | |
3030 (setcar hthread (list whole-subject (car hthread)))) | |
3031 ;; We add this new gathered thread to this gathered | |
3032 ;; thread. | |
3033 (setcdr (car hthread) | |
3034 (nconc (cdar hthread) (list (car threads)))) | |
3035 ;; Remove it from the list of threads. | |
3036 (setcdr prev (cdr threads)) | |
3037 (setq threads prev)) | |
3038 ;; Enter this thread into the hash table. | |
3039 (gnus-sethash subject threads hashtb))) | |
3040 (setq prev threads) | |
3041 (setq threads (cdr threads))) | |
3042 result))) | |
3043 | |
3044 (defun gnus-gather-threads-by-references (threads) | |
3045 "Gather threads by looking at References headers." | |
3046 (let ((idhashtb (gnus-make-hashtable 1024)) | |
3047 (thhashtb (gnus-make-hashtable 1024)) | |
3048 (prev threads) | |
3049 (result threads) | |
3050 ids references id gthread gid entered ref) | |
3051 (while threads | |
3052 (when (setq references (mail-header-references (caar threads))) | |
3053 (setq id (mail-header-id (caar threads)) | |
3054 ids (gnus-split-references references) | |
3055 entered nil) | |
3056 (while (setq ref (pop ids)) | |
3057 (setq ids (delete ref ids)) | |
3058 (if (not (setq gid (gnus-gethash ref idhashtb))) | |
3059 (progn | |
3060 (gnus-sethash ref id idhashtb) | |
3061 (gnus-sethash id threads thhashtb)) | |
3062 (setq gthread (gnus-gethash gid thhashtb)) | |
3063 (unless entered | |
3064 ;; We enter a dummy root into the thread, if we | |
3065 ;; haven't done that already. | |
3066 (unless (stringp (caar gthread)) | |
3067 (setcar gthread (list (mail-header-subject (caar gthread)) | |
3068 (car gthread)))) | |
3069 ;; We add this new gathered thread to this gathered | |
3070 ;; thread. | |
3071 (setcdr (car gthread) | |
3072 (nconc (cdar gthread) (list (car threads))))) | |
3073 ;; Add it into the thread hash table. | |
3074 (gnus-sethash id gthread thhashtb) | |
3075 (setq entered t) | |
3076 ;; Remove it from the list of threads. | |
3077 (setcdr prev (cdr threads)) | |
3078 (setq threads prev)))) | |
3079 (setq prev threads) | |
3080 (setq threads (cdr threads))) | |
3081 result)) | |
3082 | |
3083 (defun gnus-sort-gathered-threads (threads) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3084 "Sort subtreads inside each gathered thread by `gnus-sort-gathered-threads-function'." |
17493 | 3085 (let ((result threads)) |
3086 (while threads | |
3087 (when (stringp (caar threads)) | |
3088 (setcdr (car threads) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3089 (sort (cdar threads) gnus-sort-gathered-threads-function))) |
17493 | 3090 (setq threads (cdr threads))) |
3091 result)) | |
3092 | |
3093 (defun gnus-thread-loop-p (root thread) | |
3094 "Say whether ROOT is in THREAD." | |
3095 (let ((stack (list thread)) | |
3096 (infloop 0) | |
3097 th) | |
3098 (while (setq thread (pop stack)) | |
3099 (setq th (cdr thread)) | |
3100 (while (and th | |
3101 (not (eq (caar th) root))) | |
3102 (pop th)) | |
3103 (if th | |
3104 ;; We have found a loop. | |
3105 (let (ref-dep) | |
3106 (setcdr thread (delq (car th) (cdr thread))) | |
3107 (if (boundp (setq ref-dep (intern "none" | |
3108 gnus-newsgroup-dependencies))) | |
3109 (setcdr (symbol-value ref-dep) | |
3110 (nconc (cdr (symbol-value ref-dep)) | |
3111 (list (car th)))) | |
3112 (set ref-dep (list nil (car th)))) | |
3113 (setq infloop 1 | |
3114 stack nil)) | |
3115 ;; Push all the subthreads onto the stack. | |
3116 (push (cdr thread) stack))) | |
3117 infloop)) | |
3118 | |
3119 (defun gnus-make-threads () | |
3120 "Go through the dependency hashtb and find the roots. Return all threads." | |
3121 (let (threads) | |
3122 (while (catch 'infloop | |
3123 (mapatoms | |
3124 (lambda (refs) | |
3125 ;; Deal with self-referencing References loops. | |
3126 (when (and (car (symbol-value refs)) | |
3127 (not (zerop | |
3128 (apply | |
3129 '+ | |
3130 (mapcar | |
3131 (lambda (thread) | |
3132 (gnus-thread-loop-p | |
3133 (car (symbol-value refs)) thread)) | |
3134 (cdr (symbol-value refs))))))) | |
3135 (setq threads nil) | |
3136 (throw 'infloop t)) | |
3137 (unless (car (symbol-value refs)) | |
3138 ;; These threads do not refer back to any other articles, | |
3139 ;; so they're roots. | |
3140 (setq threads (append (cdr (symbol-value refs)) threads)))) | |
3141 gnus-newsgroup-dependencies))) | |
3142 threads)) | |
3143 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3144 ;; Build the thread tree. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3145 (defsubst gnus-dependencies-add-header (header dependencies force-new) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3146 "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
|
3147 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3148 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
|
3149 if it was already present. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3150 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3151 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
|
3152 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
|
3153 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
|
3154 being entered. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3155 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3156 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
|
3157 (let* ((id (mail-header-id header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3158 (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
|
3159 ref ref-dep ref-header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3160 ;; 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
|
3161 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3162 ((not id-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3163 (setq header nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3164 ;; 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
|
3165 ;; in the `dependencies' table. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3166 ((not (boundp id-dep)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3167 (set id-dep (list header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3168 ((null (car (symbol-value id-dep))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3169 (setcar (symbol-value id-dep) header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3170 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3171 ;; 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
|
3172 ;; `dependencies' table. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3173 (force-new |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3174 ;; Overrides an existing entry; |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3175 ;; 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
|
3176 (setcar (symbol-value id-dep) header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3177 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3178 ;; 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
|
3179 ((not gnus-summary-ignore-duplicates) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3180 ;; 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
|
3181 ;; We rename the Message-ID. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3182 (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
|
3183 (list header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3184 (mail-header-set-id header id)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3185 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3186 ;; 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
|
3187 ;; 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
|
3188 ;; servers. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3189 ;; 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
|
3190 ;; table was *not* modified. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3191 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3192 (mail-header-set-xref |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3193 (car (symbol-value id-dep)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3194 (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
|
3195 "") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3196 (or (mail-header-xref header) ""))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3197 (setq header nil))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3198 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3199 (when header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3200 ;; 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
|
3201 (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
|
3202 (while (and ref |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3203 (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
|
3204 (boundp ref-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3205 (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
|
3206 (if (string= id ref) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3207 ;; 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
|
3208 ;; root article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3209 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3210 (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
|
3211 (setq ref nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3212 (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
|
3213 (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
|
3214 (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
|
3215 (if (boundp ref-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3216 (setcdr (symbol-value ref-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3217 (nconc (cdr (symbol-value ref-dep)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3218 (list (symbol-value id-dep)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3219 (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
|
3220 header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3221 |
17493 | 3222 (defun gnus-build-sparse-threads () |
3223 (let ((headers gnus-newsgroup-headers) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3224 (mail-parse-charset gnus-newsgroup-charset) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3225 (gnus-summary-ignore-duplicates t) |
17493 | 3226 header references generation relations |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3227 subject child end new-child date) |
17493 | 3228 ;; First we create an alist of generations/relations, where |
3229 ;; generations is how much we trust the relation, and the relation | |
3230 ;; is parent/child. | |
3231 (gnus-message 7 "Making sparse threads...") | |
3232 (save-excursion | |
3233 (nnheader-set-temp-buffer " *gnus sparse threads*") | |
3234 (while (setq header (pop headers)) | |
3235 (when (and (setq references (mail-header-references header)) | |
3236 (not (string= references ""))) | |
3237 (insert references) | |
3238 (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
|
3239 subject (mail-header-subject header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3240 date (mail-header-date header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3241 generation 0) |
17493 | 3242 (while (search-backward ">" nil t) |
3243 (setq end (1+ (point))) | |
3244 (when (search-backward "<" nil t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3245 (setq new-child (buffer-substring (point) end)) |
17493 | 3246 (push (list (incf generation) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3247 child (setq child new-child) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3248 subject date) |
17493 | 3249 relations))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3250 (when child |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3251 (push (list (1+ generation) child nil subject) relations)) |
17493 | 3252 (erase-buffer))) |
3253 (kill-buffer (current-buffer))) | |
3254 ;; Sort over trustworthiness. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3255 (mapcar |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3256 (lambda (relation) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3257 (when (gnus-dependencies-add-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3258 (make-full-mail-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3259 gnus-reffed-article-number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3260 (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
|
3261 (nth 1 relation) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3262 (or (nth 2 relation) "") 0 0 "") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3263 gnus-newsgroup-dependencies nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3264 (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
|
3265 (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
|
3266 (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
|
3267 gnus-newsgroup-reads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3268 (decf gnus-reffed-article-number))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3269 (sort relations 'car-less-than-car)) |
17493 | 3270 (gnus-message 7 "Making sparse threads...done"))) |
3271 | |
3272 (defun gnus-build-old-threads () | |
3273 ;; Look at all the articles that refer back to old articles, and | |
3274 ;; fetch the headers for the articles that aren't there. This will | |
3275 ;; build complete threads - if the roots haven't been expired by the | |
3276 ;; server, that is. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3277 (let ((mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3278 id heads) |
17493 | 3279 (mapatoms |
3280 (lambda (refs) | |
3281 (when (not (car (symbol-value refs))) | |
3282 (setq heads (cdr (symbol-value refs))) | |
3283 (while heads | |
3284 (if (memq (mail-header-number (caar heads)) | |
3285 gnus-newsgroup-dormant) | |
3286 (setq heads (cdr heads)) | |
3287 (setq id (symbol-name refs)) | |
3288 (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
|
3289 (not (car (gnus-id-to-thread id))))) |
17493 | 3290 (setq heads nil))))) |
3291 gnus-newsgroup-dependencies))) | |
3292 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3293 ;; 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
|
3294 ;; on the beginning of the line. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3295 (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
|
3296 (let ((eol (gnus-point-at-eol)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3297 (buffer (current-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3298 header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3299 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3300 ;; 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
|
3301 (unwind-protect |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3302 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3303 (narrow-to-region (point) eol) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3304 (unless (eobp) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3305 (forward-char)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3306 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3307 (setq header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3308 (make-full-mail-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3309 number ; number |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3310 (funcall gnus-decode-encoded-word-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3311 (nnheader-nov-field)) ; subject |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3312 (funcall gnus-decode-encoded-word-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3313 (nnheader-nov-field)) ; from |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3314 (nnheader-nov-field) ; date |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3315 (nnheader-nov-read-message-id) ; id |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3316 (nnheader-nov-field) ; refs |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3317 (nnheader-nov-read-integer) ; chars |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3318 (nnheader-nov-read-integer) ; lines |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3319 (unless (eobp) |
31785 | 3320 (if (looking-at "Xref: ") |
3321 (goto-char (match-end 0))) | |
3322 (nnheader-nov-field)) ; Xref | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3323 (nnheader-nov-parse-extra)))) ; extra |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3324 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3325 (widen)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3326 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3327 (when gnus-alter-header-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3328 (funcall gnus-alter-header-function header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3329 (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
|
3330 |
17493 | 3331 (defun gnus-build-get-header (id) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3332 "Look through the buffer of NOV lines and find the header to ID. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3333 Enter this line into the dependencies hash table, and return |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3334 the id of the parent article (if any)." |
17493 | 3335 (let ((deps gnus-newsgroup-dependencies) |
3336 found header) | |
3337 (prog1 | |
3338 (save-excursion | |
3339 (set-buffer nntp-server-buffer) | |
3340 (let ((case-fold-search nil)) | |
3341 (goto-char (point-min)) | |
3342 (while (and (not found) | |
3343 (search-forward id nil t)) | |
3344 (beginning-of-line) | |
3345 (setq found (looking-at | |
3346 (format "^[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t%s" | |
3347 (regexp-quote id)))) | |
3348 (or found (beginning-of-line 2))) | |
3349 (when found | |
3350 (beginning-of-line) | |
3351 (and | |
3352 (setq header (gnus-nov-parse-line | |
3353 (read (current-buffer)) deps)) | |
3354 (gnus-parent-id (mail-header-references header)))))) | |
3355 (when header | |
3356 (let ((number (mail-header-number header))) | |
3357 (push number gnus-newsgroup-limit) | |
3358 (push header gnus-newsgroup-headers) | |
3359 (if (memq number gnus-newsgroup-unselected) | |
3360 (progn | |
3361 (push number gnus-newsgroup-unreads) | |
3362 (setq gnus-newsgroup-unselected | |
3363 (delq number gnus-newsgroup-unselected))) | |
3364 (push number gnus-newsgroup-ancient))))))) | |
3365 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3366 (defun gnus-build-all-threads () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3367 "Read all the headers." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3368 (let ((gnus-summary-ignore-duplicates t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3369 (mail-parse-charset gnus-newsgroup-charset) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3370 (dependencies gnus-newsgroup-dependencies) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3371 header article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3372 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3373 (set-buffer nntp-server-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3374 (let ((case-fold-search nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3375 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3376 (while (not (eobp)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3377 (ignore-errors |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3378 (setq article (read (current-buffer)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3379 header (gnus-nov-parse-line article dependencies))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3380 (when header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3381 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3382 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3383 (push header gnus-newsgroup-headers) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3384 (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
|
3385 gnus-newsgroup-unselected) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3386 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3387 (push article gnus-newsgroup-unreads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3388 (setq gnus-newsgroup-unselected |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3389 (delq article gnus-newsgroup-unselected))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3390 (push article gnus-newsgroup-ancient))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3391 (forward-line 1))))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3392 |
17493 | 3393 (defun gnus-summary-update-article-line (article header) |
3394 "Update the line for ARTICLE using HEADERS." | |
3395 (let* ((id (mail-header-id header)) | |
3396 (thread (gnus-id-to-thread id))) | |
3397 (unless thread | |
3398 (error "Article in no thread")) | |
3399 ;; Update the thread. | |
3400 (setcar thread header) | |
3401 (gnus-summary-goto-subject article) | |
3402 (let* ((datal (gnus-data-find-list article)) | |
3403 (data (car datal)) | |
3404 (length (when (cdr datal) | |
3405 (- (gnus-data-pos data) | |
3406 (gnus-data-pos (cadr datal))))) | |
3407 (buffer-read-only nil) | |
3408 (level (gnus-summary-thread-level))) | |
3409 (gnus-delete-line) | |
3410 (gnus-summary-insert-line | |
3411 header level nil (gnus-article-mark article) | |
3412 (memq article gnus-newsgroup-replied) | |
3413 (memq article gnus-newsgroup-expirable) | |
3414 ;; Only insert the Subject string when it's different | |
3415 ;; from the previous Subject string. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3416 (if (and |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3417 gnus-show-threads |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3418 (gnus-subject-equal |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3419 (condition-case () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3420 (mail-header-subject |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3421 (gnus-data-header |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3422 (cadr |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3423 (gnus-data-find-list |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3424 article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3425 (gnus-data-list t))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3426 ;; Error on the side of excessive subjects. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3427 (error "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3428 (mail-header-subject header))) |
17493 | 3429 "" |
3430 (mail-header-subject header)) | |
3431 nil (cdr (assq article gnus-newsgroup-scored)) | |
3432 (memq article gnus-newsgroup-processable)) | |
3433 (when length | |
3434 (gnus-data-update-list | |
3435 (cdr datal) (- length (- (gnus-data-pos data) (point)))))))) | |
3436 | |
3437 (defun gnus-summary-update-article (article &optional iheader) | |
3438 "Update ARTICLE in the summary buffer." | |
3439 (set-buffer gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3440 (let* ((header (gnus-summary-article-header article)) |
17493 | 3441 (id (mail-header-id header)) |
3442 (data (gnus-data-find article)) | |
3443 (thread (gnus-id-to-thread id)) | |
3444 (references (mail-header-references header)) | |
3445 (parent | |
3446 (gnus-id-to-thread | |
3447 (or (gnus-parent-id | |
3448 (when (and references | |
3449 (not (equal "" references))) | |
3450 references)) | |
3451 "none"))) | |
3452 (buffer-read-only nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3453 (old (car thread))) |
17493 | 3454 (when thread |
3455 (unless iheader | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3456 (setcar thread nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3457 (when parent |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3458 (delq thread parent))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3459 (if (gnus-summary-insert-subject id header) |
17493 | 3460 ;; Set the (possibly) new article number in the data structure. |
3461 (gnus-data-set-number data (gnus-id-to-article id)) | |
3462 (setcar thread old) | |
3463 nil)))) | |
3464 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3465 (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
|
3466 "Rebuild the thread containing ID. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3467 If LINE, insert the rebuilt thread starting on line LINE." |
17493 | 3468 (let ((buffer-read-only nil) |
3469 old-pos current thread data) | |
3470 (if (not gnus-show-threads) | |
3471 (setq thread (list (car (gnus-id-to-thread id)))) | |
3472 ;; Get the thread this article is part of. | |
3473 (setq thread (gnus-remove-thread id))) | |
3474 (setq old-pos (gnus-point-at-bol)) | |
3475 (setq current (save-excursion | |
3476 (and (zerop (forward-line -1)) | |
3477 (gnus-summary-article-number)))) | |
3478 ;; If this is a gathered thread, we have to go some re-gathering. | |
3479 (when (stringp (car thread)) | |
3480 (let ((subject (car thread)) | |
3481 roots thr) | |
3482 (setq thread (cdr thread)) | |
3483 (while thread | |
3484 (unless (memq (setq thr (gnus-id-to-thread | |
3485 (gnus-root-id | |
3486 (mail-header-id (caar thread))))) | |
3487 roots) | |
3488 (push thr roots)) | |
3489 (setq thread (cdr thread))) | |
3490 ;; We now have all (unique) roots. | |
3491 (if (= (length roots) 1) | |
3492 ;; All the loose roots are now one solid root. | |
3493 (setq thread (car roots)) | |
3494 (setq thread (cons subject (gnus-sort-threads roots)))))) | |
3495 (let (threads) | |
3496 ;; 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
|
3497 (when line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3498 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3499 (forward-line (1- line))) |
17493 | 3500 (let (gnus-newsgroup-data gnus-newsgroup-threads) |
3501 (if gnus-show-threads | |
3502 (gnus-summary-prepare-threads (gnus-cut-threads (list thread))) | |
3503 (gnus-summary-prepare-unthreaded thread)) | |
3504 (setq data (nreverse gnus-newsgroup-data)) | |
3505 (setq threads gnus-newsgroup-threads)) | |
3506 ;; 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
|
3507 ;;!!! 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
|
3508 ;;!!! 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
|
3509 ;;!!! 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
|
3510 ;;!!! change in the future. Perhaps. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3511 (gnus-data-enter-list |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3512 (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
|
3513 (setq gnus-newsgroup-threads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3514 (nconc threads gnus-newsgroup-threads)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3515 (gnus-data-compute-positions)))) |
17493 | 3516 |
3517 (defun gnus-number-to-header (number) | |
3518 "Return the header for article NUMBER." | |
3519 (let ((headers gnus-newsgroup-headers)) | |
3520 (while (and headers | |
3521 (not (= number (mail-header-number (car headers))))) | |
3522 (pop headers)) | |
3523 (when headers | |
3524 (car headers)))) | |
3525 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3526 (defun gnus-parent-headers (in-headers &optional generation) |
17493 | 3527 "Return the headers of the GENERATIONeth parent of HEADERS." |
3528 (unless generation | |
3529 (setq generation 1)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
3530 (let ((parent t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3531 (headers in-headers) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
3532 references) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3533 (while (and parent |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3534 (not (zerop generation)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3535 (setq references (mail-header-references headers))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3536 (setq headers (if (and references |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3537 (setq parent (gnus-parent-id references))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3538 (car (gnus-id-to-thread parent)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3539 nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3540 (decf generation)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3541 (and (not (eq headers in-headers)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3542 headers))) |
17493 | 3543 |
3544 (defun gnus-id-to-thread (id) | |
3545 "Return the (sub-)thread where ID appears." | |
3546 (gnus-gethash id gnus-newsgroup-dependencies)) | |
3547 | |
3548 (defun gnus-id-to-article (id) | |
3549 "Return the article number of ID." | |
3550 (let ((thread (gnus-id-to-thread id))) | |
3551 (when (and thread | |
3552 (car thread)) | |
3553 (mail-header-number (car thread))))) | |
3554 | |
3555 (defun gnus-id-to-header (id) | |
3556 "Return the article headers of ID." | |
3557 (car (gnus-id-to-thread id))) | |
3558 | |
3559 (defun gnus-article-displayed-root-p (article) | |
3560 "Say whether ARTICLE is a root(ish) article." | |
3561 (let ((level (gnus-summary-thread-level article)) | |
3562 (refs (mail-header-references (gnus-summary-article-header article))) | |
3563 particle) | |
3564 (cond | |
3565 ((null level) nil) | |
3566 ((zerop level) t) | |
3567 ((null refs) t) | |
3568 ((null (gnus-parent-id refs)) t) | |
3569 ((and (= 1 level) | |
3570 (null (setq particle (gnus-id-to-article | |
3571 (gnus-parent-id refs)))) | |
3572 (null (gnus-summary-thread-level particle))))))) | |
3573 | |
3574 (defun gnus-root-id (id) | |
3575 "Return the id of the root of the thread where ID appears." | |
3576 (let (last-id prev) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3577 (while (and id (setq prev (car (gnus-id-to-thread id)))) |
17493 | 3578 (setq last-id id |
3579 id (gnus-parent-id (mail-header-references prev)))) | |
3580 last-id)) | |
3581 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3582 (defun gnus-articles-in-thread (thread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3583 "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
|
3584 (cons (mail-header-number (car thread)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3585 (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
|
3586 |
17493 | 3587 (defun gnus-remove-thread (id &optional dont-remove) |
3588 "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
|
3589 (let (headers thread last-id) |
17493 | 3590 ;; 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
|
3591 (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
|
3592 headers (message-flatten-list (gnus-id-to-thread last-id))) |
17493 | 3593 ;; We have now found the real root of this thread. It might have |
3594 ;; been gathered into some loose thread, so we have to search | |
3595 ;; through the threads to find the thread we wanted. | |
3596 (let ((threads gnus-newsgroup-threads) | |
3597 sub) | |
3598 (while threads | |
3599 (setq sub (car threads)) | |
3600 (if (stringp (car sub)) | |
3601 ;; This is a gathered thread, so we look at the roots | |
3602 ;; below it to find whether this article is in this | |
3603 ;; gathered root. | |
3604 (progn | |
3605 (setq sub (cdr sub)) | |
3606 (while sub | |
3607 (when (member (caar sub) headers) | |
3608 (setq thread (car threads) | |
3609 threads nil | |
3610 sub nil)) | |
3611 (setq sub (cdr sub)))) | |
3612 ;; It's an ordinary thread, so we check it. | |
3613 (when (eq (car sub) (car headers)) | |
3614 (setq thread sub | |
3615 threads nil))) | |
3616 (setq threads (cdr threads))) | |
3617 ;; If this article is in no thread, then it's a root. | |
3618 (if thread | |
3619 (unless dont-remove | |
3620 (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
|
3621 (setq thread (gnus-id-to-thread last-id))) |
17493 | 3622 (when thread |
3623 (prog1 | |
3624 thread ; We return this thread. | |
3625 (unless dont-remove | |
3626 (if (stringp (car thread)) | |
3627 (progn | |
3628 ;; If we use dummy roots, then we have to remove the | |
3629 ;; dummy root as well. | |
3630 (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
|
3631 ;; 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
|
3632 ;; 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
|
3633 (gnus-summary-goto-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3634 (mail-header-number (caadr thread))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3635 (forward-line -1) |
17493 | 3636 (gnus-delete-line) |
3637 (gnus-data-compute-positions)) | |
3638 (setq thread (cdr thread)) | |
3639 (while thread | |
3640 (gnus-remove-thread-1 (car thread)) | |
3641 (setq thread (cdr thread)))) | |
3642 (gnus-remove-thread-1 thread)))))))) | |
3643 | |
3644 (defun gnus-remove-thread-1 (thread) | |
3645 "Remove the thread THREAD recursively." | |
3646 (let ((number (mail-header-number (pop thread))) | |
3647 d) | |
3648 (setq thread (reverse thread)) | |
3649 (while thread | |
3650 (gnus-remove-thread-1 (pop thread))) | |
3651 (when (setq d (gnus-data-find number)) | |
3652 (goto-char (gnus-data-pos d)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3653 (gnus-summary-show-thread) |
17493 | 3654 (gnus-data-remove |
3655 number | |
3656 (- (gnus-point-at-bol) | |
3657 (prog1 | |
3658 (1+ (gnus-point-at-eol)) | |
3659 (gnus-delete-line))))))) | |
3660 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3661 (defun gnus-sort-threads-1 (threads func) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3662 (sort (mapcar (lambda (thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3663 (cons (car thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3664 (and (cdr thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3665 (gnus-sort-threads-1 (cdr thread) func)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3666 threads) func)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3667 |
17493 | 3668 (defun gnus-sort-threads (threads) |
3669 "Sort THREADS." | |
3670 (if (not gnus-thread-sort-functions) | |
3671 threads | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3672 (gnus-message 8 "Sorting threads...") |
17493 | 3673 (prog1 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3674 (gnus-sort-threads-1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3675 threads |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3676 (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
|
3677 (gnus-message 8 "Sorting threads...done")))) |
17493 | 3678 |
3679 (defun gnus-sort-articles (articles) | |
3680 "Sort ARTICLES." | |
3681 (when gnus-article-sort-functions | |
3682 (gnus-message 7 "Sorting articles...") | |
3683 (prog1 | |
3684 (setq gnus-newsgroup-headers | |
3685 (sort articles (gnus-make-sort-function | |
3686 gnus-article-sort-functions))) | |
3687 (gnus-message 7 "Sorting articles...done")))) | |
3688 | |
3689 ;; Written by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>. | |
3690 (defmacro gnus-thread-header (thread) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3691 "Return header of first article in THREAD. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3692 Note that THREAD must never, ever be anything else than a variable - |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3693 using some other form will lead to serious barfage." |
17493 | 3694 (or (symbolp thread) (signal 'wrong-type-argument '(symbolp thread))) |
3695 ;; (8% speedup to gnus-summary-prepare, just for fun :-) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3696 (list 'byte-code "\10\211:\203\17\0\211@;\203\16\0A@@\207" |
17493 | 3697 (vector thread) 2)) |
3698 | |
3699 (defsubst gnus-article-sort-by-number (h1 h2) | |
3700 "Sort articles by article number." | |
3701 (< (mail-header-number h1) | |
3702 (mail-header-number h2))) | |
3703 | |
3704 (defun gnus-thread-sort-by-number (h1 h2) | |
3705 "Sort threads by root article number." | |
3706 (gnus-article-sort-by-number | |
3707 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3708 | |
3709 (defsubst gnus-article-sort-by-lines (h1 h2) | |
3710 "Sort articles by article Lines header." | |
3711 (< (mail-header-lines h1) | |
3712 (mail-header-lines h2))) | |
3713 | |
3714 (defun gnus-thread-sort-by-lines (h1 h2) | |
3715 "Sort threads by root article Lines header." | |
3716 (gnus-article-sort-by-lines | |
3717 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3718 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3719 (defsubst gnus-article-sort-by-chars (h1 h2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3720 "Sort articles by octet length." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3721 (< (mail-header-chars h1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3722 (mail-header-chars h2))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3723 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3724 (defun gnus-thread-sort-by-chars (h1 h2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3725 "Sort threads by root article octet length." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3726 (gnus-article-sort-by-chars |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3727 (gnus-thread-header h1) (gnus-thread-header h2))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3728 |
17493 | 3729 (defsubst gnus-article-sort-by-author (h1 h2) |
3730 "Sort articles by root author." | |
3731 (string-lessp | |
3732 (let ((extract (funcall | |
3733 gnus-extract-address-components | |
3734 (mail-header-from h1)))) | |
3735 (or (car extract) (cadr extract) "")) | |
3736 (let ((extract (funcall | |
3737 gnus-extract-address-components | |
3738 (mail-header-from h2)))) | |
3739 (or (car extract) (cadr extract) "")))) | |
3740 | |
3741 (defun gnus-thread-sort-by-author (h1 h2) | |
3742 "Sort threads by root author." | |
3743 (gnus-article-sort-by-author | |
3744 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3745 | |
3746 (defsubst gnus-article-sort-by-subject (h1 h2) | |
3747 "Sort articles by root subject." | |
3748 (string-lessp | |
3749 (downcase (gnus-simplify-subject-re (mail-header-subject h1))) | |
3750 (downcase (gnus-simplify-subject-re (mail-header-subject h2))))) | |
3751 | |
3752 (defun gnus-thread-sort-by-subject (h1 h2) | |
3753 "Sort threads by root subject." | |
3754 (gnus-article-sort-by-subject | |
3755 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3756 | |
3757 (defsubst gnus-article-sort-by-date (h1 h2) | |
3758 "Sort articles by root article date." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3759 (time-less-p |
17493 | 3760 (gnus-date-get-time (mail-header-date h1)) |
3761 (gnus-date-get-time (mail-header-date h2)))) | |
3762 | |
3763 (defun gnus-thread-sort-by-date (h1 h2) | |
3764 "Sort threads by root article date." | |
3765 (gnus-article-sort-by-date | |
3766 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3767 | |
3768 (defsubst gnus-article-sort-by-score (h1 h2) | |
3769 "Sort articles by root article score. | |
3770 Unscored articles will be counted as having a score of zero." | |
3771 (> (or (cdr (assq (mail-header-number h1) | |
3772 gnus-newsgroup-scored)) | |
3773 gnus-summary-default-score 0) | |
3774 (or (cdr (assq (mail-header-number h2) | |
3775 gnus-newsgroup-scored)) | |
3776 gnus-summary-default-score 0))) | |
3777 | |
3778 (defun gnus-thread-sort-by-score (h1 h2) | |
3779 "Sort threads by root article score." | |
3780 (gnus-article-sort-by-score | |
3781 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3782 | |
3783 (defun gnus-thread-sort-by-total-score (h1 h2) | |
3784 "Sort threads by the sum of all scores in the thread. | |
3785 Unscored articles will be counted as having a score of zero." | |
3786 (> (gnus-thread-total-score h1) (gnus-thread-total-score h2))) | |
3787 | |
3788 (defun gnus-thread-total-score (thread) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3789 ;; This function find the total score of THREAD. |
17493 | 3790 (cond ((null thread) |
3791 0) | |
3792 ((consp thread) | |
3793 (if (stringp (car thread)) | |
3794 (apply gnus-thread-score-function 0 | |
3795 (mapcar 'gnus-thread-total-score-1 (cdr thread))) | |
3796 (gnus-thread-total-score-1 thread))) | |
3797 (t | |
3798 (gnus-thread-total-score-1 (list thread))))) | |
3799 | |
3800 (defun gnus-thread-total-score-1 (root) | |
3801 ;; This function find the total score of the thread below ROOT. | |
3802 (setq root (car root)) | |
3803 (apply gnus-thread-score-function | |
3804 (or (append | |
3805 (mapcar 'gnus-thread-total-score | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3806 (cdr (gnus-id-to-thread (mail-header-id root)))) |
17493 | 3807 (when (> (mail-header-number root) 0) |
3808 (list (or (cdr (assq (mail-header-number root) | |
3809 gnus-newsgroup-scored)) | |
3810 gnus-summary-default-score 0)))) | |
3811 (list gnus-summary-default-score) | |
3812 '(0)))) | |
3813 | |
3814 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>. | |
3815 (defvar gnus-tmp-prev-subject nil) | |
3816 (defvar gnus-tmp-false-parent nil) | |
3817 (defvar gnus-tmp-root-expunged nil) | |
3818 (defvar gnus-tmp-dummy-line nil) | |
3819 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3820 (defvar gnus-tmp-header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3821 (defun gnus-extra-header (type &optional header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3822 "Return the extra header of TYPE." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3823 (or (cdr (assq type (mail-header-extra (or header gnus-tmp-header)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3824 "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3825 |
17493 | 3826 (defun gnus-summary-prepare-threads (threads) |
3827 "Prepare summary buffer from THREADS and indentation LEVEL. | |
3828 THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])' | |
3829 or a straight list of headers." | |
3830 (gnus-message 7 "Generating summary...") | |
3831 | |
3832 (setq gnus-newsgroup-threads threads) | |
3833 (beginning-of-line) | |
3834 | |
3835 (let ((gnus-tmp-level 0) | |
3836 (default-score (or gnus-summary-default-score 0)) | |
3837 (gnus-visual-p (gnus-visual-p 'summary-highlight 'highlight)) | |
3838 thread number subject stack state gnus-tmp-gathered beg-match | |
3839 new-roots gnus-tmp-new-adopts thread-end | |
3840 gnus-tmp-header gnus-tmp-unread | |
3841 gnus-tmp-replied gnus-tmp-subject-or-nil | |
3842 gnus-tmp-dummy gnus-tmp-indentation gnus-tmp-lines gnus-tmp-score | |
3843 gnus-tmp-score-char gnus-tmp-from gnus-tmp-name | |
3844 gnus-tmp-number gnus-tmp-opening-bracket gnus-tmp-closing-bracket) | |
3845 | |
3846 (setq gnus-tmp-prev-subject nil) | |
3847 | |
3848 (if (vectorp (car threads)) | |
3849 ;; If this is a straight (sic) list of headers, then a | |
3850 ;; threaded summary display isn't required, so we just create | |
3851 ;; an unthreaded one. | |
3852 (gnus-summary-prepare-unthreaded threads) | |
3853 | |
3854 ;; Do the threaded display. | |
3855 | |
3856 (while (or threads stack gnus-tmp-new-adopts new-roots) | |
3857 | |
3858 (if (and (= gnus-tmp-level 0) | |
3859 (or (not stack) | |
3860 (= (caar stack) 0)) | |
3861 (not gnus-tmp-false-parent) | |
3862 (or gnus-tmp-new-adopts new-roots)) | |
3863 (if gnus-tmp-new-adopts | |
3864 (setq gnus-tmp-level (if gnus-tmp-root-expunged 0 1) | |
3865 thread (list (car gnus-tmp-new-adopts)) | |
3866 gnus-tmp-header (caar thread) | |
3867 gnus-tmp-new-adopts (cdr gnus-tmp-new-adopts)) | |
3868 (when new-roots | |
3869 (setq thread (list (car new-roots)) | |
3870 gnus-tmp-header (caar thread) | |
3871 new-roots (cdr new-roots)))) | |
3872 | |
3873 (if threads | |
3874 ;; If there are some threads, we do them before the | |
3875 ;; threads on the stack. | |
3876 (setq thread threads | |
3877 gnus-tmp-header (caar thread)) | |
3878 ;; There were no current threads, so we pop something off | |
3879 ;; the stack. | |
3880 (setq state (car stack) | |
3881 gnus-tmp-level (car state) | |
3882 thread (cdr state) | |
3883 stack (cdr stack) | |
3884 gnus-tmp-header (caar thread)))) | |
3885 | |
3886 (setq gnus-tmp-false-parent nil) | |
3887 (setq gnus-tmp-root-expunged nil) | |
3888 (setq thread-end nil) | |
3889 | |
3890 (if (stringp gnus-tmp-header) | |
3891 ;; The header is a dummy root. | |
3892 (cond | |
3893 ((eq gnus-summary-make-false-root 'adopt) | |
3894 ;; We let the first article adopt the rest. | |
3895 (setq gnus-tmp-new-adopts (nconc gnus-tmp-new-adopts | |
3896 (cddar thread))) | |
3897 (setq gnus-tmp-gathered | |
3898 (nconc (mapcar | |
3899 (lambda (h) (mail-header-number (car h))) | |
3900 (cddar thread)) | |
3901 gnus-tmp-gathered)) | |
3902 (setq thread (cons (list (caar thread) | |
3903 (cadar thread)) | |
3904 (cdr thread))) | |
3905 (setq gnus-tmp-level -1 | |
3906 gnus-tmp-false-parent t)) | |
3907 ((eq gnus-summary-make-false-root 'empty) | |
3908 ;; We print adopted articles with empty subject fields. | |
3909 (setq gnus-tmp-gathered | |
3910 (nconc (mapcar | |
3911 (lambda (h) (mail-header-number (car h))) | |
3912 (cddar thread)) | |
3913 gnus-tmp-gathered)) | |
3914 (setq gnus-tmp-level -1)) | |
3915 ((eq gnus-summary-make-false-root 'dummy) | |
3916 ;; We remember that we probably want to output a dummy | |
3917 ;; root. | |
3918 (setq gnus-tmp-dummy-line gnus-tmp-header) | |
3919 (setq gnus-tmp-prev-subject gnus-tmp-header)) | |
3920 (t | |
3921 ;; We do not make a root for the gathered | |
3922 ;; sub-threads at all. | |
3923 (setq gnus-tmp-level -1))) | |
3924 | |
3925 (setq number (mail-header-number gnus-tmp-header) | |
3926 subject (mail-header-subject gnus-tmp-header)) | |
3927 | |
3928 (cond | |
3929 ;; If the thread has changed subject, we might want to make | |
3930 ;; this subthread into a root. | |
3931 ((and (null gnus-thread-ignore-subject) | |
3932 (not (zerop gnus-tmp-level)) | |
3933 gnus-tmp-prev-subject | |
3934 (not (inline | |
3935 (gnus-subject-equal gnus-tmp-prev-subject subject)))) | |
3936 (setq new-roots (nconc new-roots (list (car thread))) | |
3937 thread-end t | |
3938 gnus-tmp-header nil)) | |
3939 ;; If the article lies outside the current limit, | |
3940 ;; then we do not display it. | |
3941 ((not (memq number gnus-newsgroup-limit)) | |
3942 (setq gnus-tmp-gathered | |
3943 (nconc (mapcar | |
3944 (lambda (h) (mail-header-number (car h))) | |
3945 (cdar thread)) | |
3946 gnus-tmp-gathered)) | |
3947 (setq gnus-tmp-new-adopts (if (cdar thread) | |
3948 (append gnus-tmp-new-adopts | |
3949 (cdar thread)) | |
3950 gnus-tmp-new-adopts) | |
3951 thread-end t | |
3952 gnus-tmp-header nil) | |
3953 (when (zerop gnus-tmp-level) | |
3954 (setq gnus-tmp-root-expunged t))) | |
3955 ;; Perhaps this article is to be marked as read? | |
3956 ((and gnus-summary-mark-below | |
3957 (< (or (cdr (assq number gnus-newsgroup-scored)) | |
3958 default-score) | |
3959 gnus-summary-mark-below) | |
3960 ;; Don't touch sparse articles. | |
3961 (not (gnus-summary-article-sparse-p number)) | |
3962 (not (gnus-summary-article-ancient-p number))) | |
3963 (setq gnus-newsgroup-unreads | |
3964 (delq number gnus-newsgroup-unreads)) | |
3965 (if gnus-newsgroup-auto-expire | |
3966 (push number gnus-newsgroup-expirable) | |
3967 (push (cons number gnus-low-score-mark) | |
3968 gnus-newsgroup-reads)))) | |
3969 | |
3970 (when gnus-tmp-header | |
3971 ;; We may have an old dummy line to output before this | |
3972 ;; article. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3973 (when (and gnus-tmp-dummy-line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3974 (gnus-subject-equal |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3975 gnus-tmp-dummy-line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3976 (mail-header-subject gnus-tmp-header))) |
17493 | 3977 (gnus-summary-insert-dummy-line |
3978 gnus-tmp-dummy-line (mail-header-number gnus-tmp-header)) | |
3979 (setq gnus-tmp-dummy-line nil)) | |
3980 | |
3981 ;; Compute the mark. | |
3982 (setq gnus-tmp-unread (gnus-article-mark number)) | |
3983 | |
3984 (push (gnus-data-make number gnus-tmp-unread (1+ (point)) | |
3985 gnus-tmp-header gnus-tmp-level) | |
3986 gnus-newsgroup-data) | |
3987 | |
3988 ;; Actually insert the line. | |
3989 (setq | |
3990 gnus-tmp-subject-or-nil | |
3991 (cond | |
3992 ((and gnus-thread-ignore-subject | |
3993 gnus-tmp-prev-subject | |
3994 (not (inline (gnus-subject-equal | |
3995 gnus-tmp-prev-subject subject)))) | |
3996 subject) | |
3997 ((zerop gnus-tmp-level) | |
3998 (if (and (eq gnus-summary-make-false-root 'empty) | |
3999 (memq number gnus-tmp-gathered) | |
4000 gnus-tmp-prev-subject | |
4001 (inline (gnus-subject-equal | |
4002 gnus-tmp-prev-subject subject))) | |
4003 gnus-summary-same-subject | |
4004 subject)) | |
4005 (t gnus-summary-same-subject))) | |
4006 (if (and (eq gnus-summary-make-false-root 'adopt) | |
4007 (= gnus-tmp-level 1) | |
4008 (memq number gnus-tmp-gathered)) | |
4009 (setq gnus-tmp-opening-bracket ?\< | |
4010 gnus-tmp-closing-bracket ?\>) | |
4011 (setq gnus-tmp-opening-bracket ?\[ | |
4012 gnus-tmp-closing-bracket ?\])) | |
4013 (setq | |
4014 gnus-tmp-indentation | |
4015 (aref gnus-thread-indent-array gnus-tmp-level) | |
4016 gnus-tmp-lines (mail-header-lines gnus-tmp-header) | |
4017 gnus-tmp-score (or (cdr (assq number gnus-newsgroup-scored)) | |
4018 gnus-summary-default-score 0) | |
4019 gnus-tmp-score-char | |
4020 (if (or (null gnus-summary-default-score) | |
4021 (<= (abs (- gnus-tmp-score gnus-summary-default-score)) | |
4022 gnus-summary-zcore-fuzz)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4023 ? ;Whitespace |
17493 | 4024 (if (< gnus-tmp-score gnus-summary-default-score) |
4025 gnus-score-below-mark gnus-score-over-mark)) | |
4026 gnus-tmp-replied | |
4027 (cond ((memq number gnus-newsgroup-processable) | |
4028 gnus-process-mark) | |
4029 ((memq number gnus-newsgroup-cached) | |
4030 gnus-cached-mark) | |
4031 ((memq number gnus-newsgroup-replied) | |
4032 gnus-replied-mark) | |
4033 ((memq number gnus-newsgroup-saved) | |
4034 gnus-saved-mark) | |
4035 (t gnus-unread-mark)) | |
4036 gnus-tmp-from (mail-header-from gnus-tmp-header) | |
4037 gnus-tmp-name | |
4038 (cond | |
4039 ((string-match "<[^>]+> *$" gnus-tmp-from) | |
4040 (setq beg-match (match-beginning 0)) | |
4041 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from) | |
4042 (substring gnus-tmp-from (1+ (match-beginning 0)) | |
4043 (1- (match-end 0)))) | |
4044 (substring gnus-tmp-from 0 beg-match))) | |
4045 ((string-match "(.+)" gnus-tmp-from) | |
4046 (substring gnus-tmp-from | |
4047 (1+ (match-beginning 0)) (1- (match-end 0)))) | |
4048 (t gnus-tmp-from))) | |
4049 (when (string= gnus-tmp-name "") | |
4050 (setq gnus-tmp-name gnus-tmp-from)) | |
4051 (unless (numberp gnus-tmp-lines) | |
4052 (setq gnus-tmp-lines 0)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4053 (gnus-put-text-property |
17493 | 4054 (point) |
4055 (progn (eval gnus-summary-line-format-spec) (point)) | |
4056 'gnus-number number) | |
4057 (when gnus-visual-p | |
4058 (forward-line -1) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4059 (gnus-run-hooks 'gnus-summary-update-hook) |
17493 | 4060 (forward-line 1)) |
4061 | |
4062 (setq gnus-tmp-prev-subject subject))) | |
4063 | |
4064 (when (nth 1 thread) | |
4065 (push (cons (max 0 gnus-tmp-level) (nthcdr 1 thread)) stack)) | |
4066 (incf gnus-tmp-level) | |
4067 (setq threads (if thread-end nil (cdar thread))) | |
4068 (unless threads | |
4069 (setq gnus-tmp-level 0))))) | |
4070 (gnus-message 7 "Generating summary...done")) | |
4071 | |
4072 (defun gnus-summary-prepare-unthreaded (headers) | |
4073 "Generate an unthreaded summary buffer based on HEADERS." | |
4074 (let (header number mark) | |
4075 | |
4076 (beginning-of-line) | |
4077 | |
4078 (while headers | |
4079 ;; We may have to root out some bad articles... | |
4080 (when (memq (setq number (mail-header-number | |
4081 (setq header (pop headers)))) | |
4082 gnus-newsgroup-limit) | |
4083 ;; Mark article as read when it has a low score. | |
4084 (when (and gnus-summary-mark-below | |
4085 (< (or (cdr (assq number gnus-newsgroup-scored)) | |
4086 gnus-summary-default-score 0) | |
4087 gnus-summary-mark-below) | |
4088 (not (gnus-summary-article-ancient-p number))) | |
4089 (setq gnus-newsgroup-unreads | |
4090 (delq number gnus-newsgroup-unreads)) | |
4091 (if gnus-newsgroup-auto-expire | |
4092 (push number gnus-newsgroup-expirable) | |
4093 (push (cons number gnus-low-score-mark) | |
4094 gnus-newsgroup-reads))) | |
4095 | |
4096 (setq mark (gnus-article-mark number)) | |
4097 (push (gnus-data-make number mark (1+ (point)) header 0) | |
4098 gnus-newsgroup-data) | |
4099 (gnus-summary-insert-line | |
4100 header 0 number | |
4101 mark (memq number gnus-newsgroup-replied) | |
4102 (memq number gnus-newsgroup-expirable) | |
4103 (mail-header-subject header) nil | |
4104 (cdr (assq number gnus-newsgroup-scored)) | |
4105 (memq number gnus-newsgroup-processable)))))) | |
4106 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4107 (defun gnus-summary-remove-list-identifiers () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4108 "Remove list identifiers in `gnus-list-identifiers' from articles in the current group." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4109 (let ((regexp (if (stringp gnus-list-identifiers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4110 gnus-list-identifiers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4111 (mapconcat 'identity gnus-list-identifiers " *\\|")))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4112 (dolist (header gnus-newsgroup-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4113 (when (string-match (concat "\\(\\(\\(Re: +\\)?\\(" regexp |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4114 " *\\)\\)+\\(Re: +\\)?\\)") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4115 (mail-header-subject header)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4116 (mail-header-set-subject |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4117 header (concat (substring (mail-header-subject header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4118 0 (match-beginning 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4119 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4120 (match-string 3 (mail-header-subject header)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4121 (match-string 5 (mail-header-subject header))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4122 (substring (mail-header-subject header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4123 (match-end 1)))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4124 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4125 (defun gnus-select-newsgroup (group &optional read-all select-articles) |
17493 | 4126 "Select newsgroup GROUP. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4127 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
|
4128 If SELECT-ARTICLES, only select those articles from GROUP." |
17493 | 4129 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb)) |
4130 ;;!!! Dirty hack; should be removed. | |
4131 (gnus-summary-ignore-duplicates | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4132 (if (eq (car (gnus-find-method-for-group group)) 'nnvirtual) |
17493 | 4133 t |
4134 gnus-summary-ignore-duplicates)) | |
4135 (info (nth 2 entry)) | |
4136 articles fetched-articles cached) | |
4137 | |
4138 (unless (gnus-check-server | |
4139 (setq gnus-current-select-method | |
4140 (gnus-find-method-for-group group))) | |
4141 (error "Couldn't open server")) | |
4142 | |
4143 (or (and entry (not (eq (car entry) t))) ; Either it's active... | |
4144 (gnus-activate-group group) ; Or we can activate it... | |
4145 (progn ; Or we bug out. | |
4146 (when (equal major-mode 'gnus-summary-mode) | |
4147 (kill-buffer (current-buffer))) | |
4148 (error "Couldn't request group %s: %s" | |
4149 group (gnus-status-message group)))) | |
4150 | |
4151 (unless (gnus-request-group group t) | |
4152 (when (equal major-mode 'gnus-summary-mode) | |
4153 (kill-buffer (current-buffer))) | |
4154 (error "Couldn't request group %s: %s" | |
4155 group (gnus-status-message group))) | |
4156 | |
4157 (setq gnus-newsgroup-name group) | |
4158 (setq gnus-newsgroup-unselected nil) | |
4159 (setq gnus-newsgroup-unreads (gnus-list-of-unread-articles group)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4160 (gnus-summary-setup-default-charset) |
17493 | 4161 |
4162 ;; Adjust and set lists of article marks. | |
4163 (when info | |
4164 (gnus-adjust-marked-articles info)) | |
4165 | |
4166 ;; Kludge to avoid having cached articles nixed out in virtual groups. | |
4167 (when (gnus-virtual-group-p group) | |
4168 (setq cached gnus-newsgroup-cached)) | |
4169 | |
4170 (setq gnus-newsgroup-unreads | |
4171 (gnus-set-difference | |
4172 (gnus-set-difference gnus-newsgroup-unreads gnus-newsgroup-marked) | |
4173 gnus-newsgroup-dormant)) | |
4174 | |
4175 (setq gnus-newsgroup-processable nil) | |
4176 | |
4177 (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
|
4178 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4179 (if (setq articles select-articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4180 (setq gnus-newsgroup-unselected |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4181 (gnus-sorted-intersection |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4182 gnus-newsgroup-unreads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4183 (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
|
4184 (setq articles (gnus-articles-to-read group read-all))) |
17493 | 4185 |
4186 (cond | |
4187 ((null articles) | |
4188 ;;(gnus-message 3 "Couldn't select newsgroup -- no articles to display") | |
4189 'quit) | |
4190 ((eq articles 0) nil) | |
4191 (t | |
4192 ;; Init the dependencies hash table. | |
4193 (setq gnus-newsgroup-dependencies | |
4194 (gnus-make-hashtable (length articles))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4195 (gnus-set-global-variables) |
17493 | 4196 ;; Retrieve the headers and read them in. |
4197 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name) | |
4198 (setq gnus-newsgroup-headers | |
4199 (if (eq 'nov | |
4200 (setq gnus-headers-retrieved-by | |
4201 (gnus-retrieve-headers | |
4202 articles gnus-newsgroup-name | |
4203 ;; We might want to fetch old headers, but | |
4204 ;; 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
|
4205 (and (or (and |
17493 | 4206 (not (eq gnus-fetch-old-headers 'some)) |
4207 (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
|
4208 (> (length articles) 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4209 gnus-fetch-old-headers)))) |
17493 | 4210 (gnus-get-newsgroup-headers-xover |
4211 articles nil nil gnus-newsgroup-name t) | |
4212 (gnus-get-newsgroup-headers))) | |
4213 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name) | |
4214 | |
4215 ;; Kludge to avoid having cached articles nixed out in virtual groups. | |
4216 (when cached | |
4217 (setq gnus-newsgroup-cached cached)) | |
4218 | |
4219 ;; Suppress duplicates? | |
4220 (when gnus-suppress-duplicates | |
4221 (gnus-dup-suppress-articles)) | |
4222 | |
4223 ;; Set the initial limit. | |
4224 (setq gnus-newsgroup-limit (copy-sequence articles)) | |
4225 ;; Remove canceled articles from the list of unread articles. | |
4226 (setq gnus-newsgroup-unreads | |
4227 (gnus-set-sorted-intersection | |
4228 gnus-newsgroup-unreads | |
4229 (setq fetched-articles | |
4230 (mapcar (lambda (headers) (mail-header-number headers)) | |
4231 gnus-newsgroup-headers)))) | |
4232 ;; Removed marked articles that do not exist. | |
4233 (gnus-update-missing-marks | |
4234 (gnus-sorted-complement fetched-articles articles)) | |
4235 ;; 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
|
4236 (when (and gnus-fetch-old-headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4237 (eq gnus-headers-retrieved-by 'nov)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4238 (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
|
4239 (gnus-build-all-threads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4240 (gnus-build-old-threads))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4241 ;; 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
|
4242 (when gnus-agent |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4243 (gnus-agent-get-undownloaded-list)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4244 ;; Remove list identifiers from subject |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4245 (when gnus-list-identifiers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4246 (gnus-summary-remove-list-identifiers)) |
17493 | 4247 ;; Check whether auto-expire is to be done in this group. |
4248 (setq gnus-newsgroup-auto-expire | |
4249 (gnus-group-auto-expirable-p group)) | |
4250 ;; Set up the article buffer now, if necessary. | |
4251 (unless gnus-single-article-buffer | |
4252 (gnus-article-setup-buffer)) | |
4253 ;; First and last article in this newsgroup. | |
4254 (when gnus-newsgroup-headers | |
4255 (setq gnus-newsgroup-begin | |
4256 (mail-header-number (car gnus-newsgroup-headers)) | |
4257 gnus-newsgroup-end | |
4258 (mail-header-number | |
4259 (gnus-last-element gnus-newsgroup-headers)))) | |
4260 ;; GROUP is successfully selected. | |
4261 (or gnus-newsgroup-headers t))))) | |
4262 | |
4263 (defun gnus-articles-to-read (group &optional read-all) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4264 "Find out what articles the user wants to read." |
17493 | 4265 (let* ((articles |
4266 ;; Select all articles if `read-all' is non-nil, or if there | |
4267 ;; are no unread articles. | |
4268 (if (or read-all | |
4269 (and (zerop (length gnus-newsgroup-marked)) | |
4270 (zerop (length gnus-newsgroup-unreads))) | |
4271 (eq (gnus-group-find-parameter group 'display) | |
4272 'all)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4273 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4274 (gnus-uncompress-range (gnus-active group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4275 (gnus-cache-articles-in-group group)) |
17493 | 4276 (sort (append gnus-newsgroup-dormant gnus-newsgroup-marked |
4277 (copy-sequence gnus-newsgroup-unreads)) | |
4278 '<))) | |
4279 (scored-list (gnus-killed-articles gnus-newsgroup-killed articles)) | |
4280 (scored (length scored-list)) | |
4281 (number (length articles)) | |
4282 (marked (+ (length gnus-newsgroup-marked) | |
4283 (length gnus-newsgroup-dormant))) | |
4284 (select | |
4285 (cond | |
4286 ((numberp read-all) | |
4287 read-all) | |
4288 (t | |
4289 (condition-case () | |
4290 (cond | |
4291 ((and (or (<= scored marked) (= scored number)) | |
4292 (numberp gnus-large-newsgroup) | |
4293 (> number gnus-large-newsgroup)) | |
4294 (let ((input | |
4295 (read-string | |
4296 (format | |
4297 "How many articles from %s (default %d): " | |
4298 (gnus-limit-string gnus-newsgroup-name 35) | |
4299 number)))) | |
4300 (if (string-match "^[ \t]*$" input) number input))) | |
4301 ((and (> scored marked) (< scored number) | |
4302 (> (- scored number) 20)) | |
4303 (let ((input | |
4304 (read-string | |
4305 (format "%s %s (%d scored, %d total): " | |
4306 "How many articles from" | |
4307 group scored number)))) | |
4308 (if (string-match "^[ \t]*$" input) | |
4309 number input))) | |
4310 (t number)) | |
32975
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
4311 (quit |
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
4312 (message "Quit getting the articles to read") |
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
4313 nil)))))) |
17493 | 4314 (setq select (if (stringp select) (string-to-number select) select)) |
4315 (if (or (null select) (zerop select)) | |
4316 select | |
4317 (if (and (not (zerop scored)) (<= (abs select) scored)) | |
4318 (progn | |
4319 (setq articles (sort scored-list '<)) | |
4320 (setq number (length articles))) | |
4321 (setq articles (copy-sequence articles))) | |
4322 | |
4323 (when (< (abs select) number) | |
4324 (if (< select 0) | |
4325 ;; Select the N oldest articles. | |
4326 (setcdr (nthcdr (1- (abs select)) articles) nil) | |
4327 ;; Select the N most recent articles. | |
4328 (setq articles (nthcdr (- number select) articles)))) | |
4329 (setq gnus-newsgroup-unselected | |
4330 (gnus-sorted-intersection | |
4331 gnus-newsgroup-unreads | |
4332 (gnus-sorted-complement gnus-newsgroup-unreads articles))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4333 (when gnus-alter-articles-to-read-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4334 (setq gnus-newsgroup-unreads |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4335 (sort |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4336 (funcall gnus-alter-articles-to-read-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4337 gnus-newsgroup-name gnus-newsgroup-unreads) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4338 '<))) |
17493 | 4339 articles))) |
4340 | |
4341 (defun gnus-killed-articles (killed articles) | |
4342 (let (out) | |
4343 (while articles | |
4344 (when (inline (gnus-member-of-range (car articles) killed)) | |
4345 (push (car articles) out)) | |
4346 (setq articles (cdr articles))) | |
4347 out)) | |
4348 | |
4349 (defun gnus-uncompress-marks (marks) | |
4350 "Uncompress the mark ranges in MARKS." | |
4351 (let ((uncompressed '(score bookmark)) | |
4352 out) | |
4353 (while marks | |
4354 (if (memq (caar marks) uncompressed) | |
4355 (push (car marks) out) | |
4356 (push (cons (caar marks) (gnus-uncompress-range (cdar marks))) out)) | |
4357 (setq marks (cdr marks))) | |
4358 out)) | |
4359 | |
4360 (defun gnus-adjust-marked-articles (info) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4361 "Set all article lists and remove all marks that are no longer valid." |
17493 | 4362 (let* ((marked-lists (gnus-info-marks info)) |
4363 (active (gnus-active (gnus-info-group info))) | |
4364 (min (car active)) | |
4365 (max (cdr active)) | |
4366 (types gnus-article-mark-lists) | |
4367 (uncompressed '(score bookmark killed)) | |
4368 marks var articles article mark) | |
4369 | |
4370 (while marked-lists | |
4371 (setq marks (pop marked-lists)) | |
4372 (set (setq var (intern (format "gnus-newsgroup-%s" | |
4373 (car (rassq (setq mark (car marks)) | |
4374 types))))) | |
4375 (if (memq (car marks) uncompressed) (cdr marks) | |
4376 (gnus-uncompress-range (cdr marks)))) | |
4377 | |
4378 (setq articles (symbol-value var)) | |
4379 | |
4380 ;; All articles have to be subsets of the active articles. | |
4381 (cond | |
4382 ;; Adjust "simple" lists. | |
4383 ((memq mark '(tick dormant expire reply save)) | |
4384 (while articles | |
4385 (when (or (< (setq article (pop articles)) min) (> article max)) | |
4386 (set var (delq article (symbol-value var)))))) | |
4387 ;; Adjust assocs. | |
4388 ((memq mark uncompressed) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4389 (when (not (listp (cdr (symbol-value var)))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4390 (set var (list (symbol-value var)))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4391 (when (not (listp (cdr articles))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4392 (setq articles (list articles))) |
17493 | 4393 (while articles |
4394 (when (or (not (consp (setq article (pop articles)))) | |
4395 (< (car article) min) | |
4396 (> (car article) max)) | |
4397 (set var (delq article (symbol-value var)))))))))) | |
4398 | |
4399 (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
|
4400 "Go through the list of MISSING articles and remove them from the mark lists." |
17493 | 4401 (when missing |
4402 (let ((types gnus-article-mark-lists) | |
4403 var m) | |
4404 ;; Go through all types. | |
4405 (while types | |
4406 (setq var (intern (format "gnus-newsgroup-%s" (car (pop types))))) | |
4407 (when (symbol-value var) | |
4408 ;; This list has articles. So we delete all missing articles | |
4409 ;; from it. | |
4410 (setq m missing) | |
4411 (while m | |
4412 (set var (delq (pop m) (symbol-value var))))))))) | |
4413 | |
4414 (defun gnus-update-marks () | |
4415 "Enter the various lists of marked articles into the newsgroup info list." | |
4416 (let ((types gnus-article-mark-lists) | |
4417 (info (gnus-get-info gnus-newsgroup-name)) | |
4418 (uncompressed '(score bookmark killed)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4419 type list newmarked symbol delta-marks) |
17493 | 4420 (when info |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4421 ;; Add all marks lists to the list of marks lists. |
17493 | 4422 (while (setq type (pop types)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4423 (setq list (symbol-value |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4424 (setq symbol |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4425 (intern (format "gnus-newsgroup-%s" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4426 (car type)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4427 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4428 (when list |
17493 | 4429 ;; Get rid of the entries of the articles that have the |
4430 ;; default score. | |
4431 (when (and (eq (cdr type) 'score) | |
4432 gnus-save-score | |
4433 list) | |
4434 (let* ((arts list) | |
4435 (prev (cons nil list)) | |
4436 (all prev)) | |
4437 (while arts | |
4438 (if (or (not (consp (car arts))) | |
4439 (= (cdar arts) gnus-summary-default-score)) | |
4440 (setcdr prev (cdr arts)) | |
4441 (setq prev arts)) | |
4442 (setq arts (cdr arts))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4443 (setq list (cdr all))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4444 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4445 (unless (memq (cdr type) uncompressed) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4446 (setq list (gnus-compress-sequence (set symbol (sort list '<)) t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4447 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4448 (when (gnus-check-backend-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4449 'request-set-mark gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4450 ;; propagate flags to server, with the following exceptions: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4451 ;; uncompressed:s are not proper flags (they are cons cells) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4452 ;; cache is a internal gnus flag |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4453 ;; download are local to one gnus installation (well) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4454 ;; unsend are for nndraft groups only |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4455 ;; xxx: generality of this? this suits nnimap anyway |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4456 (unless (memq (cdr type) (append '(cache download unsend) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4457 uncompressed)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4458 (let* ((old (cdr (assq (cdr type) (gnus-info-marks info)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4459 (del (gnus-remove-from-range (gnus-copy-sequence old) list)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4460 (add (gnus-remove-from-range |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4461 (gnus-copy-sequence list) old))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4462 (when add |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4463 (push (list add 'add (list (cdr type))) delta-marks)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4464 (when del |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4465 (push (list del 'del (list (cdr type))) delta-marks))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4466 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4467 (when list |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4468 (push (cons (cdr type) list) newmarked))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4469 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4470 (when delta-marks |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4471 (unless (gnus-check-group gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4472 (error "Can't open server for %s" gnus-newsgroup-name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4473 (gnus-request-set-mark gnus-newsgroup-name delta-marks)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4474 |
17493 | 4475 ;; Enter these new marks into the info of the group. |
4476 (if (nthcdr 3 info) | |
4477 (setcar (nthcdr 3 info) newmarked) | |
4478 ;; Add the marks lists to the end of the info. | |
4479 (when newmarked | |
4480 (setcdr (nthcdr 2 info) (list newmarked)))) | |
4481 | |
4482 ;; Cut off the end of the info if there's nothing else there. | |
4483 (let ((i 5)) | |
4484 (while (and (> i 2) | |
4485 (not (nth i info))) | |
4486 (when (nthcdr (decf i) info) | |
4487 (setcdr (nthcdr i info) nil))))))) | |
4488 | |
4489 (defun gnus-set-mode-line (where) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4490 "Set the mode line of the article or summary buffers. |
17493 | 4491 If WHERE is `summary', the summary mode line format will be used." |
4492 ;; Is this mode line one we keep updated? | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4493 (when (and (memq where gnus-updated-mode-lines) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4494 (symbol-value |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4495 (intern (format "gnus-%s-mode-line-format-spec" where)))) |
17493 | 4496 (let (mode-string) |
4497 (save-excursion | |
4498 ;; We evaluate this in the summary buffer since these | |
4499 ;; variables are buffer-local to that buffer. | |
4500 (set-buffer gnus-summary-buffer) | |
4501 ;; We bind all these variables that are used in the `eval' form | |
4502 ;; below. | |
4503 (let* ((mformat (symbol-value | |
4504 (intern | |
4505 (format "gnus-%s-mode-line-format-spec" where)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4506 (gnus-tmp-group-name (gnus-group-name-decode |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4507 gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4508 (gnus-group-name-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4509 nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4510 gnus-newsgroup-name))) |
17493 | 4511 (gnus-tmp-article-number (or gnus-current-article 0)) |
4512 (gnus-tmp-unread gnus-newsgroup-unreads) | |
4513 (gnus-tmp-unread-and-unticked (length gnus-newsgroup-unreads)) | |
4514 (gnus-tmp-unselected (length gnus-newsgroup-unselected)) | |
4515 (gnus-tmp-unread-and-unselected | |
4516 (cond ((and (zerop gnus-tmp-unread-and-unticked) | |
4517 (zerop gnus-tmp-unselected)) | |
4518 "") | |
4519 ((zerop gnus-tmp-unselected) | |
4520 (format "{%d more}" gnus-tmp-unread-and-unticked)) | |
4521 (t (format "{%d(+%d) more}" | |
4522 gnus-tmp-unread-and-unticked | |
4523 gnus-tmp-unselected)))) | |
4524 (gnus-tmp-subject | |
4525 (if (and gnus-current-headers | |
4526 (vectorp gnus-current-headers)) | |
4527 (gnus-mode-string-quote | |
4528 (mail-header-subject gnus-current-headers)) | |
4529 "")) | |
4530 bufname-length max-len | |
4531 gnus-tmp-header);; passed as argument to any user-format-funcs | |
4532 (setq mode-string (eval mformat)) | |
4533 (setq bufname-length (if (string-match "%b" mode-string) | |
4534 (- (length | |
4535 (buffer-name | |
4536 (if (eq where 'summary) | |
4537 nil | |
4538 (get-buffer gnus-article-buffer)))) | |
4539 2) | |
4540 0)) | |
4541 (setq max-len (max 4 (if gnus-mode-non-string-length | |
4542 (- (window-width) | |
4543 gnus-mode-non-string-length | |
4544 bufname-length) | |
4545 (length mode-string)))) | |
4546 ;; We might have to chop a bit of the string off... | |
4547 (when (> (length mode-string) max-len) | |
4548 (setq mode-string | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4549 (concat (truncate-string-to-width mode-string (- max-len 3)) |
17493 | 4550 "..."))) |
4551 ;; Pad the mode string a bit. | |
4552 (setq mode-string (format (format "%%-%ds" max-len) mode-string)))) | |
4553 ;; Update the mode line. | |
4554 (setq mode-line-buffer-identification | |
4555 (gnus-mode-line-buffer-identification (list mode-string))) | |
4556 (set-buffer-modified-p t)))) | |
4557 | |
4558 (defun gnus-create-xref-hashtb (from-newsgroup headers unreads) | |
4559 "Go through the HEADERS list and add all Xrefs to a hash table. | |
4560 The resulting hash table is returned, or nil if no Xrefs were found." | |
4561 (let* ((virtual (gnus-virtual-group-p from-newsgroup)) | |
4562 (prefix (if virtual "" (gnus-group-real-prefix from-newsgroup))) | |
4563 (xref-hashtb (gnus-make-hashtable)) | |
4564 start group entry number xrefs header) | |
4565 (while headers | |
4566 (setq header (pop headers)) | |
4567 (when (and (setq xrefs (mail-header-xref header)) | |
4568 (not (memq (setq number (mail-header-number header)) | |
4569 unreads))) | |
4570 (setq start 0) | |
4571 (while (string-match "\\([^ ]+\\)[:/]\\([0-9]+\\)" xrefs start) | |
4572 (setq start (match-end 0)) | |
4573 (setq group (if prefix | |
4574 (concat prefix (substring xrefs (match-beginning 1) | |
4575 (match-end 1))) | |
4576 (substring xrefs (match-beginning 1) (match-end 1)))) | |
4577 (setq number | |
4578 (string-to-int (substring xrefs (match-beginning 2) | |
4579 (match-end 2)))) | |
4580 (if (setq entry (gnus-gethash group xref-hashtb)) | |
4581 (setcdr entry (cons number (cdr entry))) | |
4582 (gnus-sethash group (cons number nil) xref-hashtb))))) | |
4583 (and start xref-hashtb))) | |
4584 | |
4585 (defun gnus-mark-xrefs-as-read (from-newsgroup headers unreads) | |
4586 "Look through all the headers and mark the Xrefs as read." | |
4587 (let ((virtual (gnus-virtual-group-p from-newsgroup)) | |
4588 name entry info xref-hashtb idlist method nth4) | |
4589 (save-excursion | |
4590 (set-buffer gnus-group-buffer) | |
4591 (when (setq xref-hashtb | |
4592 (gnus-create-xref-hashtb from-newsgroup headers unreads)) | |
4593 (mapatoms | |
4594 (lambda (group) | |
4595 (unless (string= from-newsgroup (setq name (symbol-name group))) | |
4596 (setq idlist (symbol-value group)) | |
4597 ;; Dead groups are not updated. | |
4598 (and (prog1 | |
4599 (setq entry (gnus-gethash name gnus-newsrc-hashtb) | |
4600 info (nth 2 entry)) | |
4601 (when (stringp (setq nth4 (gnus-info-method info))) | |
4602 (setq nth4 (gnus-server-to-method nth4)))) | |
4603 ;; Only do the xrefs if the group has the same | |
4604 ;; select method as the group we have just read. | |
4605 (or (gnus-methods-equal-p | |
4606 nth4 (gnus-find-method-for-group from-newsgroup)) | |
4607 virtual | |
4608 (equal nth4 (setq method (gnus-find-method-for-group | |
4609 from-newsgroup))) | |
4610 (and (equal (car nth4) (car method)) | |
4611 (equal (nth 1 nth4) (nth 1 method)))) | |
4612 gnus-use-cross-reference | |
4613 (or (not (eq gnus-use-cross-reference t)) | |
4614 virtual | |
4615 ;; Only do cross-references on subscribed | |
4616 ;; groups, if that is what is wanted. | |
4617 (<= (gnus-info-level info) gnus-level-subscribed)) | |
4618 (gnus-group-make-articles-read name idlist)))) | |
4619 xref-hashtb))))) | |
4620 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4621 (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
|
4622 (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
|
4623 (info (nth 2 entry)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4624 (active (gnus-active group)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4625 ninfo) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4626 (when entry |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4627 ;; First peel off all invalid article numbers. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4628 (when active |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4629 (let ((ids articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4630 id first) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4631 (while (setq id (pop ids)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4632 (when (and first (> id (cdr active))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4633 ;; 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
|
4634 ;; 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
|
4635 ;; 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
|
4636 ;; 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
|
4637 ;; 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
|
4638 ;; 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
|
4639 ;; 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
|
4640 ;; crossposting thingy will *increase* the number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4641 ;; 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
|
4642 (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
|
4643 (when (or (> id (cdr active)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4644 (< id (car active))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4645 (setq articles (delq id articles)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4646 ;; 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
|
4647 (if (and active |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4648 (null (gnus-info-read info)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4649 (> (car active) 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4650 (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
|
4651 (setq ninfo (gnus-info-read info))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4652 ;; 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
|
4653 (gnus-add-to-range |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4654 ninfo (setq articles (sort articles '<)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4655 |
17493 | 4656 (defun gnus-group-make-articles-read (group articles) |
4657 "Update the info of GROUP to say that ARTICLES are read." | |
4658 (let* ((num 0) | |
4659 (entry (gnus-gethash group gnus-newsrc-hashtb)) | |
4660 (info (nth 2 entry)) | |
4661 (active (gnus-active group)) | |
4662 range) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4663 (when entry |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4664 (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
|
4665 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4666 (set-buffer gnus-group-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4667 (gnus-undo-register |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4668 `(progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4669 (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
|
4670 (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
|
4671 (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
|
4672 (gnus-group-update-group ,group t)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4673 ;; 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
|
4674 (gnus-info-set-read info range) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4675 ;; 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
|
4676 ;; articles there are in this group. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4677 (when active |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4678 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4679 ((not range) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4680 (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
|
4681 ((not (listp (cdr range))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4682 (setq num (- (cdr active) (- (1+ (cdr range)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4683 (car range))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4684 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4685 (while range |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4686 (if (numberp (car range)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4687 (setq num (1+ num)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4688 (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
|
4689 (setq range (cdr range))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4690 (setq num (- (cdr active) num)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4691 ;; Update the number of unread articles. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4692 (setcar entry num) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4693 ;; Update the group buffer. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4694 (gnus-group-update-group group t))))) |
17493 | 4695 |
4696 (defvar gnus-newsgroup-none-id 0) | |
4697 | |
4698 (defun gnus-get-newsgroup-headers (&optional dependencies force-new) | |
4699 (let ((cur nntp-server-buffer) | |
4700 (dependencies | |
4701 (or dependencies | |
4702 (save-excursion (set-buffer gnus-summary-buffer) | |
4703 gnus-newsgroup-dependencies))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4704 headers id end ref |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4705 (mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4706 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4707 (save-excursion (condition-case nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4708 (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4709 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4710 gnus-newsgroup-ignored-charsets))) |
17493 | 4711 (save-excursion |
4712 (set-buffer nntp-server-buffer) | |
4713 ;; Translate all TAB characters into SPACE characters. | |
4714 (subst-char-in-region (point-min) (point-max) ?\t ? t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4715 (subst-char-in-region (point-min) (point-max) ?\r ? t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4716 (gnus-run-hooks 'gnus-parse-headers-hook) |
17493 | 4717 (let ((case-fold-search t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4718 in-reply-to header p lines chars) |
17493 | 4719 (goto-char (point-min)) |
4720 ;; Search to the beginning of the next header. Error messages | |
4721 ;; do not begin with 2 or 3. | |
4722 (while (re-search-forward "^[23][0-9]+ " nil t) | |
4723 (setq id nil | |
4724 ref nil) | |
4725 ;; This implementation of this function, with nine | |
4726 ;; search-forwards instead of the one re-search-forward and | |
4727 ;; a case (which basically was the old function) is actually | |
4728 ;; about twice as fast, even though it looks messier. You | |
4729 ;; can't have everything, I guess. Speed and elegance | |
4730 ;; doesn't always go hand in hand. | |
4731 (setq | |
4732 header | |
4733 (vector | |
4734 ;; Number. | |
4735 (prog1 | |
4736 (read cur) | |
4737 (end-of-line) | |
4738 (setq p (point)) | |
4739 (narrow-to-region (point) | |
4740 (or (and (search-forward "\n.\n" nil t) | |
4741 (- (point) 2)) | |
4742 (point)))) | |
4743 ;; Subject. | |
4744 (progn | |
4745 (goto-char p) | |
4746 (if (search-forward "\nsubject: " nil t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4747 (funcall gnus-decode-encoded-word-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4748 (nnheader-header-value)) |
19594
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
4749 "(none)")) |
17493 | 4750 ;; From. |
4751 (progn | |
4752 (goto-char p) | |
32975
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
4753 (if (or (search-forward "\nfrom: " nil t) |
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
4754 (search-forward "\nfrom:" nil t)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4755 (funcall gnus-decode-encoded-word-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4756 (nnheader-header-value)) |
19594
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
4757 "(nobody)")) |
17493 | 4758 ;; Date. |
4759 (progn | |
4760 (goto-char p) | |
4761 (if (search-forward "\ndate: " nil t) | |
4762 (nnheader-header-value) "")) | |
4763 ;; Message-ID. | |
4764 (progn | |
4765 (goto-char p) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4766 (setq id (if (re-search-forward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4767 "^message-id: *\\(<[^\n\t> ]+>\\)" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4768 ;; 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
|
4769 ;; is (somewhat) syntactically valid. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4770 (buffer-substring (match-beginning 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4771 (match-end 1)) |
17493 | 4772 ;; If there was no message-id, we just fake one |
4773 ;; to make subsequent routines simpler. | |
4774 (nnheader-generate-fake-message-id)))) | |
4775 ;; References. | |
4776 (progn | |
4777 (goto-char p) | |
4778 (if (search-forward "\nreferences: " nil t) | |
4779 (progn | |
4780 (setq end (point)) | |
4781 (prog1 | |
4782 (nnheader-header-value) | |
4783 (setq ref | |
4784 (buffer-substring | |
4785 (progn | |
4786 (end-of-line) | |
4787 (search-backward ">" end t) | |
4788 (1+ (point))) | |
4789 (progn | |
4790 (search-backward "<" end t) | |
4791 (point)))))) | |
4792 ;; Get the references from the in-reply-to header if there | |
4793 ;; were no references and the in-reply-to header looks | |
4794 ;; promising. | |
4795 (if (and (search-forward "\nin-reply-to: " nil t) | |
4796 (setq in-reply-to (nnheader-header-value)) | |
4797 (string-match "<[^>]+>" in-reply-to)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4798 (let (ref2) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4799 (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
|
4800 (match-end 0))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4801 (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
|
4802 (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
|
4803 (match-end 0))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4804 (when (> (length ref2) (length ref)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4805 (setq ref ref2))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4806 ref) |
17493 | 4807 (setq ref nil)))) |
4808 ;; Chars. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4809 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4810 (goto-char p) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4811 (if (search-forward "\nchars: " nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4812 (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
|
4813 chars 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4814 0)) |
17493 | 4815 ;; Lines. |
4816 (progn | |
4817 (goto-char p) | |
4818 (if (search-forward "\nlines: " nil t) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4819 (if (numberp (setq lines (ignore-errors (read cur)))) |
17493 | 4820 lines 0) |
4821 0)) | |
4822 ;; Xref. | |
4823 (progn | |
4824 (goto-char p) | |
4825 (and (search-forward "\nxref: " nil t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4826 (nnheader-header-value))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4827 ;; Extra. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4828 (when gnus-extra-headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4829 (let ((extra gnus-extra-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4830 out) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4831 (while extra |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4832 (goto-char p) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4833 (when (search-forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4834 (concat "\n" (symbol-name (car extra)) ": ") nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4835 (push (cons (car extra) (nnheader-header-value)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4836 out)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4837 (pop extra)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4838 out)))) |
17493 | 4839 (when (equal id ref) |
4840 (setq ref nil)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4841 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4842 (when gnus-alter-header-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4843 (funcall gnus-alter-header-function header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4844 (setq id (mail-header-id header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4845 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
|
4846 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4847 (when (setq header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4848 (gnus-dependencies-add-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4849 header dependencies force-new)) |
17493 | 4850 (push header headers)) |
4851 (goto-char (point-max)) | |
4852 (widen)) | |
4853 (nreverse headers))))) | |
4854 | |
4855 ;; Goes through the xover lines and returns a list of vectors | |
4856 (defun gnus-get-newsgroup-headers-xover (sequence &optional | |
4857 force-new dependencies | |
4858 group also-fetch-heads) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4859 "Parse the news overview data in the server buffer. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4860 Return a list of headers that match SEQUENCE (see |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4861 `nntp-retrieve-headers')." |
17493 | 4862 ;; Get the Xref when the users reads the articles since most/some |
4863 ;; NNTP servers do not include Xrefs when using XOVER. | |
4864 (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4865 (let ((mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4866 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4867 (cur nntp-server-buffer) |
17493 | 4868 (dependencies (or dependencies gnus-newsgroup-dependencies)) |
4869 number headers header) | |
4870 (save-excursion | |
4871 (set-buffer nntp-server-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4872 (subst-char-in-region (point-min) (point-max) ?\r ? t) |
17493 | 4873 ;; 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
|
4874 (gnus-run-hooks 'gnus-parse-headers-hook) |
17493 | 4875 (goto-char (point-min)) |
4876 (while (not (eobp)) | |
4877 (condition-case () | |
4878 (while (and sequence (not (eobp))) | |
4879 (setq number (read cur)) | |
4880 (while (and sequence | |
4881 (< (car sequence) number)) | |
4882 (setq sequence (cdr sequence))) | |
4883 (and sequence | |
4884 (eq number (car sequence)) | |
4885 (progn | |
4886 (setq sequence (cdr sequence)) | |
4887 (setq header (inline | |
4888 (gnus-nov-parse-line | |
4889 number dependencies force-new)))) | |
4890 (push header headers)) | |
4891 (forward-line 1)) | |
4892 (error | |
4893 (gnus-error 4 "Strange nov line (%d)" | |
4894 (count-lines (point-min) (point))))) | |
4895 (forward-line 1)) | |
4896 ;; A common bug in inn is that if you have posted an article and | |
4897 ;; then retrieves the active file, it will answer correctly -- | |
4898 ;; the new article is included. However, a NOV entry for the | |
4899 ;; article may not have been generated yet, so this may fail. | |
4900 ;; We work around this problem by retrieving the last few | |
4901 ;; headers using HEAD. | |
4902 (if (or (not also-fetch-heads) | |
4903 (not sequence)) | |
4904 ;; We (probably) got all the headers. | |
4905 (nreverse headers) | |
4906 (let ((gnus-nov-is-evil t)) | |
4907 (nconc | |
4908 (nreverse headers) | |
4909 (when (gnus-retrieve-headers sequence group) | |
4910 (gnus-get-newsgroup-headers)))))))) | |
4911 | |
4912 (defun gnus-article-get-xrefs () | |
4913 "Fill in the Xref value in `gnus-current-headers', if necessary. | |
4914 This is meant to be called in `gnus-article-internal-prepare-hook'." | |
4915 (let ((headers (save-excursion (set-buffer gnus-summary-buffer) | |
4916 gnus-current-headers))) | |
4917 (or (not gnus-use-cross-reference) | |
4918 (not headers) | |
4919 (and (mail-header-xref headers) | |
4920 (not (string= (mail-header-xref headers) ""))) | |
4921 (let ((case-fold-search t) | |
4922 xref) | |
4923 (save-restriction | |
4924 (nnheader-narrow-to-headers) | |
4925 (goto-char (point-min)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4926 (when (or (and (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4927 (eq (downcase (char-after)) ?x) |
17493 | 4928 (looking-at "Xref:")) |
4929 (search-forward "\nXref:" nil t)) | |
4930 (goto-char (1+ (match-end 0))) | |
4931 (setq xref (buffer-substring (point) | |
4932 (progn (end-of-line) (point)))) | |
4933 (mail-header-set-xref headers xref))))))) | |
4934 | |
4935 (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
|
4936 "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
|
4937 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
|
4938 the subject line on." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4939 (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
|
4940 (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
|
4941 (header (cond ((and old-header use-old-header) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4942 old-header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4943 ((and (numberp id) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4944 (gnus-number-to-header id)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4945 (gnus-number-to-header id)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4946 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4947 (gnus-read-header id)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4948 (number (and (numberp id) id)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4949 d) |
17493 | 4950 (when header |
4951 ;; Rebuild the thread that this article is part of and go to the | |
4952 ;; article we have fetched. | |
4953 (when (and (not gnus-show-threads) | |
4954 old-header) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4955 (when (and number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4956 (setq d (gnus-data-find (mail-header-number old-header)))) |
17493 | 4957 (goto-char (gnus-data-pos d)) |
4958 (gnus-data-remove | |
4959 number | |
4960 (- (gnus-point-at-bol) | |
4961 (prog1 | |
4962 (1+ (gnus-point-at-eol)) | |
4963 (gnus-delete-line)))))) | |
4964 (when old-header | |
4965 (mail-header-set-number header (mail-header-number old-header))) | |
4966 (setq gnus-newsgroup-sparse | |
4967 (delq (setq number (mail-header-number header)) | |
4968 gnus-newsgroup-sparse)) | |
4969 (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
|
4970 (push number gnus-newsgroup-limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4971 (gnus-rebuild-thread (mail-header-id header) line) |
17493 | 4972 (gnus-summary-goto-subject number nil t)) |
4973 (when (and (numberp number) | |
4974 (> number 0)) | |
4975 ;; We have to update the boundaries even if we can't fetch the | |
4976 ;; article if ID is a number -- so that the next `P' or `N' | |
4977 ;; command will fetch the previous (or next) article even | |
4978 ;; if the one we tried to fetch this time has been canceled. | |
4979 (when (> number gnus-newsgroup-end) | |
4980 (setq gnus-newsgroup-end number)) | |
4981 (when (< number gnus-newsgroup-begin) | |
4982 (setq gnus-newsgroup-begin number)) | |
4983 (setq gnus-newsgroup-unselected | |
4984 (delq number gnus-newsgroup-unselected))) | |
4985 ;; Report back a success? | |
4986 (and header (mail-header-number header)))) | |
4987 | |
4988 ;;; Process/prefix in the summary buffer | |
4989 | |
4990 (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
|
4991 "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
|
4992 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
|
4993 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
|
4994 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4995 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4996 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4997 (n |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4998 ;; A numerical prefix has been given. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4999 (setq n (prefix-numeric-value n)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5000 (let ((backward (< n 0)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5001 (n (abs (prefix-numeric-value n))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5002 articles article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5003 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5004 (while |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5005 (and (> n 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5006 (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
|
5007 articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5008 (if backward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5009 (gnus-summary-find-prev nil article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5010 (gnus-summary-find-next nil article))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5011 (decf n))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5012 (nreverse articles))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5013 ((and (gnus-region-active-p) (mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5014 (message "region active") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5015 ;; 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
|
5016 (let ((max (max (point) (mark))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5017 articles article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5018 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5019 (goto-char (min (min (point) (mark)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5020 (while |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5021 (and |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5022 (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
|
5023 (gnus-summary-find-next nil article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5024 (< (point) max))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5025 (nreverse articles)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5026 (gnus-newsgroup-processable |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5027 ;; There are process-marked articles present. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5028 ;; Save current state. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5029 (gnus-summary-save-process-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5030 ;; Return the list. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5031 (reverse gnus-newsgroup-processable)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5032 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5033 ;; Just return the current article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5034 (list (gnus-summary-article-number)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5035 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5036 (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
|
5037 "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
|
5038 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
|
5039 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
|
5040 (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
|
5041 `(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
|
5042 (while ,articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5043 (gnus-summary-goto-subject (car ,articles)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5044 ,@forms |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5045 (pop ,articles))))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5046 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5047 (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
|
5048 (put 'gnus-summary-iterate 'edebug-form-spec '(form body)) |
17493 | 5049 |
5050 (defun gnus-summary-save-process-mark () | |
5051 "Push the current set of process marked articles on the stack." | |
5052 (interactive) | |
5053 (push (copy-sequence gnus-newsgroup-processable) | |
5054 gnus-newsgroup-process-stack)) | |
5055 | |
5056 (defun gnus-summary-kill-process-mark () | |
5057 "Push the current set of process marked articles on the stack and unmark." | |
5058 (interactive) | |
5059 (gnus-summary-save-process-mark) | |
5060 (gnus-summary-unmark-all-processable)) | |
5061 | |
5062 (defun gnus-summary-yank-process-mark () | |
5063 "Pop the last process mark state off the stack and restore it." | |
5064 (interactive) | |
5065 (unless gnus-newsgroup-process-stack | |
5066 (error "Empty mark stack")) | |
5067 (gnus-summary-process-mark-set (pop gnus-newsgroup-process-stack))) | |
5068 | |
5069 (defun gnus-summary-process-mark-set (set) | |
5070 "Make SET into the current process marked articles." | |
5071 (gnus-summary-unmark-all-processable) | |
5072 (while set | |
5073 (gnus-summary-set-process-mark (pop set)))) | |
5074 | |
5075 ;;; Searching and stuff | |
5076 | |
5077 (defun gnus-summary-search-group (&optional backward use-level) | |
5078 "Search for next unread newsgroup. | |
5079 If optional argument BACKWARD is non-nil, search backward instead." | |
5080 (save-excursion | |
5081 (set-buffer gnus-group-buffer) | |
5082 (when (gnus-group-search-forward | |
5083 backward nil (if use-level (gnus-group-group-level) nil)) | |
5084 (gnus-group-group-name)))) | |
5085 | |
5086 (defun gnus-summary-best-group (&optional exclude-group) | |
5087 "Find the name of the best unread group. | |
5088 If EXCLUDE-GROUP, do not go to this group." | |
5089 (save-excursion | |
5090 (set-buffer gnus-group-buffer) | |
5091 (save-excursion | |
5092 (gnus-group-best-unread-group exclude-group)))) | |
5093 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5094 (defun gnus-summary-find-next (&optional unread article backward undownloaded) |
17493 | 5095 (if backward (gnus-summary-find-prev) |
5096 (let* ((dummy (gnus-summary-article-intangible-p)) | |
5097 (article (or article (gnus-summary-article-number))) | |
5098 (arts (gnus-data-find-list article)) | |
5099 result) | |
5100 (when (and (not dummy) | |
5101 (or (not gnus-summary-check-current) | |
5102 (not unread) | |
5103 (not (gnus-data-unread-p (car arts))))) | |
5104 (setq arts (cdr arts))) | |
5105 (when (setq result | |
5106 (if unread | |
5107 (progn | |
5108 (while arts | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5109 (when (or (and undownloaded |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5110 (eq gnus-undownloaded-mark |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5111 (gnus-data-mark (car arts)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5112 (gnus-data-unread-p (car arts))) |
17493 | 5113 (setq result (car arts) |
5114 arts nil)) | |
5115 (setq arts (cdr arts))) | |
5116 result) | |
5117 (car arts))) | |
5118 (goto-char (gnus-data-pos result)) | |
5119 (gnus-data-number result))))) | |
5120 | |
5121 (defun gnus-summary-find-prev (&optional unread article) | |
5122 (let* ((eobp (eobp)) | |
5123 (article (or article (gnus-summary-article-number))) | |
5124 (arts (gnus-data-find-list article (gnus-data-list 'rev))) | |
5125 result) | |
5126 (when (and (not eobp) | |
5127 (or (not gnus-summary-check-current) | |
5128 (not unread) | |
5129 (not (gnus-data-unread-p (car arts))))) | |
5130 (setq arts (cdr arts))) | |
5131 (when (setq result | |
5132 (if unread | |
5133 (progn | |
5134 (while arts | |
5135 (when (gnus-data-unread-p (car arts)) | |
5136 (setq result (car arts) | |
5137 arts nil)) | |
5138 (setq arts (cdr arts))) | |
5139 result) | |
5140 (car arts))) | |
5141 (goto-char (gnus-data-pos result)) | |
5142 (gnus-data-number result)))) | |
5143 | |
5144 (defun gnus-summary-find-subject (subject &optional unread backward article) | |
5145 (let* ((simp-subject (gnus-simplify-subject-fully subject)) | |
5146 (article (or article (gnus-summary-article-number))) | |
5147 (articles (gnus-data-list backward)) | |
5148 (arts (gnus-data-find-list article articles)) | |
5149 result) | |
5150 (when (or (not gnus-summary-check-current) | |
5151 (not unread) | |
5152 (not (gnus-data-unread-p (car arts)))) | |
5153 (setq arts (cdr arts))) | |
5154 (while arts | |
5155 (and (or (not unread) | |
5156 (gnus-data-unread-p (car arts))) | |
5157 (vectorp (gnus-data-header (car arts))) | |
5158 (gnus-subject-equal | |
5159 simp-subject (mail-header-subject (gnus-data-header (car arts))) t) | |
5160 (setq result (car arts) | |
5161 arts nil)) | |
5162 (setq arts (cdr arts))) | |
5163 (and result | |
5164 (goto-char (gnus-data-pos result)) | |
5165 (gnus-data-number result)))) | |
5166 | |
5167 (defun gnus-summary-search-forward (&optional unread subject backward) | |
5168 "Search forward for an article. | |
5169 If UNREAD, look for unread articles. If SUBJECT, look for | |
5170 articles with that subject. If BACKWARD, search backward instead." | |
5171 (cond (subject (gnus-summary-find-subject subject unread backward)) | |
5172 (backward (gnus-summary-find-prev unread)) | |
5173 (t (gnus-summary-find-next unread)))) | |
5174 | |
5175 (defun gnus-recenter (&optional n) | |
5176 "Center point in window and redisplay frame. | |
5177 Also do horizontal recentering." | |
5178 (interactive "P") | |
5179 (when (and gnus-auto-center-summary | |
5180 (not (eq gnus-auto-center-summary 'vertical))) | |
5181 (gnus-horizontal-recenter)) | |
5182 (recenter n)) | |
5183 | |
5184 (defun gnus-summary-recenter () | |
5185 "Center point in the summary window. | |
5186 If `gnus-auto-center-summary' is nil, or the article buffer isn't | |
5187 displayed, no centering will be performed." | |
5188 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle). | |
5189 ;; Recenter only when requested. Suggested by popovich@park.cs.columbia.edu. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5190 (interactive) |
17493 | 5191 (let* ((top (cond ((< (window-height) 4) 0) |
5192 ((< (window-height) 7) 1) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5193 (t (if (numberp gnus-auto-center-summary) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5194 gnus-auto-center-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5195 2)))) |
17493 | 5196 (height (1- (window-height))) |
5197 (bottom (save-excursion (goto-char (point-max)) | |
5198 (forward-line (- height)) | |
5199 (point))) | |
5200 (window (get-buffer-window (current-buffer)))) | |
5201 ;; The user has to want it. | |
5202 (when gnus-auto-center-summary | |
5203 (when (get-buffer-window gnus-article-buffer) | |
5204 ;; Only do recentering when the article buffer is displayed, | |
5205 ;; Set the window start to either `bottom', which is the biggest | |
5206 ;; possible valid number, or the second line from the top, | |
5207 ;; whichever is the least. | |
5208 (set-window-start | |
5209 window (min bottom (save-excursion | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5210 (forward-line (- top)) (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5211 t)) |
17493 | 5212 ;; Do horizontal recentering while we're at it. |
5213 (when (and (get-buffer-window (current-buffer) t) | |
5214 (not (eq gnus-auto-center-summary 'vertical))) | |
5215 (let ((selected (selected-window))) | |
5216 (select-window (get-buffer-window (current-buffer) t)) | |
5217 (gnus-summary-position-point) | |
5218 (gnus-horizontal-recenter) | |
5219 (select-window selected)))))) | |
5220 | |
5221 (defun gnus-summary-jump-to-group (newsgroup) | |
5222 "Move point to NEWSGROUP in group mode buffer." | |
5223 ;; Keep update point of group mode buffer if visible. | |
5224 (if (eq (current-buffer) (get-buffer gnus-group-buffer)) | |
5225 (save-window-excursion | |
5226 ;; Take care of tree window mode. | |
5227 (when (get-buffer-window gnus-group-buffer) | |
5228 (pop-to-buffer gnus-group-buffer)) | |
5229 (gnus-group-jump-to-group newsgroup)) | |
5230 (save-excursion | |
5231 ;; Take care of tree window mode. | |
5232 (if (get-buffer-window gnus-group-buffer) | |
5233 (pop-to-buffer gnus-group-buffer) | |
5234 (set-buffer gnus-group-buffer)) | |
5235 (gnus-group-jump-to-group newsgroup)))) | |
5236 | |
5237 ;; This function returns a list of article numbers based on the | |
5238 ;; difference between the ranges of read articles in this group and | |
5239 ;; the range of active articles. | |
5240 (defun gnus-list-of-unread-articles (group) | |
5241 (let* ((read (gnus-info-read (gnus-get-info group))) | |
5242 (active (or (gnus-active group) (gnus-activate-group group))) | |
5243 (last (cdr active)) | |
5244 first nlast unread) | |
5245 ;; If none are read, then all are unread. | |
5246 (if (not read) | |
5247 (setq first (car active)) | |
5248 ;; If the range of read articles is a single range, then the | |
5249 ;; first unread article is the article after the last read | |
5250 ;; article. Sounds logical, doesn't it? | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5251 (if (and (not (listp (cdr read))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5252 (or (< (car read) (car active)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5253 (progn (setq read (list read)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5254 nil))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5255 (setq first (max (car active) (1+ (cdr read)))) |
17493 | 5256 ;; `read' is a list of ranges. |
5257 (when (/= (setq nlast (or (and (numberp (car read)) (car read)) | |
5258 (caar read))) | |
5259 1) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5260 (setq first (car active))) |
17493 | 5261 (while read |
5262 (when first | |
5263 (while (< first nlast) | |
5264 (push first unread) | |
5265 (setq first (1+ first)))) | |
5266 (setq first (1+ (if (atom (car read)) (car read) (cdar read)))) | |
5267 (setq nlast (if (atom (cadr read)) (cadr read) (caadr read))) | |
5268 (setq read (cdr read))))) | |
5269 ;; And add the last unread articles. | |
5270 (while (<= first last) | |
5271 (push first unread) | |
5272 (setq first (1+ first))) | |
5273 ;; 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
|
5274 (delq 0 (nreverse unread)))) |
17493 | 5275 |
5276 (defun gnus-list-of-read-articles (group) | |
5277 "Return a list of unread, unticked and non-dormant articles." | |
5278 (let* ((info (gnus-get-info group)) | |
5279 (marked (gnus-info-marks info)) | |
5280 (active (gnus-active group))) | |
5281 (and info active | |
5282 (gnus-set-difference | |
5283 (gnus-sorted-complement | |
5284 (gnus-uncompress-range active) | |
5285 (gnus-list-of-unread-articles group)) | |
5286 (append | |
5287 (gnus-uncompress-range (cdr (assq 'dormant marked))) | |
5288 (gnus-uncompress-range (cdr (assq 'tick marked)))))))) | |
5289 | |
5290 ;; Various summary commands | |
5291 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5292 (defun gnus-summary-select-article-buffer () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5293 "Reconfigure windows to show article buffer." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5294 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5295 (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
|
5296 (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
|
5297 (gnus-configure-windows 'article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5298 (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
|
5299 |
17493 | 5300 (defun gnus-summary-universal-argument (arg) |
5301 "Perform any operation on all articles that are process/prefixed." | |
5302 (interactive "P") | |
5303 (let ((articles (gnus-summary-work-articles arg)) | |
5304 func article) | |
5305 (if (eq | |
5306 (setq | |
5307 func | |
5308 (key-binding | |
5309 (read-key-sequence | |
5310 (substitute-command-keys | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5311 "\\<gnus-summary-mode-map>\\[gnus-summary-universal-argument]")))) |
17493 | 5312 'undefined) |
5313 (gnus-error 1 "Undefined key") | |
5314 (save-excursion | |
5315 (while articles | |
5316 (gnus-summary-goto-subject (setq article (pop articles))) | |
5317 (let (gnus-newsgroup-processable) | |
5318 (command-execute func)) | |
5319 (gnus-summary-remove-process-mark article))))) | |
5320 (gnus-summary-position-point)) | |
5321 | |
5322 (defun gnus-summary-toggle-truncation (&optional arg) | |
5323 "Toggle truncation of summary lines. | |
5324 With arg, turn line truncation on iff arg is positive." | |
5325 (interactive "P") | |
5326 (setq truncate-lines | |
5327 (if (null arg) (not truncate-lines) | |
5328 (> (prefix-numeric-value arg) 0))) | |
5329 (redraw-display)) | |
5330 | |
5331 (defun gnus-summary-reselect-current-group (&optional all rescan) | |
5332 "Exit and then reselect the current newsgroup. | |
5333 The prefix argument ALL means to select all articles." | |
5334 (interactive "P") | |
5335 (when (gnus-ephemeral-group-p gnus-newsgroup-name) | |
5336 (error "Ephemeral groups can't be reselected")) | |
5337 (let ((current-subject (gnus-summary-article-number)) | |
5338 (group gnus-newsgroup-name)) | |
5339 (setq gnus-newsgroup-begin nil) | |
5340 (gnus-summary-exit) | |
5341 ;; We have to adjust the point of group mode buffer because | |
5342 ;; point was moved to the next unread newsgroup by exiting. | |
5343 (gnus-summary-jump-to-group group) | |
5344 (when rescan | |
5345 (save-excursion | |
5346 (gnus-group-get-new-news-this-group 1))) | |
5347 (gnus-group-read-group all t) | |
5348 (gnus-summary-goto-subject current-subject nil t))) | |
5349 | |
5350 (defun gnus-summary-rescan-group (&optional all) | |
5351 "Exit the newsgroup, ask for new articles, and select the newsgroup." | |
5352 (interactive "P") | |
5353 (gnus-summary-reselect-current-group all t)) | |
5354 | |
5355 (defun gnus-summary-update-info (&optional non-destructive) | |
5356 (save-excursion | |
5357 (let ((group gnus-newsgroup-name)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5358 (when group |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5359 (when gnus-newsgroup-kill-headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5360 (setq gnus-newsgroup-killed |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5361 (gnus-compress-sequence |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5362 (nconc |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5363 (gnus-set-sorted-intersection |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5364 (gnus-uncompress-range gnus-newsgroup-killed) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5365 (setq gnus-newsgroup-unselected |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5366 (sort gnus-newsgroup-unselected '<))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5367 (setq gnus-newsgroup-unreads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5368 (sort gnus-newsgroup-unreads '<))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5369 t))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5370 (unless (listp (cdr gnus-newsgroup-killed)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5371 (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
|
5372 (let ((headers gnus-newsgroup-headers)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5373 ;; 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
|
5374 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5375 (set-buffer gnus-group-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5376 (gnus-undo-force-boundary)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5377 (gnus-update-read-articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5378 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
|
5379 ;; Set the current article marks. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5380 (let ((gnus-newsgroup-scored |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5381 (if (and (not gnus-save-score) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5382 (not non-destructive)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5383 nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5384 gnus-newsgroup-scored))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5385 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5386 (gnus-update-marks))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5387 ;; Do the cross-ref thing. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5388 (when gnus-use-cross-reference |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5389 (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
|
5390 ;; 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
|
5391 (set-buffer gnus-group-buffer) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5392 (unless (gnus-ephemeral-group-p group) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5393 (gnus-group-update-group group))))))) |
17493 | 5394 |
5395 (defun gnus-summary-save-newsrc (&optional force) | |
5396 "Save the current number of read/marked articles in the dribble buffer. | |
5397 The dribble buffer will then be saved. | |
5398 If FORCE (the prefix), also save the .newsrc file(s)." | |
5399 (interactive "P") | |
5400 (gnus-summary-update-info t) | |
5401 (if force | |
5402 (gnus-save-newsrc-file) | |
5403 (gnus-dribble-save))) | |
5404 | |
5405 (defun gnus-summary-exit (&optional temporary) | |
5406 "Exit reading current newsgroup, and then return to group selection mode. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5407 `gnus-exit-group-hook' is called with no arguments if that value is non-nil." |
17493 | 5408 (interactive) |
5409 (gnus-set-global-variables) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5410 (when (gnus-buffer-live-p gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5411 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5412 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5413 (mm-destroy-parts gnus-article-mime-handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5414 ;; Set it to nil for safety reason. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5415 (setq gnus-article-mime-handle-alist nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5416 (setq gnus-article-mime-handles nil))) |
17493 | 5417 (gnus-kill-save-kill-buffer) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5418 (gnus-async-halt-prefetch) |
17493 | 5419 (let* ((group gnus-newsgroup-name) |
5420 (quit-config (gnus-group-quit-config gnus-newsgroup-name)) | |
5421 (mode major-mode) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5422 (group-point nil) |
17493 | 5423 (buf (current-buffer))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5424 (unless quit-config |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5425 ;; Do adaptive scoring, and possibly save score files. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5426 (when gnus-newsgroup-adaptive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5427 (gnus-score-adaptive)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5428 (when gnus-use-scoring |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5429 (gnus-score-save))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5430 (gnus-run-hooks 'gnus-summary-prepare-exit-hook) |
17493 | 5431 ;; If we have several article buffers, we kill them at exit. |
5432 (unless gnus-single-article-buffer | |
5433 (gnus-kill-buffer gnus-original-article-buffer) | |
5434 (setq gnus-article-current nil)) | |
5435 (when gnus-use-cache | |
5436 (gnus-cache-possibly-remove-articles) | |
5437 (gnus-cache-save-buffers)) | |
5438 (gnus-async-prefetch-remove-group group) | |
5439 (when gnus-suppress-duplicates | |
5440 (gnus-dup-enter-articles)) | |
5441 (when gnus-use-trees | |
5442 (gnus-tree-close group)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5443 (when gnus-use-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5444 (gnus-cache-write-active)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5445 ;; Remove entries for this group. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5446 (nnmail-purge-split-history (gnus-group-real-name group)) |
17493 | 5447 ;; Make all changes in this group permanent. |
5448 (unless quit-config | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5449 (gnus-run-hooks 'gnus-exit-group-hook) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5450 (gnus-summary-update-info)) |
17493 | 5451 (gnus-close-group group) |
5452 ;; Make sure where we were, and go to next newsgroup. | |
5453 (set-buffer gnus-group-buffer) | |
5454 (unless quit-config | |
5455 (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
|
5456 (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
|
5457 (unless (or quit-config |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5458 ;; 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
|
5459 ;; buffer, don't skip forwards. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5460 (not (string= group (gnus-group-group-name)))) |
17493 | 5461 (gnus-group-next-unread-group 1)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5462 (setq group-point (point)) |
17493 | 5463 (if temporary |
5464 nil ;Nothing to do. | |
5465 ;; If we have several article buffers, we kill them at exit. | |
5466 (unless gnus-single-article-buffer | |
5467 (gnus-kill-buffer gnus-article-buffer) | |
5468 (gnus-kill-buffer gnus-original-article-buffer) | |
5469 (setq gnus-article-current nil)) | |
5470 (set-buffer buf) | |
5471 (if (not gnus-kill-summary-on-exit) | |
5472 (gnus-deaden-summary) | |
5473 ;; We set all buffer-local variables to nil. It is unclear why | |
5474 ;; this is needed, but if we don't, buffer-local variables are | |
5475 ;; not garbage-collected, it seems. This would the lead to en | |
5476 ;; ever-growing Emacs. | |
5477 (gnus-summary-clear-local-variables) | |
5478 (when (get-buffer gnus-article-buffer) | |
5479 (bury-buffer gnus-article-buffer)) | |
5480 ;; We clear the global counterparts of the buffer-local | |
5481 ;; variables as well, just to be on the safe side. | |
5482 (set-buffer gnus-group-buffer) | |
5483 (gnus-summary-clear-local-variables) | |
5484 ;; Return to group mode buffer. | |
5485 (when (eq mode 'gnus-summary-mode) | |
5486 (gnus-kill-buffer buf))) | |
5487 (setq gnus-current-select-method gnus-select-method) | |
5488 (pop-to-buffer gnus-group-buffer) | |
5489 (if (not quit-config) | |
5490 (progn | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5491 (goto-char group-point) |
17493 | 5492 (gnus-configure-windows 'group 'force)) |
5493 (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
|
5494 ;; Clear the current group name. |
17493 | 5495 (unless quit-config |
5496 (setq gnus-newsgroup-name nil))))) | |
5497 | |
5498 (defalias 'gnus-summary-quit 'gnus-summary-exit-no-update) | |
5499 (defun gnus-summary-exit-no-update (&optional no-questions) | |
5500 "Quit reading current newsgroup without updating read article info." | |
5501 (interactive) | |
5502 (let* ((group gnus-newsgroup-name) | |
5503 (quit-config (gnus-group-quit-config group))) | |
5504 (when (or no-questions | |
5505 gnus-expert-user | |
5506 (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
|
5507 (gnus-async-halt-prefetch) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5508 (mapcar 'funcall |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5509 (delq 'gnus-summary-expire-articles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5510 (copy-sequence gnus-summary-prepare-exit-hook))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5511 (when (gnus-buffer-live-p gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5512 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5513 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5514 (mm-destroy-parts gnus-article-mime-handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5515 ;; Set it to nil for safety reason. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5516 (setq gnus-article-mime-handle-alist nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5517 (setq gnus-article-mime-handles nil))) |
17493 | 5518 ;; If we have several article buffers, we kill them at exit. |
5519 (unless gnus-single-article-buffer | |
5520 (gnus-kill-buffer gnus-article-buffer) | |
5521 (gnus-kill-buffer gnus-original-article-buffer) | |
5522 (setq gnus-article-current nil)) | |
5523 (if (not gnus-kill-summary-on-exit) | |
5524 (gnus-deaden-summary) | |
5525 (gnus-close-group group) | |
5526 (gnus-summary-clear-local-variables) | |
5527 (set-buffer gnus-group-buffer) | |
5528 (gnus-summary-clear-local-variables) | |
5529 (when (get-buffer gnus-summary-buffer) | |
5530 (kill-buffer gnus-summary-buffer))) | |
5531 (unless gnus-single-article-buffer | |
5532 (setq gnus-article-current nil)) | |
5533 (when gnus-use-trees | |
5534 (gnus-tree-close group)) | |
5535 (gnus-async-prefetch-remove-group group) | |
5536 (when (get-buffer gnus-article-buffer) | |
5537 (bury-buffer gnus-article-buffer)) | |
5538 ;; Return to the group buffer. | |
5539 (gnus-configure-windows 'group 'force) | |
5540 ;; Clear the current group name. | |
5541 (setq gnus-newsgroup-name nil) | |
5542 (when (equal (gnus-group-group-name) group) | |
5543 (gnus-group-next-unread-group 1)) | |
5544 (when quit-config | |
5545 (gnus-handle-ephemeral-exit quit-config))))) | |
5546 | |
5547 (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
|
5548 "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
|
5549 The state which existed when entering the ephemeral is reset." |
17493 | 5550 (if (not (buffer-name (car quit-config))) |
5551 (gnus-configure-windows 'group 'force) | |
5552 (set-buffer (car quit-config)) | |
5553 (cond ((eq major-mode 'gnus-summary-mode) | |
5554 (gnus-set-global-variables)) | |
5555 ((eq major-mode 'gnus-article-mode) | |
5556 (save-excursion | |
5557 ;; The `gnus-summary-buffer' variable may point | |
5558 ;; to the old summary buffer when using a single | |
5559 ;; article buffer. | |
5560 (unless (gnus-buffer-live-p gnus-summary-buffer) | |
5561 (set-buffer gnus-group-buffer)) | |
5562 (set-buffer gnus-summary-buffer) | |
5563 (gnus-set-global-variables)))) | |
5564 (if (or (eq (cdr quit-config) 'article) | |
5565 (eq (cdr quit-config) 'pick)) | |
5566 (progn | |
5567 ;; The current article may be from the ephemeral group | |
5568 ;; thus it is best that we reload this article | |
5569 (gnus-summary-show-article) | |
5570 (if (and (boundp 'gnus-pick-mode) (symbol-value 'gnus-pick-mode)) | |
5571 (gnus-configure-windows 'pick 'force) | |
5572 (gnus-configure-windows (cdr quit-config) 'force))) | |
5573 (gnus-configure-windows (cdr quit-config) 'force)) | |
5574 (when (eq major-mode 'gnus-summary-mode) | |
5575 (gnus-summary-next-subject 1 nil t) | |
5576 (gnus-summary-recenter) | |
5577 (gnus-summary-position-point)))) | |
5578 | |
5579 ;;; Dead summaries. | |
5580 | |
5581 (defvar gnus-dead-summary-mode-map nil) | |
5582 | |
5583 (unless gnus-dead-summary-mode-map | |
5584 (setq gnus-dead-summary-mode-map (make-keymap)) | |
5585 (suppress-keymap gnus-dead-summary-mode-map) | |
5586 (substitute-key-definition | |
5587 '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
|
5588 (let ((keys '("\C-d" "\r" "\177" [delete]))) |
17493 | 5589 (while keys |
5590 (define-key gnus-dead-summary-mode-map | |
5591 (pop keys) 'gnus-summary-wake-up-the-dead)))) | |
5592 | |
5593 (defvar gnus-dead-summary-mode nil | |
5594 "Minor mode for Gnus summary buffers.") | |
5595 | |
5596 (defun gnus-dead-summary-mode (&optional arg) | |
5597 "Minor mode for Gnus summary buffers." | |
5598 (interactive "P") | |
5599 (when (eq major-mode 'gnus-summary-mode) | |
5600 (make-local-variable 'gnus-dead-summary-mode) | |
5601 (setq gnus-dead-summary-mode | |
5602 (if (null arg) (not gnus-dead-summary-mode) | |
5603 (> (prefix-numeric-value arg) 0))) | |
5604 (when gnus-dead-summary-mode | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5605 (gnus-add-minor-mode |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5606 'gnus-dead-summary-mode " Dead" gnus-dead-summary-mode-map)))) |
17493 | 5607 |
5608 (defun gnus-deaden-summary () | |
5609 "Make the current summary buffer into a dead summary buffer." | |
5610 ;; Kill any previous dead summary buffer. | |
5611 (when (and gnus-dead-summary | |
5612 (buffer-name gnus-dead-summary)) | |
5613 (save-excursion | |
5614 (set-buffer gnus-dead-summary) | |
5615 (when gnus-dead-summary-mode | |
5616 (kill-buffer (current-buffer))))) | |
5617 ;; Make this the current dead summary. | |
5618 (setq gnus-dead-summary (current-buffer)) | |
5619 (gnus-dead-summary-mode 1) | |
5620 (let ((name (buffer-name))) | |
5621 (when (string-match "Summary" name) | |
5622 (rename-buffer | |
5623 (concat (substring name 0 (match-beginning 0)) "Dead " | |
5624 (substring name (match-beginning 0))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5625 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5626 (bury-buffer)))) |
17493 | 5627 |
5628 (defun gnus-kill-or-deaden-summary (buffer) | |
5629 "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
|
5630 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5631 (when (and (buffer-name buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5632 (not gnus-single-article-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5633 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5634 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5635 (gnus-kill-buffer gnus-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5636 (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
|
5637 (cond (gnus-kill-summary-on-exit |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5638 (when (and gnus-use-trees |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5639 (gnus-buffer-exists-p buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5640 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5641 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5642 (gnus-tree-close gnus-newsgroup-name))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5643 (gnus-kill-buffer buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5644 ((gnus-buffer-exists-p buffer) |
17493 | 5645 (save-excursion |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5646 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5647 (gnus-deaden-summary)))))) |
17493 | 5648 |
5649 (defun gnus-summary-wake-up-the-dead (&rest args) | |
5650 "Wake up the dead summary buffer." | |
5651 (interactive) | |
5652 (gnus-dead-summary-mode -1) | |
5653 (let ((name (buffer-name))) | |
5654 (when (string-match "Dead " name) | |
5655 (rename-buffer | |
5656 (concat (substring name 0 (match-beginning 0)) | |
5657 (substring name (match-end 0))) | |
5658 t))) | |
5659 (gnus-message 3 "This dead summary is now alive again")) | |
5660 | |
5661 ;; Suggested by Andrew Eskilsson <pi92ae@pt.hk-r.se>. | |
5662 (defun gnus-summary-fetch-faq (&optional faq-dir) | |
5663 "Fetch the FAQ for the current group. | |
5664 If FAQ-DIR (the prefix), prompt for a directory to search for the faq | |
5665 in." | |
5666 (interactive | |
5667 (list | |
5668 (when current-prefix-arg | |
5669 (completing-read | |
5670 "Faq dir: " (and (listp gnus-group-faq-directory) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5671 (mapcar (lambda (file) (list file)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5672 gnus-group-faq-directory)))))) |
17493 | 5673 (let (gnus-faq-buffer) |
5674 (when (setq gnus-faq-buffer | |
5675 (gnus-group-fetch-faq gnus-newsgroup-name faq-dir)) | |
5676 (gnus-configure-windows 'summary-faq)))) | |
5677 | |
5678 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>. | |
5679 (defun gnus-summary-describe-group (&optional force) | |
5680 "Describe the current newsgroup." | |
5681 (interactive "P") | |
5682 (gnus-group-describe-group force gnus-newsgroup-name)) | |
5683 | |
5684 (defun gnus-summary-describe-briefly () | |
5685 "Describe summary mode commands briefly." | |
5686 (interactive) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5687 (gnus-message 6 (substitute-command-keys "\\<gnus-summary-mode-map>\\[gnus-summary-next-page]:Select \\[gnus-summary-next-unread-article]:Forward \\[gnus-summary-prev-unread-article]:Backward \\[gnus-summary-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-summary-describe-briefly]:This help"))) |
17493 | 5688 |
5689 ;; Walking around group mode buffer from summary mode. | |
5690 | |
5691 (defun gnus-summary-next-group (&optional no-article target-group backward) | |
5692 "Exit current newsgroup and then select next unread newsgroup. | |
5693 If prefix argument NO-ARTICLE is non-nil, no article is selected | |
5694 initially. If NEXT-GROUP, go to this group. If BACKWARD, go to | |
5695 previous group instead." | |
5696 (interactive "P") | |
5697 ;; Stop pre-fetching. | |
5698 (gnus-async-halt-prefetch) | |
5699 (let ((current-group gnus-newsgroup-name) | |
5700 (current-buffer (current-buffer)) | |
5701 entered) | |
5702 ;; First we semi-exit this group to update Xrefs and all variables. | |
5703 ;; We can't do a real exit, because the window conf must remain | |
5704 ;; the same in case the user is prompted for info, and we don't | |
5705 ;; want the window conf to change before that... | |
5706 (gnus-summary-exit t) | |
5707 (while (not entered) | |
5708 ;; Then we find what group we are supposed to enter. | |
5709 (set-buffer gnus-group-buffer) | |
5710 (gnus-group-jump-to-group current-group) | |
5711 (setq target-group | |
5712 (or target-group | |
5713 (if (eq gnus-keep-same-level 'best) | |
5714 (gnus-summary-best-group gnus-newsgroup-name) | |
5715 (gnus-summary-search-group backward gnus-keep-same-level)))) | |
5716 (if (not target-group) | |
5717 ;; There are no further groups, so we return to the group | |
5718 ;; buffer. | |
5719 (progn | |
5720 (gnus-message 5 "Returning to the group buffer") | |
5721 (setq entered t) | |
5722 (when (gnus-buffer-live-p current-buffer) | |
5723 (set-buffer current-buffer) | |
5724 (gnus-summary-exit)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5725 (gnus-run-hooks 'gnus-group-no-more-groups-hook)) |
17493 | 5726 ;; We try to enter the target group. |
5727 (gnus-group-jump-to-group target-group) | |
5728 (let ((unreads (gnus-group-group-unread))) | |
5729 (if (and (or (eq t unreads) | |
5730 (and unreads (not (zerop unreads)))) | |
5731 (gnus-summary-read-group | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5732 target-group nil no-article |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5733 (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
|
5734 nil backward)) |
17493 | 5735 (setq entered t) |
5736 (setq current-group target-group | |
5737 target-group nil))))))) | |
5738 | |
5739 (defun gnus-summary-prev-group (&optional no-article) | |
5740 "Exit current newsgroup and then select previous unread newsgroup. | |
5741 If prefix argument NO-ARTICLE is non-nil, no article is selected initially." | |
5742 (interactive "P") | |
5743 (gnus-summary-next-group no-article nil t)) | |
5744 | |
5745 ;; Walking around summary lines. | |
5746 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5747 (defun gnus-summary-first-subject (&optional unread undownloaded) |
17493 | 5748 "Go to the first unread subject. |
5749 If UNREAD is non-nil, go to the first unread article. | |
5750 Returns the article selected or nil if there are no unread articles." | |
5751 (interactive "P") | |
5752 (prog1 | |
5753 (cond | |
5754 ;; Empty summary. | |
5755 ((null gnus-newsgroup-data) | |
5756 (gnus-message 3 "No articles in the group") | |
5757 nil) | |
5758 ;; Pick the first article. | |
5759 ((not unread) | |
5760 (goto-char (gnus-data-pos (car gnus-newsgroup-data))) | |
5761 (gnus-data-number (car gnus-newsgroup-data))) | |
5762 ;; No unread articles. | |
5763 ((null gnus-newsgroup-unreads) | |
5764 (gnus-message 3 "No more unread articles") | |
5765 nil) | |
5766 ;; Find the first unread article. | |
5767 (t | |
5768 (let ((data gnus-newsgroup-data)) | |
5769 (while (and data | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5770 (and (not (and undownloaded |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5771 (eq gnus-undownloaded-mark |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5772 (gnus-data-mark (car data))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5773 (not (gnus-data-unread-p (car data))))) |
17493 | 5774 (setq data (cdr data))) |
5775 (when data | |
5776 (goto-char (gnus-data-pos (car data))) | |
5777 (gnus-data-number (car data)))))) | |
5778 (gnus-summary-position-point))) | |
5779 | |
5780 (defun gnus-summary-next-subject (n &optional unread dont-display) | |
5781 "Go to next N'th summary line. | |
5782 If N is negative, go to the previous N'th subject line. | |
5783 If UNREAD is non-nil, only unread articles are selected. | |
5784 The difference between N and the actual number of steps taken is | |
5785 returned." | |
5786 (interactive "p") | |
5787 (let ((backward (< n 0)) | |
5788 (n (abs n))) | |
5789 (while (and (> n 0) | |
5790 (if backward | |
5791 (gnus-summary-find-prev unread) | |
5792 (gnus-summary-find-next unread))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5793 (unless (zerop (setq n (1- n))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5794 (gnus-summary-show-thread))) |
17493 | 5795 (when (/= 0 n) |
5796 (gnus-message 7 "No more%s articles" | |
5797 (if unread " unread" ""))) | |
5798 (unless dont-display | |
5799 (gnus-summary-recenter) | |
5800 (gnus-summary-position-point)) | |
5801 n)) | |
5802 | |
5803 (defun gnus-summary-next-unread-subject (n) | |
5804 "Go to next N'th unread summary line." | |
5805 (interactive "p") | |
5806 (gnus-summary-next-subject n t)) | |
5807 | |
5808 (defun gnus-summary-prev-subject (n &optional unread) | |
5809 "Go to previous N'th summary line. | |
5810 If optional argument UNREAD is non-nil, only unread article is selected." | |
5811 (interactive "p") | |
5812 (gnus-summary-next-subject (- n) unread)) | |
5813 | |
5814 (defun gnus-summary-prev-unread-subject (n) | |
5815 "Go to previous N'th unread summary line." | |
5816 (interactive "p") | |
5817 (gnus-summary-next-subject (- n) t)) | |
5818 | |
5819 (defun gnus-summary-goto-subject (article &optional force silent) | |
5820 "Go the subject line of ARTICLE. | |
5821 If FORCE, also allow jumping to articles not currently shown." | |
5822 (interactive "nArticle number: ") | |
5823 (let ((b (point)) | |
5824 (data (gnus-data-find article))) | |
5825 ;; We read in the article if we have to. | |
5826 (and (not data) | |
5827 force | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5828 (gnus-summary-insert-subject |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5829 article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5830 (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
|
5831 t) |
17493 | 5832 (setq data (gnus-data-find article))) |
5833 (goto-char b) | |
5834 (if (not data) | |
5835 (progn | |
5836 (unless silent | |
5837 (gnus-message 3 "Can't find article %d" article)) | |
5838 nil) | |
5839 (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
|
5840 (gnus-summary-position-point) |
17493 | 5841 article))) |
5842 | |
5843 ;; Walking around summary lines with displaying articles. | |
5844 | |
5845 (defun gnus-summary-expand-window (&optional arg) | |
5846 "Make the summary buffer take up the entire Emacs frame. | |
5847 Given a prefix, will force an `article' buffer configuration." | |
5848 (interactive "P") | |
5849 (if arg | |
5850 (gnus-configure-windows 'article 'force) | |
5851 (gnus-configure-windows 'summary 'force))) | |
5852 | |
5853 (defun gnus-summary-display-article (article &optional all-header) | |
5854 "Display ARTICLE in article buffer." | |
32975
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
5855 (when (gnus-buffer-live-p gnus-article-buffer) |
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
5856 (with-current-buffer gnus-article-buffer |
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
5857 (mm-enable-multibyte-mule4))) |
17493 | 5858 (gnus-set-global-variables) |
5859 (if (null article) | |
5860 nil | |
5861 (prog1 | |
5862 (if gnus-summary-display-article-function | |
5863 (funcall gnus-summary-display-article-function article all-header) | |
5864 (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
|
5865 (gnus-run-hooks 'gnus-select-article-hook) |
17493 | 5866 (when (and gnus-current-article |
5867 (not (zerop gnus-current-article))) | |
5868 (gnus-summary-goto-subject gnus-current-article)) | |
5869 (gnus-summary-recenter) | |
5870 (when (and gnus-use-trees gnus-show-threads) | |
5871 (gnus-possibly-generate-tree article) | |
5872 (gnus-highlight-selected-tree article)) | |
5873 ;; Successfully display article. | |
5874 (gnus-article-set-window-start | |
5875 (cdr (assq article gnus-newsgroup-bookmarks)))))) | |
5876 | |
5877 (defun gnus-summary-select-article (&optional all-headers force pseudo article) | |
5878 "Select the current article. | |
5879 If ALL-HEADERS is non-nil, show all header fields. If FORCE is | |
5880 non-nil, the article will be re-fetched even if it already present in | |
5881 the article buffer. If PSEUDO is non-nil, pseudo-articles will also | |
5882 be displayed." | |
5883 ;; Make sure we are in the summary buffer to work around bbdb bug. | |
5884 (unless (eq major-mode 'gnus-summary-mode) | |
5885 (set-buffer gnus-summary-buffer)) | |
5886 (let ((article (or article (gnus-summary-article-number))) | |
5887 (all-headers (not (not all-headers))) ;Must be T or NIL. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5888 gnus-summary-display-article-function) |
17493 | 5889 (and (not pseudo) |
5890 (gnus-summary-article-pseudo-p article) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5891 (error "This is a pseudo-article")) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5892 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5893 (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5894 (if (or (and gnus-single-article-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5895 (or (null gnus-current-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5896 (null gnus-article-current) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5897 (null (get-buffer gnus-article-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5898 (not (eq article (cdr gnus-article-current))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5899 (not (equal (car gnus-article-current) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5900 gnus-newsgroup-name)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5901 (and (not gnus-single-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5902 (or (null gnus-current-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5903 (not (eq gnus-current-article article)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5904 force) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5905 ;; The requested article is different from the current article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5906 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5907 (gnus-summary-display-article article all-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5908 (when (gnus-buffer-live-p gnus-article-buffer) |
32975
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
5909 (with-current-buffer gnus-article-buffer |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5910 (if (not gnus-article-decoded-p) ;; a local variable |
32975
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
5911 (mm-disable-multibyte-mule4)))) |
17493 | 5912 (when (or all-headers gnus-show-all-headers) |
5913 (gnus-article-show-all-headers)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5914 (gnus-article-set-window-start |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5915 (cdr (assq article gnus-newsgroup-bookmarks))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5916 article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5917 (when (or all-headers gnus-show-all-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5918 (gnus-article-show-all-headers)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5919 'old)))) |
17493 | 5920 |
5921 (defun gnus-summary-set-current-mark (&optional current-mark) | |
5922 "Obsolete function." | |
5923 nil) | |
5924 | |
5925 (defun gnus-summary-next-article (&optional unread subject backward push) | |
5926 "Select the next article. | |
5927 If UNREAD, only unread articles are selected. | |
5928 If SUBJECT, only articles with SUBJECT are selected. | |
5929 If BACKWARD, the previous article is selected instead of the next." | |
5930 (interactive "P") | |
5931 (cond | |
5932 ;; Is there such an article? | |
5933 ((and (gnus-summary-search-forward unread subject backward) | |
5934 (or (gnus-summary-display-article (gnus-summary-article-number)) | |
5935 (eq (gnus-summary-article-mark) gnus-canceled-mark))) | |
5936 (gnus-summary-position-point)) | |
5937 ;; If not, we try the first unread, if that is wanted. | |
5938 ((and subject | |
5939 gnus-auto-select-same | |
5940 (gnus-summary-first-unread-article)) | |
5941 (gnus-summary-position-point) | |
5942 (gnus-message 6 "Wrapped")) | |
5943 ;; Try to get next/previous article not displayed in this group. | |
5944 ((and gnus-auto-extend-newsgroup | |
5945 (not unread) (not subject)) | |
5946 (gnus-summary-goto-article | |
5947 (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
|
5948 nil (count-lines (point-min) (point)))) |
17493 | 5949 ;; Go to next/previous group. |
5950 (t | |
5951 (unless (gnus-ephemeral-group-p gnus-newsgroup-name) | |
5952 (gnus-summary-jump-to-group gnus-newsgroup-name)) | |
5953 (let ((cmd last-command-char) | |
5954 (point | |
5955 (save-excursion | |
5956 (set-buffer gnus-group-buffer) | |
5957 (point))) | |
5958 (group | |
5959 (if (eq gnus-keep-same-level 'best) | |
5960 (gnus-summary-best-group gnus-newsgroup-name) | |
5961 (gnus-summary-search-group backward gnus-keep-same-level)))) | |
5962 ;; For some reason, the group window gets selected. We change | |
5963 ;; it back. | |
5964 (select-window (get-buffer-window (current-buffer))) | |
5965 ;; Select next unread newsgroup automagically. | |
5966 (cond | |
5967 ((or (not gnus-auto-select-next) | |
5968 (not cmd)) | |
5969 (gnus-message 7 "No more%s articles" (if unread " unread" ""))) | |
5970 ((or (eq gnus-auto-select-next 'quietly) | |
5971 (and (eq gnus-auto-select-next 'slightly-quietly) | |
5972 push) | |
5973 (and (eq gnus-auto-select-next 'almost-quietly) | |
5974 (gnus-summary-last-article-p))) | |
5975 ;; Select quietly. | |
5976 (if (gnus-ephemeral-group-p gnus-newsgroup-name) | |
5977 (gnus-summary-exit) | |
5978 (gnus-message 7 "No more%s articles (%s)..." | |
5979 (if unread " unread" "") | |
5980 (if group (concat "selecting " group) | |
5981 "exiting")) | |
5982 (gnus-summary-next-group nil group backward))) | |
5983 (t | |
5984 (when (gnus-key-press-event-p last-input-event) | |
5985 (gnus-summary-walk-group-buffer | |
5986 gnus-newsgroup-name cmd unread backward point)))))))) | |
5987 | |
5988 (defun gnus-summary-walk-group-buffer (from-group cmd unread backward start) | |
5989 (let ((keystrokes '((?\C-n (gnus-group-next-unread-group 1)) | |
5990 (?\C-p (gnus-group-prev-unread-group 1)))) | |
5991 (cursor-in-echo-area t) | |
5992 keve key group ended) | |
5993 (save-excursion | |
5994 (set-buffer gnus-group-buffer) | |
5995 (goto-char start) | |
5996 (setq group | |
5997 (if (eq gnus-keep-same-level 'best) | |
5998 (gnus-summary-best-group gnus-newsgroup-name) | |
5999 (gnus-summary-search-group backward gnus-keep-same-level)))) | |
6000 (while (not ended) | |
6001 (gnus-message | |
6002 5 "No more%s articles%s" (if unread " unread" "") | |
6003 (if (and group | |
6004 (not (gnus-ephemeral-group-p gnus-newsgroup-name))) | |
6005 (format " (Type %s for %s [%s])" | |
6006 (single-key-description cmd) group | |
6007 (car (gnus-gethash group gnus-newsrc-hashtb))) | |
6008 (format " (Type %s to exit %s)" | |
6009 (single-key-description cmd) | |
6010 gnus-newsgroup-name))) | |
6011 ;; Confirm auto selection. | |
6012 (setq key (car (setq keve (gnus-read-event-char)))) | |
6013 (setq ended t) | |
6014 (cond | |
6015 ((assq key keystrokes) | |
6016 (let ((obuf (current-buffer))) | |
6017 (switch-to-buffer gnus-group-buffer) | |
6018 (when group | |
6019 (gnus-group-jump-to-group group)) | |
6020 (eval (cadr (assq key keystrokes))) | |
6021 (setq group (gnus-group-group-name)) | |
6022 (switch-to-buffer obuf)) | |
6023 (setq ended nil)) | |
6024 ((equal key cmd) | |
6025 (if (or (not group) | |
6026 (gnus-ephemeral-group-p gnus-newsgroup-name)) | |
6027 (gnus-summary-exit) | |
6028 (gnus-summary-next-group nil group backward))) | |
6029 (t | |
6030 (push (cdr keve) unread-command-events)))))) | |
6031 | |
6032 (defun gnus-summary-next-unread-article () | |
6033 "Select unread article after current one." | |
6034 (interactive) | |
6035 (gnus-summary-next-article | |
6036 (or (not (eq gnus-summary-goto-unread 'never)) | |
6037 (gnus-summary-last-article-p (gnus-summary-article-number))) | |
6038 (and gnus-auto-select-same | |
6039 (gnus-summary-article-subject)))) | |
6040 | |
6041 (defun gnus-summary-prev-article (&optional unread subject) | |
6042 "Select the article after the current one. | |
6043 If UNREAD is non-nil, only unread articles are selected." | |
6044 (interactive "P") | |
6045 (gnus-summary-next-article unread subject t)) | |
6046 | |
6047 (defun gnus-summary-prev-unread-article () | |
6048 "Select unread article before current one." | |
6049 (interactive) | |
6050 (gnus-summary-prev-article | |
6051 (or (not (eq gnus-summary-goto-unread 'never)) | |
6052 (gnus-summary-first-article-p (gnus-summary-article-number))) | |
6053 (and gnus-auto-select-same | |
6054 (gnus-summary-article-subject)))) | |
6055 | |
6056 (defun gnus-summary-next-page (&optional lines circular) | |
6057 "Show next page of the selected article. | |
6058 If at the end of the current article, select the next article. | |
6059 LINES says how many lines should be scrolled up. | |
6060 | |
6061 If CIRCULAR is non-nil, go to the start of the article instead of | |
6062 selecting the next article when reaching the end of the current | |
6063 article." | |
6064 (interactive "P") | |
6065 (setq gnus-summary-buffer (current-buffer)) | |
6066 (gnus-set-global-variables) | |
6067 (let ((article (gnus-summary-article-number)) | |
6068 (article-window (get-buffer-window gnus-article-buffer t)) | |
6069 endp) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6070 ;; 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
|
6071 (unless article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6072 (error "No article to select")) |
17493 | 6073 (gnus-configure-windows 'article) |
6074 (if (eq (cdr (assq article gnus-newsgroup-reads)) gnus-canceled-mark) | |
6075 (if (and (eq gnus-summary-goto-unread 'never) | |
6076 (not (gnus-summary-last-article-p article))) | |
6077 (gnus-summary-next-article) | |
6078 (gnus-summary-next-unread-article)) | |
6079 (if (or (null gnus-current-article) | |
6080 (null gnus-article-current) | |
6081 (/= article (cdr gnus-article-current)) | |
6082 (not (equal (car gnus-article-current) gnus-newsgroup-name))) | |
6083 ;; Selected subject is different from current article's. | |
6084 (gnus-summary-display-article article) | |
6085 (when article-window | |
6086 (gnus-eval-in-buffer-window gnus-article-buffer | |
6087 (setq endp (gnus-article-next-page lines))) | |
6088 (when endp | |
6089 (cond (circular | |
6090 (gnus-summary-beginning-of-article)) | |
6091 (lines | |
6092 (gnus-message 3 "End of message")) | |
6093 ((null lines) | |
6094 (if (and (eq gnus-summary-goto-unread 'never) | |
6095 (not (gnus-summary-last-article-p article))) | |
6096 (gnus-summary-next-article) | |
6097 (gnus-summary-next-unread-article)))))))) | |
6098 (gnus-summary-recenter) | |
6099 (gnus-summary-position-point))) | |
6100 | |
6101 (defun gnus-summary-prev-page (&optional lines move) | |
6102 "Show previous page of selected article. | |
6103 Argument LINES specifies lines to be scrolled down. | |
6104 If MOVE, move to the previous unread article if point is at | |
6105 the beginning of the buffer." | |
6106 (interactive "P") | |
6107 (let ((article (gnus-summary-article-number)) | |
6108 (article-window (get-buffer-window gnus-article-buffer t)) | |
6109 endp) | |
6110 (gnus-configure-windows 'article) | |
6111 (if (or (null gnus-current-article) | |
6112 (null gnus-article-current) | |
6113 (/= article (cdr gnus-article-current)) | |
6114 (not (equal (car gnus-article-current) gnus-newsgroup-name))) | |
6115 ;; Selected subject is different from current article's. | |
6116 (gnus-summary-display-article article) | |
6117 (gnus-summary-recenter) | |
6118 (when article-window | |
6119 (gnus-eval-in-buffer-window gnus-article-buffer | |
6120 (setq endp (gnus-article-prev-page lines))) | |
6121 (when (and move endp) | |
6122 (cond (lines | |
6123 (gnus-message 3 "Beginning of message")) | |
6124 ((null lines) | |
6125 (if (and (eq gnus-summary-goto-unread 'never) | |
6126 (not (gnus-summary-first-article-p article))) | |
6127 (gnus-summary-prev-article) | |
6128 (gnus-summary-prev-unread-article)))))))) | |
6129 (gnus-summary-position-point)) | |
6130 | |
6131 (defun gnus-summary-prev-page-or-article (&optional lines) | |
6132 "Show previous page of selected article. | |
6133 Argument LINES specifies lines to be scrolled down. | |
6134 If at the beginning of the article, go to the next article." | |
6135 (interactive "P") | |
6136 (gnus-summary-prev-page lines t)) | |
6137 | |
6138 (defun gnus-summary-scroll-up (lines) | |
6139 "Scroll up (or down) one line current article. | |
6140 Argument LINES specifies lines to be scrolled up (or down if negative)." | |
6141 (interactive "p") | |
6142 (gnus-configure-windows 'article) | |
6143 (gnus-summary-show-thread) | |
6144 (when (eq (gnus-summary-select-article nil nil 'pseudo) 'old) | |
6145 (gnus-eval-in-buffer-window gnus-article-buffer | |
6146 (cond ((> lines 0) | |
6147 (when (gnus-article-next-page lines) | |
6148 (gnus-message 3 "End of message"))) | |
6149 ((< lines 0) | |
6150 (gnus-article-prev-page (- lines)))))) | |
6151 (gnus-summary-recenter) | |
6152 (gnus-summary-position-point)) | |
6153 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6154 (defun gnus-summary-scroll-down (lines) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6155 "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
|
6156 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
|
6157 (interactive "p") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6158 (gnus-summary-scroll-up (- lines))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6159 |
17493 | 6160 (defun gnus-summary-next-same-subject () |
6161 "Select next article which has the same subject as current one." | |
6162 (interactive) | |
6163 (gnus-summary-next-article nil (gnus-summary-article-subject))) | |
6164 | |
6165 (defun gnus-summary-prev-same-subject () | |
6166 "Select previous article which has the same subject as current one." | |
6167 (interactive) | |
6168 (gnus-summary-prev-article nil (gnus-summary-article-subject))) | |
6169 | |
6170 (defun gnus-summary-next-unread-same-subject () | |
6171 "Select next unread article which has the same subject as current one." | |
6172 (interactive) | |
6173 (gnus-summary-next-article t (gnus-summary-article-subject))) | |
6174 | |
6175 (defun gnus-summary-prev-unread-same-subject () | |
6176 "Select previous unread article which has the same subject as current one." | |
6177 (interactive) | |
6178 (gnus-summary-prev-article t (gnus-summary-article-subject))) | |
6179 | |
6180 (defun gnus-summary-first-unread-article () | |
6181 "Select the first unread article. | |
6182 Return nil if there are no unread articles." | |
6183 (interactive) | |
6184 (prog1 | |
6185 (when (gnus-summary-first-subject t) | |
6186 (gnus-summary-show-thread) | |
6187 (gnus-summary-first-subject t) | |
6188 (gnus-summary-display-article (gnus-summary-article-number))) | |
6189 (gnus-summary-position-point))) | |
6190 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6191 (defun gnus-summary-first-unread-subject () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6192 "Place the point on the subject line of the first unread article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6193 Return nil if there are no unread articles." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6194 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6195 (prog1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6196 (when (gnus-summary-first-subject t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6197 (gnus-summary-show-thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6198 (gnus-summary-first-subject t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6199 (gnus-summary-position-point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6200 |
17493 | 6201 (defun gnus-summary-first-article () |
6202 "Select the first article. | |
6203 Return nil if there are no articles." | |
6204 (interactive) | |
6205 (prog1 | |
6206 (when (gnus-summary-first-subject) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6207 (gnus-summary-show-thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6208 (gnus-summary-first-subject) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6209 (gnus-summary-display-article (gnus-summary-article-number))) |
17493 | 6210 (gnus-summary-position-point))) |
6211 | |
6212 (defun gnus-summary-best-unread-article () | |
6213 "Select the unread article with the highest score." | |
6214 (interactive) | |
6215 (let ((best -1000000) | |
6216 (data gnus-newsgroup-data) | |
6217 article score) | |
6218 (while data | |
6219 (and (gnus-data-unread-p (car data)) | |
6220 (> (setq score | |
6221 (gnus-summary-article-score (gnus-data-number (car data)))) | |
6222 best) | |
6223 (setq best score | |
6224 article (gnus-data-number (car data)))) | |
6225 (setq data (cdr data))) | |
6226 (prog1 | |
6227 (if article | |
6228 (gnus-summary-goto-article article) | |
6229 (error "No unread articles")) | |
6230 (gnus-summary-position-point)))) | |
6231 | |
6232 (defun gnus-summary-last-subject () | |
6233 "Go to the last displayed subject line in the group." | |
6234 (let ((article (gnus-data-number (car (gnus-data-list t))))) | |
6235 (when article | |
6236 (gnus-summary-goto-subject article)))) | |
6237 | |
6238 (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
|
6239 "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
|
6240 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
|
6241 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
|
6242 is a number, it is the line the article is to be displayed on." |
17493 | 6243 (interactive |
6244 (list | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6245 (completing-read |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6246 "Article number or Message-ID: " |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6247 (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
|
6248 gnus-newsgroup-limit)) |
17493 | 6249 current-prefix-arg |
6250 t)) | |
6251 (prog1 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6252 (if (and (stringp article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6253 (string-match "@" article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6254 (gnus-summary-refer-article article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6255 (when (stringp article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6256 (setq article (string-to-number article))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6257 (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
|
6258 (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
|
6259 (gnus-message 4 "Couldn't go to article %s" article) nil)) |
17493 | 6260 (gnus-summary-position-point))) |
6261 | |
6262 (defun gnus-summary-goto-last-article () | |
6263 "Go to the previously read article." | |
6264 (interactive) | |
6265 (prog1 | |
6266 (when gnus-last-article | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6267 (gnus-summary-goto-article gnus-last-article nil t)) |
17493 | 6268 (gnus-summary-position-point))) |
6269 | |
6270 (defun gnus-summary-pop-article (number) | |
6271 "Pop one article off the history and go to the previous. | |
6272 NUMBER articles will be popped off." | |
6273 (interactive "p") | |
6274 (let (to) | |
6275 (setq gnus-newsgroup-history | |
6276 (cdr (setq to (nthcdr number gnus-newsgroup-history)))) | |
6277 (if to | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6278 (gnus-summary-goto-article (car to) nil t) |
17493 | 6279 (error "Article history empty"))) |
6280 (gnus-summary-position-point)) | |
6281 | |
6282 ;; Summary commands and functions for limiting the summary buffer. | |
6283 | |
6284 (defun gnus-summary-limit-to-articles (n) | |
6285 "Limit the summary buffer to the next N articles. | |
6286 If not given a prefix, use the process marked articles instead." | |
6287 (interactive "P") | |
6288 (prog1 | |
6289 (let ((articles (gnus-summary-work-articles n))) | |
6290 (setq gnus-newsgroup-processable nil) | |
6291 (gnus-summary-limit articles)) | |
6292 (gnus-summary-position-point))) | |
6293 | |
6294 (defun gnus-summary-pop-limit (&optional total) | |
6295 "Restore the previous limit. | |
6296 If given a prefix, remove all limits." | |
6297 (interactive "P") | |
6298 (when total | |
6299 (setq gnus-newsgroup-limits | |
6300 (list (mapcar (lambda (h) (mail-header-number h)) | |
6301 gnus-newsgroup-headers)))) | |
6302 (unless gnus-newsgroup-limits | |
6303 (error "No limit to pop")) | |
6304 (prog1 | |
6305 (gnus-summary-limit nil 'pop) | |
6306 (gnus-summary-position-point))) | |
6307 | |
6308 (defun gnus-summary-limit-to-subject (subject &optional header) | |
6309 "Limit the summary buffer to articles that have subjects that match a regexp." | |
6310 (interactive "sLimit to subject (regexp): ") | |
6311 (unless header | |
6312 (setq header "subject")) | |
6313 (when (not (equal "" subject)) | |
6314 (prog1 | |
6315 (let ((articles (gnus-summary-find-matching | |
6316 (or header "subject") subject 'all))) | |
6317 (unless articles | |
6318 (error "Found no matches for \"%s\"" subject)) | |
6319 (gnus-summary-limit articles)) | |
6320 (gnus-summary-position-point)))) | |
6321 | |
6322 (defun gnus-summary-limit-to-author (from) | |
6323 "Limit the summary buffer to articles that have authors that match a regexp." | |
6324 (interactive "sLimit to author (regexp): ") | |
6325 (gnus-summary-limit-to-subject from "from")) | |
6326 | |
6327 (defun gnus-summary-limit-to-age (age &optional younger-p) | |
6328 "Limit the summary buffer to articles that are older than (or equal) AGE days. | |
6329 If YOUNGER-P (the prefix) is non-nil, limit the summary buffer to | |
6330 articles that are younger than AGE days." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6331 (interactive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6332 (let ((younger current-prefix-arg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6333 (days-got nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6334 days) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6335 (while (not days-got) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6336 (setq days (if younger |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6337 (read-string "Limit to articles within (in days): ") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6338 (read-string "Limit to articles old than (in days): "))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6339 (when (> (length days) 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6340 (setq days (read days))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6341 (if (numberp days) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6342 (setq days-got t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6343 (message "Please enter a number.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6344 (sleep-for 1))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6345 (list days younger))) |
17493 | 6346 (prog1 |
6347 (let ((data gnus-newsgroup-data) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6348 (cutoff (days-to-time age)) |
17493 | 6349 articles d date is-younger) |
6350 (while (setq d (pop data)) | |
6351 (when (and (vectorp (gnus-data-header d)) | |
6352 (setq date (mail-header-date (gnus-data-header d)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6353 (setq is-younger (time-less-p |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6354 (time-since (condition-case () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6355 (date-to-time date) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6356 (error '(0 0)))) |
17493 | 6357 cutoff)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6358 (when (if younger-p |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6359 is-younger |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6360 (not is-younger)) |
17493 | 6361 (push (gnus-data-number d) articles)))) |
6362 (gnus-summary-limit (nreverse articles))) | |
6363 (gnus-summary-position-point))) | |
6364 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6365 (defun gnus-summary-limit-to-extra (header regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6366 "Limit the summary buffer to articles that match an 'extra' header." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6367 (interactive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6368 (let ((header |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6369 (intern |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6370 (gnus-completing-read |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6371 (symbol-name (car gnus-extra-headers)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6372 "Limit extra header:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6373 (mapcar (lambda (x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6374 (cons (symbol-name x) x)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6375 gnus-extra-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6376 nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6377 t)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6378 (list header |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6379 (read-string (format "Limit to header %s (regexp): " header))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6380 (when (not (equal "" regexp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6381 (prog1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6382 (let ((articles (gnus-summary-find-matching |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6383 (cons 'extra header) regexp 'all))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6384 (unless articles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6385 (error "Found no matches for \"%s\"" regexp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6386 (gnus-summary-limit articles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6387 (gnus-summary-position-point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6388 |
17493 | 6389 (defalias 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread) |
6390 (make-obsolete | |
6391 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread) | |
6392 | |
6393 (defun gnus-summary-limit-to-unread (&optional all) | |
6394 "Limit the summary buffer to articles that are not marked as read. | |
6395 If ALL is non-nil, limit strictly to unread articles." | |
6396 (interactive "P") | |
6397 (if all | |
6398 (gnus-summary-limit-to-marks (char-to-string gnus-unread-mark)) | |
6399 (gnus-summary-limit-to-marks | |
6400 ;; Concat all the marks that say that an article is read and have | |
6401 ;; those removed. | |
6402 (list gnus-del-mark gnus-read-mark gnus-ancient-mark | |
6403 gnus-killed-mark gnus-kill-file-mark | |
6404 gnus-low-score-mark gnus-expirable-mark | |
6405 gnus-canceled-mark gnus-catchup-mark gnus-sparse-mark | |
6406 gnus-duplicate-mark gnus-souped-mark) | |
6407 'reverse))) | |
6408 | |
6409 (defalias 'gnus-summary-delete-marked-with 'gnus-summary-limit-exclude-marks) | |
6410 (make-obsolete 'gnus-summary-delete-marked-with | |
6411 'gnus-summary-limit-exlude-marks) | |
6412 | |
6413 (defun gnus-summary-limit-exclude-marks (marks &optional reverse) | |
6414 "Exclude articles that are marked with MARKS (e.g. \"DK\"). | |
6415 If REVERSE, limit the summary buffer to articles that are marked | |
6416 with MARKS. MARKS can either be a string of marks or a list of marks. | |
6417 Returns how many articles were removed." | |
6418 (interactive "sMarks: ") | |
6419 (gnus-summary-limit-to-marks marks t)) | |
6420 | |
6421 (defun gnus-summary-limit-to-marks (marks &optional reverse) | |
6422 "Limit the summary buffer to articles that are marked with MARKS (e.g. \"DK\"). | |
6423 If REVERSE (the prefix), limit the summary buffer to articles that are | |
6424 not marked with MARKS. MARKS can either be a string of marks or a | |
6425 list of marks. | |
6426 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
|
6427 (interactive "sMarks: \nP") |
17493 | 6428 (prog1 |
6429 (let ((data gnus-newsgroup-data) | |
6430 (marks (if (listp marks) marks | |
6431 (append marks nil))) ; Transform to list. | |
6432 articles) | |
6433 (while data | |
6434 (when (if reverse (not (memq (gnus-data-mark (car data)) marks)) | |
6435 (memq (gnus-data-mark (car data)) marks)) | |
6436 (push (gnus-data-number (car data)) articles)) | |
6437 (setq data (cdr data))) | |
6438 (gnus-summary-limit articles)) | |
6439 (gnus-summary-position-point))) | |
6440 | |
6441 (defun gnus-summary-limit-to-score (&optional score) | |
6442 "Limit to articles with score at or above SCORE." | |
6443 (interactive "P") | |
6444 (setq score (if score | |
6445 (prefix-numeric-value score) | |
6446 (or gnus-summary-default-score 0))) | |
6447 (let ((data gnus-newsgroup-data) | |
6448 articles) | |
6449 (while data | |
6450 (when (>= (gnus-summary-article-score (gnus-data-number (car data))) | |
6451 score) | |
6452 (push (gnus-data-number (car data)) articles)) | |
6453 (setq data (cdr data))) | |
6454 (prog1 | |
6455 (gnus-summary-limit articles) | |
6456 (gnus-summary-position-point)))) | |
6457 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6458 (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
|
6459 "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
|
6460 (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
|
6461 (let ((articles (gnus-articles-in-thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6462 (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
|
6463 (prog1 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6464 (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
|
6465 (gnus-summary-position-point)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6466 |
17493 | 6467 (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
|
6468 "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
|
6469 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
|
6470 fetched for this group." |
17493 | 6471 (interactive) |
6472 (unless gnus-newsgroup-dormant | |
6473 (error "There are no dormant articles in this group")) | |
6474 (prog1 | |
6475 (gnus-summary-limit (append gnus-newsgroup-dormant gnus-newsgroup-limit)) | |
6476 (gnus-summary-position-point))) | |
6477 | |
6478 (defun gnus-summary-limit-exclude-dormant () | |
6479 "Hide all dormant articles." | |
6480 (interactive) | |
6481 (prog1 | |
6482 (gnus-summary-limit-to-marks (list gnus-dormant-mark) 'reverse) | |
6483 (gnus-summary-position-point))) | |
6484 | |
6485 (defun gnus-summary-limit-exclude-childless-dormant () | |
6486 "Hide all dormant articles that have no children." | |
6487 (interactive) | |
6488 (let ((data (gnus-data-list t)) | |
6489 articles d children) | |
6490 ;; Find all articles that are either not dormant or have | |
6491 ;; children. | |
6492 (while (setq d (pop data)) | |
6493 (when (or (not (= (gnus-data-mark d) gnus-dormant-mark)) | |
6494 (and (setq children | |
6495 (gnus-article-children (gnus-data-number d))) | |
6496 (let (found) | |
6497 (while children | |
6498 (when (memq (car children) articles) | |
6499 (setq children nil | |
6500 found t)) | |
6501 (pop children)) | |
6502 found))) | |
6503 (push (gnus-data-number d) articles))) | |
6504 ;; Do the limiting. | |
6505 (prog1 | |
6506 (gnus-summary-limit articles) | |
6507 (gnus-summary-position-point)))) | |
6508 | |
6509 (defun gnus-summary-limit-mark-excluded-as-read (&optional all) | |
6510 "Mark all unread excluded articles as read. | |
6511 If ALL, mark even excluded ticked and dormants as read." | |
6512 (interactive "P") | |
6513 (let ((articles (gnus-sorted-complement | |
6514 (sort | |
6515 (mapcar (lambda (h) (mail-header-number h)) | |
6516 gnus-newsgroup-headers) | |
6517 '<) | |
6518 (sort gnus-newsgroup-limit '<))) | |
6519 article) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6520 (setq gnus-newsgroup-unreads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6521 (gnus-intersection gnus-newsgroup-unreads gnus-newsgroup-limit)) |
17493 | 6522 (if all |
6523 (setq gnus-newsgroup-dormant nil | |
6524 gnus-newsgroup-marked nil | |
6525 gnus-newsgroup-reads | |
6526 (nconc | |
6527 (mapcar (lambda (n) (cons n gnus-catchup-mark)) articles) | |
6528 gnus-newsgroup-reads)) | |
6529 (while (setq article (pop articles)) | |
6530 (unless (or (memq article gnus-newsgroup-dormant) | |
6531 (memq article gnus-newsgroup-marked)) | |
6532 (push (cons article gnus-catchup-mark) gnus-newsgroup-reads)))))) | |
6533 | |
6534 (defun gnus-summary-limit (articles &optional pop) | |
6535 (if pop | |
6536 ;; We pop the previous limit off the stack and use that. | |
6537 (setq articles (car gnus-newsgroup-limits) | |
6538 gnus-newsgroup-limits (cdr gnus-newsgroup-limits)) | |
6539 ;; We use the new limit, so we push the old limit on the stack. | |
6540 (push gnus-newsgroup-limit gnus-newsgroup-limits)) | |
6541 ;; Set the limit. | |
6542 (setq gnus-newsgroup-limit articles) | |
6543 (let ((total (length gnus-newsgroup-data)) | |
6544 (data (gnus-data-find-list (gnus-summary-article-number))) | |
6545 (gnus-summary-mark-below nil) ; Inhibit this. | |
6546 found) | |
6547 ;; This will do all the work of generating the new summary buffer | |
6548 ;; according to the new limit. | |
6549 (gnus-summary-prepare) | |
6550 ;; Hide any threads, possibly. | |
6551 (and gnus-show-threads | |
6552 gnus-thread-hide-subtree | |
6553 (gnus-summary-hide-all-threads)) | |
6554 ;; Try to return to the article you were at, or one in the | |
6555 ;; neighborhood. | |
6556 (when data | |
6557 ;; We try to find some article after the current one. | |
6558 (while data | |
6559 (when (gnus-summary-goto-subject (gnus-data-number (car data)) nil t) | |
6560 (setq data nil | |
6561 found t)) | |
6562 (setq data (cdr data)))) | |
6563 (unless found | |
6564 ;; If there is no data, that means that we were after the last | |
6565 ;; article. The same goes when we can't find any articles | |
6566 ;; after the current one. | |
6567 (goto-char (point-max)) | |
6568 (gnus-summary-find-prev)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6569 (gnus-set-mode-line 'summary) |
17493 | 6570 ;; We return how many articles were removed from the summary |
6571 ;; buffer as a result of the new limit. | |
6572 (- total (length gnus-newsgroup-data)))) | |
6573 | |
6574 (defsubst gnus-invisible-cut-children (threads) | |
6575 (let ((num 0)) | |
6576 (while threads | |
6577 (when (memq (mail-header-number (caar threads)) gnus-newsgroup-limit) | |
6578 (incf num)) | |
6579 (pop threads)) | |
6580 (< num 2))) | |
6581 | |
6582 (defsubst gnus-cut-thread (thread) | |
6583 "Go forwards in the thread until we find an article that we want to display." | |
6584 (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
|
6585 (eq gnus-fetch-old-headers 'invisible) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6586 (numberp gnus-fetch-old-headers) |
17493 | 6587 (eq gnus-build-sparse-threads 'some) |
6588 (eq gnus-build-sparse-threads 'more)) | |
6589 ;; Deal with old-fetched headers and sparse threads. | |
6590 (while (and | |
6591 thread | |
6592 (or | |
6593 (gnus-summary-article-sparse-p (mail-header-number (car thread))) | |
6594 (gnus-summary-article-ancient-p | |
6595 (mail-header-number (car thread)))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6596 (if (or (<= (length (cdr thread)) 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6597 (eq gnus-fetch-old-headers 'invisible)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6598 (setq gnus-newsgroup-limit |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6599 (delq (mail-header-number (car thread)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6600 gnus-newsgroup-limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6601 thread (cadr thread)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6602 (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
|
6603 (let ((th (cdr thread))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6604 (while th |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6605 (if (memq (mail-header-number (caar th)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6606 gnus-newsgroup-limit) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6607 (setq thread (car th) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6608 th nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6609 (setq th (cdr th)))))))))) |
17493 | 6610 thread) |
6611 | |
6612 (defun gnus-cut-threads (threads) | |
6613 "Cut off all uninteresting articles from the beginning of threads." | |
6614 (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
|
6615 (eq gnus-fetch-old-headers 'invisible) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6616 (numberp gnus-fetch-old-headers) |
17493 | 6617 (eq gnus-build-sparse-threads 'some) |
6618 (eq gnus-build-sparse-threads 'more)) | |
6619 (let ((th threads)) | |
6620 (while th | |
6621 (setcar th (gnus-cut-thread (car th))) | |
6622 (setq th (cdr th))))) | |
6623 ;; Remove nixed out threads. | |
6624 (delq nil threads)) | |
6625 | |
6626 (defun gnus-summary-initial-limit (&optional show-if-empty) | |
6627 "Figure out what the initial limit is supposed to be on group entry. | |
6628 This entails weeding out unwanted dormants, low-scored articles, | |
6629 fetch-old-headers verbiage, and so on." | |
6630 ;; Most groups have nothing to remove. | |
6631 (if (or gnus-inhibit-limiting | |
6632 (and (null gnus-newsgroup-dormant) | |
6633 (not (eq gnus-fetch-old-headers 'some)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6634 (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
|
6635 (not (eq gnus-fetch-old-headers 'invisible)) |
17493 | 6636 (null gnus-summary-expunge-below) |
6637 (not (eq gnus-build-sparse-threads 'some)) | |
6638 (not (eq gnus-build-sparse-threads 'more)) | |
6639 (null gnus-thread-expunge-below) | |
6640 (not gnus-use-nocem))) | |
6641 () ; Do nothing. | |
6642 (push gnus-newsgroup-limit gnus-newsgroup-limits) | |
6643 (setq gnus-newsgroup-limit nil) | |
6644 (mapatoms | |
6645 (lambda (node) | |
6646 (unless (car (symbol-value node)) | |
6647 ;; These threads have no parents -- they are roots. | |
6648 (let ((nodes (cdr (symbol-value node))) | |
6649 thread) | |
6650 (while nodes | |
6651 (if (and gnus-thread-expunge-below | |
6652 (< (gnus-thread-total-score (car nodes)) | |
6653 gnus-thread-expunge-below)) | |
6654 (gnus-expunge-thread (pop nodes)) | |
6655 (setq thread (pop nodes)) | |
6656 (gnus-summary-limit-children thread)))))) | |
6657 gnus-newsgroup-dependencies) | |
6658 ;; If this limitation resulted in an empty group, we might | |
6659 ;; pop the previous limit and use it instead. | |
6660 (when (and (not gnus-newsgroup-limit) | |
6661 show-if-empty) | |
6662 (setq gnus-newsgroup-limit (pop gnus-newsgroup-limits))) | |
6663 gnus-newsgroup-limit)) | |
6664 | |
6665 (defun gnus-summary-limit-children (thread) | |
6666 "Return 1 if this subthread is visible and 0 if it is not." | |
6667 ;; First we get the number of visible children to this thread. This | |
6668 ;; is done by recursing down the thread using this function, so this | |
6669 ;; will really go down to a leaf article first, before slowly | |
6670 ;; working its way up towards the root. | |
6671 (when thread | |
6672 (let ((children | |
6673 (if (cdr thread) | |
6674 (apply '+ (mapcar 'gnus-summary-limit-children | |
6675 (cdr thread))) | |
6676 0)) | |
6677 (number (mail-header-number (car thread))) | |
6678 score) | |
6679 (if (and | |
6680 (not (memq number gnus-newsgroup-marked)) | |
6681 (or | |
6682 ;; If this article is dormant and has absolutely no visible | |
6683 ;; children, then this article isn't visible. | |
6684 (and (memq number gnus-newsgroup-dormant) | |
6685 (zerop children)) | |
6686 ;; If this is "fetch-old-headered" and there is no | |
6687 ;; visible children, then we don't want this article. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6688 (and (or (eq gnus-fetch-old-headers 'some) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6689 (numberp gnus-fetch-old-headers)) |
17493 | 6690 (gnus-summary-article-ancient-p number) |
6691 (zerop children)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6692 ;; 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
|
6693 ;; we don't want this article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6694 (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
|
6695 (gnus-summary-article-ancient-p number)) |
17493 | 6696 ;; If this is a sparsely inserted article with no children, |
6697 ;; we don't want it. | |
6698 (and (eq gnus-build-sparse-threads 'some) | |
6699 (gnus-summary-article-sparse-p number) | |
6700 (zerop children)) | |
6701 ;; If we use expunging, and this article is really | |
6702 ;; low-scored, then we don't want this article. | |
6703 (when (and gnus-summary-expunge-below | |
6704 (< (setq score | |
6705 (or (cdr (assq number gnus-newsgroup-scored)) | |
6706 gnus-summary-default-score)) | |
6707 gnus-summary-expunge-below)) | |
6708 ;; We increase the expunge-tally here, but that has | |
6709 ;; nothing to do with the limits, really. | |
6710 (incf gnus-newsgroup-expunged-tally) | |
6711 ;; We also mark as read here, if that's wanted. | |
6712 (when (and gnus-summary-mark-below | |
6713 (< score gnus-summary-mark-below)) | |
6714 (setq gnus-newsgroup-unreads | |
6715 (delq number gnus-newsgroup-unreads)) | |
6716 (if gnus-newsgroup-auto-expire | |
6717 (push number gnus-newsgroup-expirable) | |
6718 (push (cons number gnus-low-score-mark) | |
6719 gnus-newsgroup-reads))) | |
6720 t) | |
6721 ;; Check NoCeM things. | |
6722 (if (and gnus-use-nocem | |
6723 (gnus-nocem-unwanted-article-p | |
6724 (mail-header-id (car thread)))) | |
6725 (progn | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6726 (setq gnus-newsgroup-unreads |
17493 | 6727 (delq number gnus-newsgroup-unreads)) |
6728 t)))) | |
6729 ;; Nope, invisible article. | |
6730 0 | |
6731 ;; Ok, this article is to be visible, so we add it to the limit | |
6732 ;; and return 1. | |
6733 (push number gnus-newsgroup-limit) | |
6734 1)))) | |
6735 | |
6736 (defun gnus-expunge-thread (thread) | |
6737 "Mark all articles in THREAD as read." | |
6738 (let* ((number (mail-header-number (car thread)))) | |
6739 (incf gnus-newsgroup-expunged-tally) | |
6740 ;; We also mark as read here, if that's wanted. | |
6741 (setq gnus-newsgroup-unreads | |
6742 (delq number gnus-newsgroup-unreads)) | |
6743 (if gnus-newsgroup-auto-expire | |
6744 (push number gnus-newsgroup-expirable) | |
6745 (push (cons number gnus-low-score-mark) | |
6746 gnus-newsgroup-reads))) | |
6747 ;; Go recursively through all subthreads. | |
6748 (mapcar 'gnus-expunge-thread (cdr thread))) | |
6749 | |
6750 ;; Summary article oriented commands | |
6751 | |
6752 (defun gnus-summary-refer-parent-article (n) | |
6753 "Refer parent article N times. | |
6754 If N is negative, go to ancestor -N instead. | |
6755 The difference between N and the number of articles fetched is returned." | |
6756 (interactive "p") | |
6757 (let ((skip 1) | |
6758 error header ref) | |
6759 (when (not (natnump n)) | |
6760 (setq skip (abs n) | |
6761 n 1)) | |
6762 (while (and (> n 0) | |
6763 (not error)) | |
6764 (setq header (gnus-summary-article-header)) | |
6765 (if (and (eq (mail-header-number header) | |
6766 (cdr gnus-article-current)) | |
6767 (equal gnus-newsgroup-name | |
6768 (car gnus-article-current))) | |
6769 ;; If we try to find the parent of the currently | |
6770 ;; displayed article, then we take a look at the actual | |
6771 ;; References header, since this is slightly more | |
6772 ;; reliable than the References field we got from the | |
6773 ;; server. | |
6774 (save-excursion | |
6775 (set-buffer gnus-original-article-buffer) | |
6776 (nnheader-narrow-to-headers) | |
6777 (unless (setq ref (message-fetch-field "references")) | |
6778 (setq ref (message-fetch-field "in-reply-to"))) | |
6779 (widen)) | |
6780 (setq ref | |
6781 ;; It's not the current article, so we take a bet on | |
6782 ;; the value we got from the server. | |
6783 (mail-header-references header))) | |
6784 (if (and ref | |
6785 (not (equal ref ""))) | |
6786 (unless (gnus-summary-refer-article (gnus-parent-id ref skip)) | |
6787 (gnus-message 1 "Couldn't find parent")) | |
6788 (gnus-message 1 "No references in article %d" | |
6789 (gnus-summary-article-number)) | |
6790 (setq error t)) | |
6791 (decf n)) | |
6792 (gnus-summary-position-point) | |
6793 n)) | |
6794 | |
6795 (defun gnus-summary-refer-references () | |
6796 "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
|
6797 Return the number of articles fetched." |
17493 | 6798 (interactive) |
6799 (let ((ref (mail-header-references (gnus-summary-article-header))) | |
6800 (current (gnus-summary-article-number)) | |
6801 (n 0)) | |
6802 (if (or (not ref) | |
6803 (equal ref "")) | |
6804 (error "No References in the current article") | |
6805 ;; For each Message-ID in the References header... | |
6806 (while (string-match "<[^>]*>" ref) | |
6807 (incf n) | |
6808 ;; ... fetch that article. | |
6809 (gnus-summary-refer-article | |
6810 (prog1 (match-string 0 ref) | |
6811 (setq ref (substring ref (match-end 0)))))) | |
6812 (gnus-summary-goto-subject current) | |
6813 (gnus-summary-position-point) | |
6814 n))) | |
6815 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6816 (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
|
6817 "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
|
6818 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
|
6819 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
|
6820 (interactive "P") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6821 (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
|
6822 (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
|
6823 gnus-refer-thread-limit))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6824 ;; 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
|
6825 ;; 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
|
6826 ;; 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
|
6827 (when (numberp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6828 (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
|
6829 (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
|
6830 (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
|
6831 ;; 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
|
6832 (if (eq (gnus-retrieve-headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6833 (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
|
6834 'nov) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6835 (gnus-build-all-threads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6836 (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
|
6837 (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
|
6838 (gnus-summary-limit-include-thread id))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6839 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6840 (defun gnus-summary-refer-article (message-id) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6841 "Fetch an article specified by MESSAGE-ID." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6842 (interactive "sMessage-ID: ") |
17493 | 6843 (when (and (stringp message-id) |
6844 (not (zerop (length message-id)))) | |
6845 ;; Construct the correct Message-ID if necessary. | |
6846 ;; Suggested by tale@pawl.rpi.edu. | |
6847 (unless (string-match "^<" message-id) | |
6848 (setq message-id (concat "<" message-id))) | |
6849 (unless (string-match ">$" message-id) | |
6850 (setq message-id (concat message-id ">"))) | |
6851 (let* ((header (gnus-id-to-header message-id)) | |
6852 (sparse (and header | |
6853 (gnus-summary-article-sparse-p | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6854 (mail-header-number header)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6855 (memq (mail-header-number header) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6856 gnus-newsgroup-limit))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6857 number) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6858 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6859 ;; 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
|
6860 ((and header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6861 (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
|
6862 (mail-header-number header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6863 sparse)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6864 (prog1 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6865 (gnus-summary-goto-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6866 (mail-header-number header) nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6867 (when sparse |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6868 (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
|
6869 (t |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6870 ;; We fetch the article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6871 (catch 'found |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6872 (dolist (gnus-override-method (gnus-refer-article-methods)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6873 (gnus-check-server gnus-override-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6874 ;; Fetch the header, and display the article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6875 (when (setq number (gnus-summary-insert-subject message-id)) |
17493 | 6876 (gnus-summary-select-article nil nil nil number) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6877 (throw 'found t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6878 (gnus-message 3 "Couldn't fetch article %s" message-id))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6879 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6880 (defun gnus-refer-article-methods () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6881 "Return a list of referrable methods." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6882 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6883 ;; No method, so we default to current and native. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6884 ((null gnus-refer-article-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6885 (list gnus-current-select-method gnus-select-method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6886 ;; Current. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6887 ((eq 'current gnus-refer-article-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6888 (list gnus-current-select-method)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6889 ;; List of select methods. |
32975
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
6890 ((not (and (symbolp (car gnus-refer-article-method)) |
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
6891 (assq (car gnus-refer-article-method) nnoo-definition-alist))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6892 (let (out) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6893 (dolist (method gnus-refer-article-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6894 (push (if (eq 'current method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6895 gnus-current-select-method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6896 method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6897 out)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6898 (nreverse out))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6899 ;; One single select method. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6900 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6901 (list gnus-refer-article-method)))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6902 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6903 (defun gnus-summary-edit-parameters () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6904 "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
|
6905 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6906 (gnus-group-edit-group gnus-newsgroup-name 'params)) |
17493 | 6907 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6908 (defun gnus-summary-customize-parameters () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6909 "Customize the group parameters of the current group." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6910 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6911 (gnus-group-customize gnus-newsgroup-name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6912 |
17493 | 6913 (defun gnus-summary-enter-digest-group (&optional force) |
6914 "Enter an nndoc group based on the current article. | |
6915 If FORCE, force a digest interpretation. If not, try | |
6916 to guess what the document format is." | |
6917 (interactive "P") | |
6918 (let ((conf gnus-current-window-configuration)) | |
6919 (save-excursion | |
6920 (gnus-summary-select-article)) | |
6921 (setq gnus-current-window-configuration conf) | |
6922 (let* ((name (format "%s-%d" | |
6923 (gnus-group-prefixed-name | |
6924 gnus-newsgroup-name (list 'nndoc "")) | |
6925 (save-excursion | |
6926 (set-buffer gnus-summary-buffer) | |
6927 gnus-current-article))) | |
6928 (ogroup gnus-newsgroup-name) | |
6929 (params (append (gnus-info-params (gnus-get-info ogroup)) | |
6930 (list (cons 'to-group ogroup)) | |
6931 (list (cons 'save-article-group ogroup)))) | |
6932 (case-fold-search t) | |
6933 (buf (current-buffer)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6934 dig to-address) |
17493 | 6935 (save-excursion |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6936 (set-buffer gnus-original-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6937 ;; Have the digest group inherit the main mail address of |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6938 ;; the parent article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6939 (when (setq to-address (or (message-fetch-field "reply-to") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6940 (message-fetch-field "from"))) |
32975
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
6941 (setq params (append |
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
6942 (list (cons 'to-address |
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
6943 (funcall gnus-decode-encoded-word-function |
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
6944 to-address)))))) |
17493 | 6945 (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*")) |
6946 (insert-buffer-substring gnus-original-article-buffer) | |
6947 ;; Remove lines that may lead nndoc to misinterpret the | |
6948 ;; document type. | |
6949 (narrow-to-region | |
6950 (goto-char (point-min)) | |
6951 (or (search-forward "\n\n" nil t) (point))) | |
6952 (goto-char (point-min)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6953 (delete-matching-lines "^Path:\\|^From ") |
17493 | 6954 (widen)) |
6955 (unwind-protect | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6956 (if (let ((gnus-newsgroup-ephemeral-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6957 (gnus-newsgroup-ephemeral-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6958 gnus-newsgroup-ignored-charsets)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6959 (gnus-group-read-ephemeral-group |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6960 name `(nndoc ,name (nndoc-address ,(get-buffer dig)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6961 (nndoc-article-type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6962 ,(if force 'mbox 'guess))) t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6963 ;; Make all postings to this group go to the parent group. |
17493 | 6964 (nconc (gnus-info-params (gnus-get-info name)) |
6965 params) | |
6966 ;; Couldn't select this doc group. | |
6967 (switch-to-buffer buf) | |
6968 (gnus-set-global-variables) | |
6969 (gnus-configure-windows 'summary) | |
6970 (gnus-message 3 "Article couldn't be entered?")) | |
6971 (kill-buffer dig))))) | |
6972 | |
6973 (defun gnus-summary-read-document (n) | |
6974 "Open a new group based on the current article(s). | |
6975 This will allow you to read digests and other similar | |
6976 documents as newsgroups. | |
6977 Obeys the standard process/prefix convention." | |
6978 (interactive "P") | |
6979 (let* ((articles (gnus-summary-work-articles n)) | |
6980 (ogroup gnus-newsgroup-name) | |
6981 (params (append (gnus-info-params (gnus-get-info ogroup)) | |
6982 (list (cons 'to-group ogroup)))) | |
6983 article group egroup groups vgroup) | |
6984 (while (setq article (pop articles)) | |
6985 (setq group (format "%s-%d" gnus-newsgroup-name article)) | |
6986 (gnus-summary-remove-process-mark article) | |
6987 (when (gnus-summary-display-article article) | |
6988 (save-excursion | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6989 (with-temp-buffer |
17493 | 6990 (insert-buffer-substring gnus-original-article-buffer) |
6991 ;; Remove some headers that may lead nndoc to make | |
6992 ;; the wrong guess. | |
6993 (message-narrow-to-head) | |
6994 (goto-char (point-min)) | |
6995 (delete-matching-lines "^\\(Path\\):\\|^From ") | |
6996 (widen) | |
6997 (if (setq egroup | |
6998 (gnus-group-read-ephemeral-group | |
6999 group `(nndoc ,group (nndoc-address ,(current-buffer)) | |
7000 (nndoc-article-type guess)) | |
7001 t nil t)) | |
7002 (progn | |
7003 ;; Make all postings to this group go to the parent group. | |
7004 (nconc (gnus-info-params (gnus-get-info egroup)) | |
7005 params) | |
7006 (push egroup groups)) | |
7007 ;; Couldn't select this doc group. | |
7008 (gnus-error 3 "Article couldn't be entered")))))) | |
7009 ;; Now we have selected all the documents. | |
7010 (cond | |
7011 ((not groups) | |
7012 (error "None of the articles could be interpreted as documents")) | |
7013 ((gnus-group-read-ephemeral-group | |
7014 (setq vgroup (format | |
7015 "nnvirtual:%s-%s" gnus-newsgroup-name | |
7016 (format-time-string "%Y%m%dT%H%M%S" (current-time)))) | |
7017 `(nnvirtual ,vgroup (nnvirtual-component-groups ,groups)) | |
7018 t | |
7019 (cons (current-buffer) 'summary))) | |
7020 (t | |
7021 (error "Couldn't select virtual nndoc group"))))) | |
7022 | |
7023 (defun gnus-summary-isearch-article (&optional regexp-p) | |
7024 "Do incremental search forward on the current article. | |
7025 If REGEXP-P (the prefix) is non-nil, do regexp isearch." | |
7026 (interactive "P") | |
7027 (gnus-summary-select-article) | |
7028 (gnus-configure-windows 'article) | |
7029 (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
|
7030 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7031 (widen) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7032 (isearch-forward regexp-p)))) |
17493 | 7033 |
7034 (defun gnus-summary-search-article-forward (regexp &optional backward) | |
7035 "Search for an article containing REGEXP forward. | |
7036 If BACKWARD, search backward instead." | |
7037 (interactive | |
7038 (list (read-string | |
7039 (format "Search article %s (regexp%s): " | |
7040 (if current-prefix-arg "backward" "forward") | |
7041 (if gnus-last-search-regexp | |
7042 (concat ", default " gnus-last-search-regexp) | |
7043 ""))) | |
7044 current-prefix-arg)) | |
7045 (if (string-equal regexp "") | |
7046 (setq regexp (or gnus-last-search-regexp "")) | |
7047 (setq gnus-last-search-regexp regexp)) | |
7048 (if (gnus-summary-search-article regexp backward) | |
7049 (gnus-summary-show-thread) | |
7050 (error "Search failed: \"%s\"" regexp))) | |
7051 | |
7052 (defun gnus-summary-search-article-backward (regexp) | |
7053 "Search for an article containing REGEXP backward." | |
7054 (interactive | |
7055 (list (read-string | |
7056 (format "Search article backward (regexp%s): " | |
7057 (if gnus-last-search-regexp | |
7058 (concat ", default " gnus-last-search-regexp) | |
7059 ""))))) | |
7060 (gnus-summary-search-article-forward regexp 'backward)) | |
7061 | |
7062 (defun gnus-summary-search-article (regexp &optional backward) | |
7063 "Search for an article containing REGEXP. | |
7064 Optional argument BACKWARD means do search for backward. | |
7065 `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
|
7066 ;; 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
|
7067 ;; dynamic binding isn't shadowed by autoloading. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7068 (require 'gnus-async) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7069 (require 'gnus-art) |
17493 | 7070 (let ((gnus-select-article-hook nil) ;Disable hook. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7071 (gnus-article-prepare-hook nil) |
17493 | 7072 (gnus-mark-article-hook nil) ;Inhibit marking as read. |
7073 (gnus-use-article-prefetch nil) | |
7074 (gnus-xmas-force-redisplay nil) ;Inhibit XEmacs redisplay. | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7075 (gnus-use-trees nil) ;Inhibit updating tree buffer. |
17493 | 7076 (sum (current-buffer)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7077 (gnus-display-mime-function nil) |
17493 | 7078 (found nil) |
7079 point) | |
7080 (gnus-save-hidden-threads | |
7081 (gnus-summary-select-article) | |
7082 (set-buffer gnus-article-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7083 (goto-char (window-point (get-buffer-window (current-buffer)))) |
17493 | 7084 (when backward |
7085 (forward-line -1)) | |
7086 (while (not found) | |
7087 (gnus-message 7 "Searching article: %d..." (cdr gnus-article-current)) | |
7088 (if (if backward | |
7089 (re-search-backward regexp nil t) | |
7090 (re-search-forward regexp nil t)) | |
7091 ;; We found the regexp. | |
7092 (progn | |
7093 (setq found 'found) | |
7094 (beginning-of-line) | |
7095 (set-window-start | |
7096 (get-buffer-window (current-buffer)) | |
7097 (point)) | |
7098 (forward-line 1) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7099 (set-window-point |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7100 (get-buffer-window (current-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7101 (point)) |
17493 | 7102 (set-buffer sum) |
7103 (setq point (point))) | |
7104 ;; We didn't find it, so we go to the next article. | |
7105 (set-buffer sum) | |
7106 (setq found 'not) | |
7107 (while (eq found 'not) | |
7108 (if (not (if backward (gnus-summary-find-prev) | |
7109 (gnus-summary-find-next))) | |
7110 ;; No more articles. | |
7111 (setq found t) | |
7112 ;; Select the next article and adjust point. | |
7113 (unless (gnus-summary-article-sparse-p | |
7114 (gnus-summary-article-number)) | |
7115 (setq found nil) | |
7116 (gnus-summary-select-article) | |
7117 (set-buffer gnus-article-buffer) | |
7118 (widen) | |
7119 (goto-char (if backward (point-max) (point-min)))))))) | |
7120 (gnus-message 7 "")) | |
7121 ;; Return whether we found the regexp. | |
7122 (when (eq found 'found) | |
7123 (goto-char point) | |
7124 (gnus-summary-show-thread) | |
7125 (gnus-summary-goto-subject gnus-current-article) | |
7126 (gnus-summary-position-point) | |
7127 t))) | |
7128 | |
7129 (defun gnus-summary-find-matching (header regexp &optional backward unread | |
7130 not-case-fold) | |
7131 "Return a list of all articles that match REGEXP on HEADER. | |
7132 The search stars on the current article and goes forwards unless | |
7133 BACKWARD is non-nil. If BACKWARD is `all', do all articles. | |
7134 If UNREAD is non-nil, only unread articles will | |
7135 be taken into consideration. If NOT-CASE-FOLD, case won't be folded | |
7136 in the comparisons." | |
7137 (let ((data (if (eq backward 'all) gnus-newsgroup-data | |
7138 (gnus-data-find-list | |
7139 (gnus-summary-article-number) (gnus-data-list backward)))) | |
7140 (case-fold-search (not not-case-fold)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7141 articles d func) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7142 (if (consp header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7143 (if (eq (car header) 'extra) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7144 (setq func |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7145 `(lambda (h) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7146 (or (cdr (assq ',(cdr header) (mail-header-extra h))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7147 ""))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7148 (error "%s is an invalid header" header)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7149 (unless (fboundp (intern (concat "mail-header-" header))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7150 (error "%s is not a valid header" header)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7151 (setq func `(lambda (h) (,(intern (concat "mail-header-" header)) h)))) |
17493 | 7152 (while data |
7153 (setq d (car data)) | |
7154 (and (or (not unread) ; We want all articles... | |
7155 (gnus-data-unread-p d)) ; Or just unreads. | |
7156 (vectorp (gnus-data-header d)) ; It's not a pseudo. | |
7157 (string-match regexp (funcall func (gnus-data-header d))) ; Match. | |
7158 (push (gnus-data-number d) articles)) ; Success! | |
7159 (setq data (cdr data))) | |
7160 (nreverse articles))) | |
7161 | |
7162 (defun gnus-summary-execute-command (header regexp command &optional backward) | |
7163 "Search forward for an article whose HEADER matches REGEXP and execute COMMAND. | |
7164 If HEADER is an empty string (or nil), the match is done on the entire | |
7165 article. If BACKWARD (the prefix) is non-nil, search backward instead." | |
7166 (interactive | |
7167 (list (let ((completion-ignore-case t)) | |
7168 (completing-read | |
7169 "Header name: " | |
7170 (mapcar (lambda (string) (list string)) | |
7171 '("Number" "Subject" "From" "Lines" "Date" | |
7172 "Message-ID" "Xref" "References" "Body")) | |
7173 nil 'require-match)) | |
7174 (read-string "Regexp: ") | |
7175 (read-key-sequence "Command: ") | |
7176 current-prefix-arg)) | |
7177 (when (equal header "Body") | |
7178 (setq header "")) | |
7179 ;; Hidden thread subtrees must be searched as well. | |
7180 (gnus-summary-show-all-threads) | |
7181 ;; We don't want to change current point nor window configuration. | |
7182 (save-excursion | |
7183 (save-window-excursion | |
7184 (gnus-message 6 "Executing %s..." (key-description command)) | |
7185 ;; We'd like to execute COMMAND interactively so as to give arguments. | |
7186 (gnus-execute header regexp | |
7187 `(call-interactively ',(key-binding command)) | |
7188 backward) | |
7189 (gnus-message 6 "Executing %s...done" (key-description command))))) | |
7190 | |
7191 (defun gnus-summary-beginning-of-article () | |
7192 "Scroll the article back to the beginning." | |
7193 (interactive) | |
7194 (gnus-summary-select-article) | |
7195 (gnus-configure-windows 'article) | |
7196 (gnus-eval-in-buffer-window gnus-article-buffer | |
7197 (widen) | |
7198 (goto-char (point-min)) | |
7199 (when gnus-page-broken | |
7200 (gnus-narrow-to-page)))) | |
7201 | |
7202 (defun gnus-summary-end-of-article () | |
7203 "Scroll to the end of the article." | |
7204 (interactive) | |
7205 (gnus-summary-select-article) | |
7206 (gnus-configure-windows 'article) | |
7207 (gnus-eval-in-buffer-window gnus-article-buffer | |
7208 (widen) | |
7209 (goto-char (point-max)) | |
7210 (recenter -3) | |
7211 (when gnus-page-broken | |
7212 (gnus-narrow-to-page)))) | |
7213 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7214 (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
|
7215 "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
|
7216 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7217 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
|
7218 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
|
7219 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7220 If the optional first argument FILENAME is nil, send the image to the |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7221 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
|
7222 that name. If FILENAME is a number, prompt the user for the name of the file |
17493 | 7223 to save in." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7224 (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
|
7225 current-prefix-arg)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7226 (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
|
7227 (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
|
7228 (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
|
7229 (let ((buffer (generate-new-buffer " *print*"))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7230 (unwind-protect |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7231 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7232 (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
|
7233 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7234 (gnus-article-delete-invisible-text) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7235 (let ((ps-left-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7236 (list |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7237 (concat "(" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7238 (mail-header-subject gnus-current-headers) ")") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7239 (concat "(" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7240 (mail-header-from gnus-current-headers) ")"))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7241 (ps-right-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7242 (list |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7243 "/pagenumberstring load" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7244 (concat "(" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7245 (mail-header-date gnus-current-headers) ")")))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7246 (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
|
7247 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7248 (ps-print-buffer-with-faces filename)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7249 (kill-buffer buffer)))))) |
17493 | 7250 |
7251 (defun gnus-summary-show-article (&optional arg) | |
7252 "Force re-fetching of the current article. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7253 If ARG (the prefix) is a number, show the article with the charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7254 defined in `gnus-summary-show-article-charset-alist', or the charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7255 inputed. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7256 If ARG (the prefix) is non-nil and not a number, show the raw article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7257 without any article massaging functions being run." |
17493 | 7258 (interactive "P") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7259 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7260 ((numberp arg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7261 (let ((gnus-newsgroup-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7262 (or (cdr (assq arg gnus-summary-show-article-charset-alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7263 (read-coding-system "Charset: "))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7264 (gnus-newsgroup-ignored-charsets 'gnus-all)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7265 (gnus-summary-select-article nil 'force))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7266 ((not arg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7267 ;; Select the article the normal way. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7268 (gnus-summary-select-article nil 'force)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7269 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7270 ;; We have to require this here to make sure that the following |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7271 ;; dynamic binding isn't shadowed by autoloading. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7272 (require 'gnus-async) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7273 (require 'gnus-art) |
17493 | 7274 ;; Bind the article treatment functions to nil. |
7275 (let ((gnus-have-all-headers t) | |
7276 gnus-article-prepare-hook | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7277 gnus-article-decode-hook |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7278 gnus-display-mime-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7279 gnus-break-pages) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7280 ;; Destroy any MIME parts. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7281 (when (gnus-buffer-live-p gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7282 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7283 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7284 (mm-destroy-parts gnus-article-mime-handles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7285 ;; Set it to nil for safety reason. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7286 (setq gnus-article-mime-handle-alist nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7287 (setq gnus-article-mime-handles nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7288 (gnus-summary-select-article nil 'force)))) |
17493 | 7289 (gnus-summary-goto-subject gnus-current-article) |
7290 (gnus-summary-position-point)) | |
7291 | |
7292 (defun gnus-summary-verbose-headers (&optional arg) | |
7293 "Toggle permanent full header display. | |
7294 If ARG is a positive number, turn header display on. | |
7295 If ARG is a negative number, turn header display off." | |
7296 (interactive "P") | |
7297 (setq gnus-show-all-headers | |
7298 (cond ((or (not (numberp arg)) | |
7299 (zerop arg)) | |
7300 (not gnus-show-all-headers)) | |
7301 ((natnump arg) | |
7302 t))) | |
7303 (gnus-summary-show-article)) | |
7304 | |
7305 (defun gnus-summary-toggle-header (&optional arg) | |
7306 "Show the headers if they are hidden, or hide them if they are shown. | |
7307 If ARG is a positive number, show the entire header. | |
7308 If ARG is a negative number, hide the unwanted header lines." | |
7309 (interactive "P") | |
7310 (save-excursion | |
7311 (set-buffer gnus-article-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7312 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7313 (let* ((buffer-read-only nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7314 (inhibit-point-motion-hooks t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7315 hidden e) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7316 (setq hidden |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7317 (if (numberp arg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7318 (>= arg 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7319 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7320 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7321 (gnus-article-hidden-text-p 'headers)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7322 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7323 (when (search-forward "\n\n" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7324 (delete-region (point-min) (1- (point)))) |
17493 | 7325 (goto-char (point-min)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7326 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7327 (set-buffer gnus-original-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7328 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7329 (setq e (1- (or (search-forward "\n\n" nil t) (point-max))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7330 (insert-buffer-substring gnus-original-article-buffer 1 e) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7331 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7332 (narrow-to-region (point-min) (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7333 (article-decode-encoded-words) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7334 (if hidden |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7335 (let ((gnus-treat-hide-headers nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7336 (gnus-treat-hide-boring-headers nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7337 (setq gnus-article-wash-types |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7338 (delq 'headers gnus-article-wash-types)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7339 (gnus-treat-article 'head)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7340 (gnus-treat-article 'head))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7341 (gnus-set-mode-line 'article))))) |
17493 | 7342 |
7343 (defun gnus-summary-show-all-headers () | |
7344 "Make all header lines visible." | |
7345 (interactive) | |
7346 (gnus-article-show-all-headers)) | |
7347 | |
7348 (defun gnus-summary-caesar-message (&optional arg) | |
7349 "Caesar rotate the current article by 13. | |
7350 The numerical prefix specifies how many places to rotate each letter | |
7351 forward." | |
7352 (interactive "P") | |
7353 (gnus-summary-select-article) | |
7354 (let ((mail-header-separator "")) | |
7355 (gnus-eval-in-buffer-window gnus-article-buffer | |
7356 (save-restriction | |
7357 (widen) | |
7358 (let ((start (window-start)) | |
7359 buffer-read-only) | |
7360 (message-caesar-buffer-body arg) | |
7361 (set-window-start (get-buffer-window (current-buffer)) start)))))) | |
7362 | |
7363 (defun gnus-summary-stop-page-breaking () | |
7364 "Stop page breaking in the current article." | |
7365 (interactive) | |
7366 (gnus-summary-select-article) | |
7367 (gnus-eval-in-buffer-window gnus-article-buffer | |
7368 (widen) | |
7369 (when (gnus-visual-p 'page-marker) | |
7370 (let ((buffer-read-only nil)) | |
7371 (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
|
7372 (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
|
7373 (setq gnus-page-broken nil)))) |
17493 | 7374 |
7375 (defun gnus-summary-move-article (&optional n to-newsgroup | |
7376 select-method action) | |
7377 "Move the current article to a different newsgroup. | |
7378 If N is a positive number, move the N next articles. | |
7379 If N is a negative number, move the N previous articles. | |
7380 If N is nil and any articles have been marked with the process mark, | |
7381 move those articles instead. | |
7382 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to. | |
7383 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but | |
7384 re-spool using this method. | |
7385 | |
7386 For this function to work, both the current newsgroup and the | |
7387 newsgroup that you want to move to have to support the `request-move' | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7388 and `request-accept' functions. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7389 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7390 ACTION can be either `move' (the default), `crosspost' or `copy'." |
17493 | 7391 (interactive "P") |
7392 (unless action | |
7393 (setq action 'move)) | |
7394 ;; Disable marking as read. | |
7395 (let (gnus-mark-article-hook) | |
7396 (save-window-excursion | |
7397 (gnus-summary-select-article))) | |
7398 ;; Check whether the source group supports the required functions. | |
7399 (cond ((and (eq action 'move) | |
7400 (not (gnus-check-backend-function | |
7401 'request-move-article gnus-newsgroup-name))) | |
7402 (error "The current group does not support article moving")) | |
7403 ((and (eq action 'crosspost) | |
7404 (not (gnus-check-backend-function | |
7405 'request-replace-article gnus-newsgroup-name))) | |
7406 (error "The current group does not support article editing"))) | |
7407 (let ((articles (gnus-summary-work-articles n)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7408 (prefix (if (gnus-check-backend-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7409 'request-move-article gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7410 (gnus-group-real-prefix gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7411 "")) |
17493 | 7412 (names '((move "Move" "Moving") |
7413 (copy "Copy" "Copying") | |
7414 (crosspost "Crosspost" "Crossposting"))) | |
7415 (copy-buf (save-excursion | |
7416 (nnheader-set-temp-buffer " *copy article*"))) | |
7417 art-group to-method new-xref article to-groups) | |
7418 (unless (assq action names) | |
7419 (error "Unknown action %s" action)) | |
7420 ;; Read the newsgroup name. | |
7421 (when (and (not to-newsgroup) | |
7422 (not select-method)) | |
7423 (setq to-newsgroup | |
7424 (gnus-read-move-group-name | |
7425 (cadr (assq action names)) | |
7426 (symbol-value (intern (format "gnus-current-%s-group" action))) | |
7427 articles prefix)) | |
7428 (set (intern (format "gnus-current-%s-group" action)) to-newsgroup)) | |
7429 (setq to-method (or select-method | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7430 (gnus-server-to-method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7431 (gnus-group-method to-newsgroup)))) |
17493 | 7432 ;; Check the method we are to move this article to... |
7433 (unless (gnus-check-backend-function | |
7434 'request-accept-article (car to-method)) | |
7435 (error "%s does not support article copying" (car to-method))) | |
7436 (unless (gnus-check-server to-method) | |
7437 (error "Can't open server %s" (car to-method))) | |
7438 (gnus-message 6 "%s to %s: %s..." | |
7439 (caddr (assq action names)) | |
7440 (or (car select-method) to-newsgroup) articles) | |
7441 (while articles | |
7442 (setq article (pop articles)) | |
7443 (setq | |
7444 art-group | |
7445 (cond | |
7446 ;; Move the article. | |
7447 ((eq action 'move) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7448 ;; Remove this article from future suppression. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7449 (gnus-dup-unsuppress-article article) |
17493 | 7450 (gnus-request-move-article |
7451 article ; Article to move | |
7452 gnus-newsgroup-name ; From newsgroup | |
7453 (nth 1 (gnus-find-method-for-group | |
7454 gnus-newsgroup-name)) ; Server | |
7455 (list 'gnus-request-accept-article | |
7456 to-newsgroup (list 'quote select-method) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7457 (not articles) t) ; Accept form |
17493 | 7458 (not articles))) ; Only save nov last time |
7459 ;; Copy the article. | |
7460 ((eq action 'copy) | |
7461 (save-excursion | |
7462 (set-buffer copy-buf) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7463 (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
|
7464 (gnus-request-accept-article |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7465 to-newsgroup select-method (not articles) t)))) |
17493 | 7466 ;; Crosspost the article. |
7467 ((eq action 'crosspost) | |
7468 (let ((xref (message-tokenize-header | |
7469 (mail-header-xref (gnus-summary-article-header article)) | |
7470 " "))) | |
7471 (setq new-xref (concat (gnus-group-real-name gnus-newsgroup-name) | |
7472 ":" article)) | |
7473 (unless xref | |
7474 (setq xref (list (system-name)))) | |
7475 (setq new-xref | |
7476 (concat | |
7477 (mapconcat 'identity | |
7478 (delete "Xref:" (delete new-xref xref)) | |
7479 " ") | |
7480 " " new-xref)) | |
7481 (save-excursion | |
7482 (set-buffer copy-buf) | |
7483 ;; First put the article in the destination group. | |
7484 (gnus-request-article-this-buffer article gnus-newsgroup-name) | |
7485 (when (consp (setq art-group | |
7486 (gnus-request-accept-article | |
7487 to-newsgroup select-method (not articles)))) | |
7488 (setq new-xref (concat new-xref " " (car art-group) | |
7489 ":" (cdr art-group))) | |
7490 ;; Now we have the new Xrefs header, so we insert | |
7491 ;; it and replace the new article. | |
7492 (nnheader-replace-header "Xref" new-xref) | |
7493 (gnus-request-replace-article | |
7494 (cdr art-group) to-newsgroup (current-buffer)) | |
7495 art-group)))))) | |
7496 (cond | |
7497 ((not art-group) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7498 (gnus-message 1 "Couldn't %s article %s: %s" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7499 (cadr (assq action names)) article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7500 (nnheader-get-report (car to-method)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7501 ((eq art-group 'junk) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7502 (when (eq action 'move) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7503 (gnus-summary-mark-article article gnus-canceled-mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7504 (gnus-message 4 "Deleted article %s" article))) |
17493 | 7505 (t |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7506 (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
|
7507 (car art-group) to-method)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7508 (entry |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7509 (gnus-gethash pto-group gnus-newsrc-hashtb)) |
17493 | 7510 (info (nth 2 entry)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7511 (to-group (gnus-info-group info)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7512 to-marks) |
17493 | 7513 ;; Update the group that has been moved to. |
7514 (when (and info | |
7515 (memq action '(move copy))) | |
7516 (unless (member to-group to-groups) | |
7517 (push to-group to-groups)) | |
7518 | |
7519 (unless (memq article gnus-newsgroup-unreads) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7520 (push 'read to-marks) |
17493 | 7521 (gnus-info-set-read |
7522 info (gnus-add-to-range (gnus-info-read info) | |
7523 (list (cdr art-group))))) | |
7524 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7525 ;; See whether the article is to be put in the cache. |
17493 | 7526 (let ((marks gnus-article-mark-lists) |
7527 (to-article (cdr art-group))) | |
7528 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7529 ;; Enter the article into the cache in the new group, |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7530 ;; if that is required. |
17493 | 7531 (when gnus-use-cache |
7532 (gnus-cache-possibly-enter-article | |
7533 to-group to-article | |
7534 (memq article gnus-newsgroup-marked) | |
7535 (memq article gnus-newsgroup-dormant) | |
7536 (memq article gnus-newsgroup-unreads))) | |
7537 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7538 (when gnus-preserve-marks |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7539 ;; Copy any marks over to the new group. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7540 (when (and (equal to-group gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7541 (not (memq article gnus-newsgroup-unreads))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7542 ;; Mark this article as read in this group. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7543 (push (cons to-article gnus-read-mark) gnus-newsgroup-reads) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7544 (setcdr (gnus-active to-group) to-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7545 (setcdr gnus-newsgroup-active to-article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7546 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7547 (while marks |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7548 (when (memq article (symbol-value |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7549 (intern (format "gnus-newsgroup-%s" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7550 (caar marks))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7551 (push (cdar marks) to-marks) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7552 ;; If the other group is the same as this group, |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7553 ;; then we have to add the mark to the list. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7554 (when (equal to-group gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7555 (set (intern (format "gnus-newsgroup-%s" (caar marks))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7556 (cons to-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7557 (symbol-value |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7558 (intern (format "gnus-newsgroup-%s" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7559 (caar marks))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7560 ;; Copy the marks to other group. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7561 (gnus-add-marked-articles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7562 to-group (cdar marks) (list to-article) info)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7563 (setq marks (cdr marks))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7564 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7565 (gnus-request-set-mark to-group (list (list (list to-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7566 'set |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7567 to-marks)))) |
17493 | 7568 |
7569 (gnus-dribble-enter | |
7570 (concat "(gnus-group-set-info '" | |
7571 (gnus-prin1-to-string (gnus-get-info to-group)) | |
7572 ")")))) | |
7573 | |
7574 ;; Update the Xref header in this article to point to | |
7575 ;; the new crossposted article we have just created. | |
7576 (when (eq action 'crosspost) | |
7577 (save-excursion | |
7578 (set-buffer copy-buf) | |
7579 (gnus-request-article-this-buffer article gnus-newsgroup-name) | |
7580 (nnheader-replace-header "Xref" new-xref) | |
7581 (gnus-request-replace-article | |
7582 article gnus-newsgroup-name (current-buffer))))) | |
7583 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7584 ;;;!!!Why is this necessary? |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7585 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7586 |
17493 | 7587 (gnus-summary-goto-subject article) |
7588 (when (eq action 'move) | |
7589 (gnus-summary-mark-article article gnus-canceled-mark)))) | |
7590 (gnus-summary-remove-process-mark article)) | |
7591 ;; Re-activate all groups that have been moved to. | |
7592 (while to-groups | |
7593 (save-excursion | |
7594 (set-buffer gnus-group-buffer) | |
7595 (when (gnus-group-goto-group (car to-groups) t) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7596 (gnus-group-get-new-news-this-group 1 t)) |
17493 | 7597 (pop to-groups))) |
7598 | |
7599 (gnus-kill-buffer copy-buf) | |
7600 (gnus-summary-position-point) | |
7601 (gnus-set-mode-line 'summary))) | |
7602 | |
7603 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method) | |
7604 "Move the current article to a different newsgroup. | |
7605 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to. | |
7606 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but | |
7607 re-spool using this method." | |
7608 (interactive "P") | |
7609 (gnus-summary-move-article n to-newsgroup select-method 'copy)) | |
7610 | |
7611 (defun gnus-summary-crosspost-article (&optional n) | |
7612 "Crosspost the current article to some other group." | |
7613 (interactive "P") | |
7614 (gnus-summary-move-article n nil nil 'crosspost)) | |
7615 | |
7616 (defcustom gnus-summary-respool-default-method nil | |
7617 "Default method for respooling an article. | |
7618 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
|
7619 :type '(choice (gnus-select-method :value (nnml "")) |
41843e16f6ac
(gnus-summary-respool-default-method): Fix type.
Karl Heuer <kwzh@gnu.org>
parents:
20117
diff
changeset
|
7620 (const nil)) |
17493 | 7621 :group 'gnus-summary-mail) |
7622 | |
7623 (defun gnus-summary-respool-article (&optional n method) | |
7624 "Respool the current article. | |
7625 The article will be squeezed through the mail spooling process again, | |
7626 which means that it will be put in some mail newsgroup or other | |
7627 depending on `nnmail-split-methods'. | |
7628 If N is a positive number, respool the N next articles. | |
7629 If N is a negative number, respool the N previous articles. | |
7630 If N is nil and any articles have been marked with the process mark, | |
7631 respool those articles instead. | |
7632 | |
7633 Respooling can be done both from mail groups and \"real\" newsgroups. | |
7634 In the former case, the articles in question will be moved from the | |
7635 current group into whatever groups they are destined to. In the | |
7636 latter case, they will be copied into the relevant groups." | |
7637 (interactive | |
7638 (list current-prefix-arg | |
7639 (let* ((methods (gnus-methods-using 'respool)) | |
7640 (methname | |
7641 (symbol-name (or gnus-summary-respool-default-method | |
7642 (car (gnus-find-method-for-group | |
7643 gnus-newsgroup-name))))) | |
7644 (method | |
7645 (gnus-completing-read | |
7646 methname "What backend do you want to use when respooling?" | |
7647 methods nil t nil 'gnus-mail-method-history)) | |
7648 ms) | |
7649 (cond | |
7650 ((zerop (length (setq ms (gnus-servers-using-backend | |
7651 (intern method))))) | |
7652 (list (intern method) "")) | |
7653 ((= 1 (length ms)) | |
7654 (car ms)) | |
7655 (t | |
7656 (let ((ms-alist (mapcar (lambda (m) (cons (cadr m) m)) ms))) | |
7657 (cdr (assoc (completing-read "Server name: " ms-alist nil t) | |
7658 ms-alist)))))))) | |
7659 (unless method | |
7660 (error "No method given for respooling")) | |
7661 (if (assoc (symbol-name | |
7662 (car (gnus-find-method-for-group gnus-newsgroup-name))) | |
7663 (gnus-methods-using 'respool)) | |
7664 (gnus-summary-move-article n nil method) | |
7665 (gnus-summary-copy-article n nil method))) | |
7666 | |
7667 (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
|
7668 "Import an arbitrary file into a mail newsgroup." |
17493 | 7669 (interactive "fImport file: ") |
7670 (let ((group gnus-newsgroup-name) | |
7671 (now (current-time)) | |
7672 atts lines) | |
7673 (unless (gnus-check-backend-function 'request-accept-article group) | |
7674 (error "%s does not support article importing" group)) | |
7675 (or (file-readable-p file) | |
7676 (not (file-regular-p file)) | |
7677 (error "Can't read %s" file)) | |
7678 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7679 (set-buffer (gnus-get-buffer-create " *import file*")) |
17493 | 7680 (erase-buffer) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7681 (nnheader-insert-file-contents file) |
17493 | 7682 (goto-char (point-min)) |
7683 (unless (nnheader-article-p) | |
7684 ;; This doesn't look like an article, so we fudge some headers. | |
7685 (setq atts (file-attributes file) | |
7686 lines (count-lines (point-min) (point-max))) | |
7687 (insert "From: " (read-string "From: ") "\n" | |
7688 "Subject: " (read-string "Subject: ") "\n" | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7689 "Date: " (message-make-date (nth 5 atts)) |
17493 | 7690 "\n" |
7691 "Message-ID: " (message-make-message-id) "\n" | |
7692 "Lines: " (int-to-string lines) "\n" | |
7693 "Chars: " (int-to-string (nth 7 atts)) "\n\n")) | |
7694 (gnus-request-accept-article group nil t) | |
7695 (kill-buffer (current-buffer))))) | |
7696 | |
7697 (defun gnus-summary-article-posted-p () | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7698 "Say whether the current (mail) article is available from news as well. |
17493 | 7699 This will be the case if the article has both been mailed and posted." |
7700 (interactive) | |
7701 (let ((id (mail-header-references (gnus-summary-article-header))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7702 (gnus-override-method (car (gnus-refer-article-methods)))) |
17493 | 7703 (if (gnus-request-head id "") |
7704 (gnus-message 2 "The current message was found on %s" | |
7705 gnus-override-method) | |
7706 (gnus-message 2 "The current message couldn't be found on %s" | |
7707 gnus-override-method) | |
7708 nil))) | |
7709 | |
7710 (defun gnus-summary-expire-articles (&optional now) | |
7711 "Expire all articles that are marked as expirable in the current group." | |
7712 (interactive) | |
7713 (when (gnus-check-backend-function | |
7714 'request-expire-articles gnus-newsgroup-name) | |
7715 ;; This backend supports expiry. | |
7716 (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name)) | |
7717 (expirable (if total | |
7718 (progn | |
7719 ;; We need to update the info for | |
7720 ;; this group for `gnus-list-of-read-articles' | |
7721 ;; 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
|
7722 (gnus-run-hooks 'gnus-exit-group-hook) |
17493 | 7723 (gnus-summary-update-info) |
7724 (gnus-list-of-read-articles gnus-newsgroup-name)) | |
7725 (setq gnus-newsgroup-expirable | |
7726 (sort gnus-newsgroup-expirable '<)))) | |
7727 (expiry-wait (if now 'immediate | |
7728 (gnus-group-find-parameter | |
7729 gnus-newsgroup-name 'expiry-wait))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7730 (nnmail-expiry-target |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7731 (or (gnus-group-find-parameter gnus-newsgroup-name 'expiry-target) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7732 nnmail-expiry-target)) |
17493 | 7733 es) |
7734 (when expirable | |
7735 ;; There are expirable articles in this group, so we run them | |
7736 ;; through the expiry process. | |
7737 (gnus-message 6 "Expiring articles...") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7738 (unless (gnus-check-group gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7739 (error "Can't open server for %s" gnus-newsgroup-name)) |
17493 | 7740 ;; 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
|
7741 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7742 (if expiry-wait |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7743 (let ((nnmail-expiry-wait-function nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7744 (nnmail-expiry-wait expiry-wait)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7745 (setq es (gnus-request-expire-articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7746 expirable gnus-newsgroup-name))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7747 (setq es (gnus-request-expire-articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7748 expirable gnus-newsgroup-name)))) |
17493 | 7749 (unless total |
7750 (setq gnus-newsgroup-expirable es)) | |
7751 ;; We go through the old list of expirable, and mark all | |
7752 ;; really expired articles as nonexistent. | |
7753 (unless (eq es expirable) ;If nothing was expired, we don't mark. | |
7754 (let ((gnus-use-cache nil)) | |
7755 (while expirable | |
7756 (unless (memq (car expirable) es) | |
7757 (when (gnus-data-find (car expirable)) | |
7758 (gnus-summary-mark-article | |
7759 (car expirable) gnus-canceled-mark))) | |
7760 (setq expirable (cdr expirable))))) | |
7761 (gnus-message 6 "Expiring articles...done"))))) | |
7762 | |
7763 (defun gnus-summary-expire-articles-now () | |
7764 "Expunge all expirable articles in the current group. | |
7765 This means that *all* articles that are marked as expirable will be | |
7766 deleted forever, right now." | |
7767 (interactive) | |
7768 (or gnus-expert-user | |
7769 (gnus-yes-or-no-p | |
7770 "Are you really, really, really sure you want to delete all these messages? ") | |
7771 (error "Phew!")) | |
7772 (gnus-summary-expire-articles t)) | |
7773 | |
7774 ;; Suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>. | |
7775 (defun gnus-summary-delete-article (&optional n) | |
7776 "Delete the N next (mail) articles. | |
7777 This command actually deletes articles. This is not a marking | |
7778 command. The article will disappear forever from your life, never to | |
7779 return. | |
7780 If N is negative, delete backwards. | |
7781 If N is nil and articles have been marked with the process mark, | |
7782 delete these instead." | |
7783 (interactive "P") | |
7784 (unless (gnus-check-backend-function 'request-expire-articles | |
7785 gnus-newsgroup-name) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7786 (error "The current newsgroup does not support article deletion")) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7787 (unless (gnus-check-server (gnus-find-method-for-group gnus-newsgroup-name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7788 (error "Couldn't open server")) |
17493 | 7789 ;; 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
|
7790 (let ((articles (sort (copy-sequence (gnus-summary-work-articles n)) '<)) |
17493 | 7791 not-deleted) |
7792 (if (and gnus-novice-user | |
7793 (not (gnus-yes-or-no-p | |
7794 (format "Do you really want to delete %s forever? " | |
7795 (if (> (length articles) 1) | |
7796 (format "these %s articles" (length articles)) | |
7797 "this article"))))) | |
7798 () | |
7799 ;; Delete the articles. | |
7800 (setq not-deleted (gnus-request-expire-articles | |
7801 articles gnus-newsgroup-name 'force)) | |
7802 (while articles | |
7803 (gnus-summary-remove-process-mark (car articles)) | |
7804 ;; The backend might not have been able to delete the article | |
7805 ;; after all. | |
7806 (unless (memq (car articles) not-deleted) | |
7807 (gnus-summary-mark-article (car articles) gnus-canceled-mark)) | |
7808 (setq articles (cdr articles))) | |
7809 (when not-deleted | |
7810 (gnus-message 4 "Couldn't delete articles %s" not-deleted))) | |
7811 (gnus-summary-position-point) | |
7812 (gnus-set-mode-line 'summary) | |
7813 not-deleted)) | |
7814 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7815 (defun gnus-summary-edit-article (&optional arg) |
17493 | 7816 "Edit the current article. |
7817 This will have permanent effect only in mail groups. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7818 If ARG is nil, edit the decoded articles. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7819 If ARG is 1, edit the raw articles. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7820 If ARG is 2, edit the raw articles even in read-only groups. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7821 Otherwise, allow editing of articles even in read-only |
17493 | 7822 groups." |
7823 (interactive "P") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7824 (let (force raw) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7825 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7826 ((null arg)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7827 ((eq arg 1) (setq raw t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7828 ((eq arg 2) (setq raw t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7829 force t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7830 (t (setq force t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7831 (if (and raw (not force) (equal gnus-newsgroup-name "nndraft:drafts")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7832 (error "Can't edit the raw article in group nndraft:drafts.")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7833 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7834 (set-buffer gnus-summary-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7835 (let ((mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7836 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7837 (gnus-set-global-variables) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7838 (when (and (not force) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7839 (gnus-group-read-only-p)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7840 (error "The current newsgroup does not support article editing")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7841 (gnus-summary-show-article t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7842 (when (and (not raw) (gnus-buffer-live-p gnus-article-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7843 (with-current-buffer gnus-article-buffer |
32975
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
7844 (mm-enable-multibyte-mule4))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7845 (if (equal gnus-newsgroup-name "nndraft:drafts") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7846 (setq raw t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7847 (gnus-article-edit-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7848 (if raw 'ignore |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7849 #'(lambda () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7850 (let ((mbl mml-buffer-list)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7851 (setq mml-buffer-list nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7852 (mime-to-mml) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7853 (make-local-hook 'kill-buffer-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7854 (let ((mml-buffer-list mml-buffer-list)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7855 (setq mml-buffer-list mbl) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7856 (make-local-variable 'mml-buffer-list)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7857 (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7858 `(lambda (no-highlight) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7859 (let ((mail-parse-charset ',gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7860 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7861 ',gnus-newsgroup-ignored-charsets)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7862 ,(if (not raw) '(progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7863 (mml-to-mime) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7864 (mml-destroy-buffers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7865 (remove-hook 'kill-buffer-hook |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7866 'mml-destroy-buffers t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7867 (kill-local-variable 'mml-buffer-list))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7868 (gnus-summary-edit-article-done |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7869 ,(or (mail-header-references gnus-current-headers) "") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7870 ,(gnus-group-read-only-p) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7871 ,gnus-summary-buffer no-highlight)))))))) |
17493 | 7872 |
7873 (defalias 'gnus-summary-edit-article-postpone 'gnus-article-edit-exit) | |
7874 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7875 (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
|
7876 no-highlight) |
17493 | 7877 "Make edits to the current article permanent." |
7878 (interactive) | |
7879 ;; Replace the article. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7880 (let ((buf (current-buffer))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7881 (with-temp-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7882 (insert-buffer-substring buf) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7883 (if (and (not read-only) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7884 (not (gnus-request-replace-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7885 (cdr gnus-article-current) (car gnus-article-current) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7886 (current-buffer) t))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7887 (error "Couldn't replace article") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7888 ;; Update the summary buffer. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7889 (if (and references |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7890 (equal (message-tokenize-header references " ") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7891 (message-tokenize-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7892 (or (message-fetch-field "references") "") " "))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7893 ;; 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
|
7894 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7895 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7896 (message-narrow-to-head) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7897 (let ((head (buffer-string)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7898 header) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7899 (with-temp-buffer |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7900 (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
|
7901 (cdr gnus-article-current))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7902 (insert head) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7903 (insert ".\n") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7904 (let ((nntp-server-buffer (current-buffer))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7905 (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
|
7906 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7907 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7908 gnus-newsgroup-dependencies) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7909 t)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7910 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7911 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7912 (gnus-data-set-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7913 (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
|
7914 header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7915 (gnus-summary-update-article-line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7916 (cdr gnus-article-current) header)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7917 ;; Update threads. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7918 (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
|
7919 (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
|
7920 ;; Prettify the article buffer again. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7921 (unless no-highlight |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7922 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7923 (set-buffer gnus-article-buffer) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7924 ;;;!!! Fix this -- article should be rehighlighted. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7925 ;;;(gnus-run-hooks 'gnus-article-display-hook) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7926 (set-buffer gnus-original-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7927 (gnus-request-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7928 (cdr gnus-article-current) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7929 (car gnus-article-current) (current-buffer)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7930 ;; Prettify the summary buffer line. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7931 (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
|
7932 (gnus-run-hooks 'gnus-visual-mark-article-hook)))))) |
17493 | 7933 |
7934 (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
|
7935 "Perform editing command KEY in the article buffer." |
17493 | 7936 (interactive |
7937 (list | |
7938 (progn | |
7939 (message "%s" (concat (this-command-keys) "- ")) | |
7940 (read-char)))) | |
7941 (message "") | |
7942 (gnus-summary-edit-article) | |
7943 (execute-kbd-macro (concat (this-command-keys) key)) | |
7944 (gnus-article-edit-done)) | |
7945 | |
7946 ;;; Respooling | |
7947 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7948 (defun gnus-summary-respool-query (&optional silent trace) |
17493 | 7949 "Query where the respool algorithm would put this article." |
7950 (interactive) | |
7951 (let (gnus-mark-article-hook) | |
7952 (gnus-summary-select-article) | |
7953 (save-excursion | |
7954 (set-buffer gnus-original-article-buffer) | |
7955 (save-restriction | |
7956 (message-narrow-to-head) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7957 (let ((groups (nnmail-article-group 'identity trace))) |
17493 | 7958 (unless silent |
7959 (if groups | |
7960 (message "This message would go to %s" | |
7961 (mapconcat 'car groups ", ")) | |
7962 (message "This message would go to no groups")) | |
7963 groups)))))) | |
7964 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7965 (defun gnus-summary-respool-trace () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7966 "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
|
7967 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
|
7968 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7969 (gnus-summary-respool-query nil t)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7970 |
17493 | 7971 ;; Summary marking commands. |
7972 | |
7973 (defun gnus-summary-kill-same-subject-and-select (&optional unmark) | |
7974 "Mark articles which has the same subject as read, and then select the next. | |
7975 If UNMARK is positive, remove any kind of mark. | |
7976 If UNMARK is negative, tick articles." | |
7977 (interactive "P") | |
7978 (when unmark | |
7979 (setq unmark (prefix-numeric-value unmark))) | |
7980 (let ((count | |
7981 (gnus-summary-mark-same-subject | |
7982 (gnus-summary-article-subject) unmark))) | |
7983 ;; Select next unread article. If auto-select-same mode, should | |
7984 ;; select the first unread article. | |
7985 (gnus-summary-next-article t (and gnus-auto-select-same | |
7986 (gnus-summary-article-subject))) | |
7987 (gnus-message 7 "%d article%s marked as %s" | |
7988 count (if (= count 1) " is" "s are") | |
7989 (if unmark "unread" "read")))) | |
7990 | |
7991 (defun gnus-summary-kill-same-subject (&optional unmark) | |
7992 "Mark articles which has the same subject as read. | |
7993 If UNMARK is positive, remove any kind of mark. | |
7994 If UNMARK is negative, tick articles." | |
7995 (interactive "P") | |
7996 (when unmark | |
7997 (setq unmark (prefix-numeric-value unmark))) | |
7998 (let ((count | |
7999 (gnus-summary-mark-same-subject | |
8000 (gnus-summary-article-subject) unmark))) | |
8001 ;; If marked as read, go to next unread subject. | |
8002 (when (null unmark) | |
8003 ;; Go to next unread subject. | |
8004 (gnus-summary-next-subject 1 t)) | |
8005 (gnus-message 7 "%d articles are marked as %s" | |
8006 count (if unmark "unread" "read")))) | |
8007 | |
8008 (defun gnus-summary-mark-same-subject (subject &optional unmark) | |
8009 "Mark articles with same SUBJECT as read, and return marked number. | |
8010 If optional argument UNMARK is positive, remove any kinds of marks. | |
8011 If optional argument UNMARK is negative, mark articles as unread instead." | |
8012 (let ((count 1)) | |
8013 (save-excursion | |
8014 (cond | |
8015 ((null unmark) ; Mark as read. | |
8016 (while (and | |
8017 (progn | |
8018 (gnus-summary-mark-article-as-read gnus-killed-mark) | |
8019 (gnus-summary-show-thread) t) | |
8020 (gnus-summary-find-subject subject)) | |
8021 (setq count (1+ count)))) | |
8022 ((> unmark 0) ; Tick. | |
8023 (while (and | |
8024 (progn | |
8025 (gnus-summary-mark-article-as-unread gnus-ticked-mark) | |
8026 (gnus-summary-show-thread) t) | |
8027 (gnus-summary-find-subject subject)) | |
8028 (setq count (1+ count)))) | |
8029 (t ; Mark as unread. | |
8030 (while (and | |
8031 (progn | |
8032 (gnus-summary-mark-article-as-unread gnus-unread-mark) | |
8033 (gnus-summary-show-thread) t) | |
8034 (gnus-summary-find-subject subject)) | |
8035 (setq count (1+ count))))) | |
8036 (gnus-set-mode-line 'summary) | |
8037 ;; Return the number of marked articles. | |
8038 count))) | |
8039 | |
8040 (defun gnus-summary-mark-as-processable (n &optional unmark) | |
8041 "Set the process mark on the next N articles. | |
8042 If N is negative, mark backward instead. If UNMARK is non-nil, remove | |
8043 the process mark instead. The difference between N and the actual | |
8044 number of articles marked is returned." | |
8045 (interactive "p") | |
8046 (let ((backward (< n 0)) | |
8047 (n (abs n))) | |
8048 (while (and | |
8049 (> n 0) | |
8050 (if unmark | |
8051 (gnus-summary-remove-process-mark | |
8052 (gnus-summary-article-number)) | |
8053 (gnus-summary-set-process-mark (gnus-summary-article-number))) | |
8054 (zerop (gnus-summary-next-subject (if backward -1 1) nil t))) | |
8055 (setq n (1- n))) | |
8056 (when (/= 0 n) | |
8057 (gnus-message 7 "No more articles")) | |
8058 (gnus-summary-recenter) | |
8059 (gnus-summary-position-point) | |
8060 n)) | |
8061 | |
8062 (defun gnus-summary-unmark-as-processable (n) | |
8063 "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
|
8064 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
|
8065 the actual number of articles unmarked is returned." |
17493 | 8066 (interactive "p") |
8067 (gnus-summary-mark-as-processable n t)) | |
8068 | |
8069 (defun gnus-summary-unmark-all-processable () | |
8070 "Remove the process mark from all articles." | |
8071 (interactive) | |
8072 (save-excursion | |
8073 (while gnus-newsgroup-processable | |
8074 (gnus-summary-remove-process-mark (car gnus-newsgroup-processable)))) | |
8075 (gnus-summary-position-point)) | |
8076 | |
8077 (defun gnus-summary-mark-as-expirable (n) | |
8078 "Mark N articles forward as expirable. | |
8079 If N is negative, mark backward instead. The difference between N and | |
8080 the actual number of articles marked is returned." | |
8081 (interactive "p") | |
8082 (gnus-summary-mark-forward n gnus-expirable-mark)) | |
8083 | |
8084 (defun gnus-summary-mark-article-as-replied (article) | |
8085 "Mark ARTICLE replied and update the summary line." | |
8086 (push article gnus-newsgroup-replied) | |
8087 (let ((buffer-read-only nil)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8088 (when (gnus-summary-goto-subject article nil t) |
17493 | 8089 (gnus-summary-update-secondary-mark article)))) |
8090 | |
8091 (defun gnus-summary-set-bookmark (article) | |
8092 "Set a bookmark in current article." | |
8093 (interactive (list (gnus-summary-article-number))) | |
8094 (when (or (not (get-buffer gnus-article-buffer)) | |
8095 (not gnus-current-article) | |
8096 (not gnus-article-current) | |
8097 (not (equal gnus-newsgroup-name (car gnus-article-current)))) | |
8098 (error "No current article selected")) | |
8099 ;; Remove old bookmark, if one exists. | |
8100 (let ((old (assq article gnus-newsgroup-bookmarks))) | |
8101 (when old | |
8102 (setq gnus-newsgroup-bookmarks | |
8103 (delq old gnus-newsgroup-bookmarks)))) | |
8104 ;; Set the new bookmark, which is on the form | |
8105 ;; (article-number . line-number-in-body). | |
8106 (push | |
8107 (cons article | |
8108 (save-excursion | |
8109 (set-buffer gnus-article-buffer) | |
8110 (count-lines | |
8111 (min (point) | |
8112 (save-excursion | |
8113 (goto-char (point-min)) | |
8114 (search-forward "\n\n" nil t) | |
8115 (point))) | |
8116 (point)))) | |
8117 gnus-newsgroup-bookmarks) | |
8118 (gnus-message 6 "A bookmark has been added to the current article.")) | |
8119 | |
8120 (defun gnus-summary-remove-bookmark (article) | |
8121 "Remove the bookmark from the current article." | |
8122 (interactive (list (gnus-summary-article-number))) | |
8123 ;; Remove old bookmark, if one exists. | |
8124 (let ((old (assq article gnus-newsgroup-bookmarks))) | |
8125 (if old | |
8126 (progn | |
8127 (setq gnus-newsgroup-bookmarks | |
8128 (delq old gnus-newsgroup-bookmarks)) | |
8129 (gnus-message 6 "Removed bookmark.")) | |
8130 (gnus-message 6 "No bookmark in current article.")))) | |
8131 | |
8132 ;; Suggested by Daniel Quinlan <quinlan@best.com>. | |
8133 (defun gnus-summary-mark-as-dormant (n) | |
8134 "Mark N articles forward as dormant. | |
8135 If N is negative, mark backward instead. The difference between N and | |
8136 the actual number of articles marked is returned." | |
8137 (interactive "p") | |
8138 (gnus-summary-mark-forward n gnus-dormant-mark)) | |
8139 | |
8140 (defun gnus-summary-set-process-mark (article) | |
8141 "Set the process mark on ARTICLE and update the summary line." | |
8142 (setq gnus-newsgroup-processable | |
8143 (cons article | |
8144 (delq article gnus-newsgroup-processable))) | |
8145 (when (gnus-summary-goto-subject article) | |
8146 (gnus-summary-show-thread) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8147 (gnus-summary-goto-subject article) |
17493 | 8148 (gnus-summary-update-secondary-mark article))) |
8149 | |
8150 (defun gnus-summary-remove-process-mark (article) | |
8151 "Remove the process mark from ARTICLE and update the summary line." | |
8152 (setq gnus-newsgroup-processable (delq article gnus-newsgroup-processable)) | |
8153 (when (gnus-summary-goto-subject article) | |
8154 (gnus-summary-show-thread) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8155 (gnus-summary-goto-subject article) |
17493 | 8156 (gnus-summary-update-secondary-mark article))) |
8157 | |
8158 (defun gnus-summary-set-saved-mark (article) | |
8159 "Set the process mark on ARTICLE and update the summary line." | |
8160 (push article gnus-newsgroup-saved) | |
8161 (when (gnus-summary-goto-subject article) | |
8162 (gnus-summary-update-secondary-mark article))) | |
8163 | |
8164 (defun gnus-summary-mark-forward (n &optional mark no-expire) | |
8165 "Mark N articles as read forwards. | |
8166 If N is negative, mark backwards instead. Mark with MARK, ?r by default. | |
8167 The difference between N and the actual number of articles marked is | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8168 returned. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8169 Iff NO-EXPIRE, auto-expiry will be inhibited." |
17493 | 8170 (interactive "p") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8171 (gnus-summary-show-thread) |
17493 | 8172 (let ((backward (< n 0)) |
8173 (gnus-summary-goto-unread | |
8174 (and gnus-summary-goto-unread | |
8175 (not (eq gnus-summary-goto-unread 'never)) | |
8176 (not (memq mark (list gnus-unread-mark | |
8177 gnus-ticked-mark gnus-dormant-mark))))) | |
8178 (n (abs n)) | |
8179 (mark (or mark gnus-del-mark))) | |
8180 (while (and (> n 0) | |
8181 (gnus-summary-mark-article nil mark no-expire) | |
8182 (zerop (gnus-summary-next-subject | |
8183 (if backward -1 1) | |
8184 (and gnus-summary-goto-unread | |
8185 (not (eq gnus-summary-goto-unread 'never))) | |
8186 t))) | |
8187 (setq n (1- n))) | |
8188 (when (/= 0 n) | |
8189 (gnus-message 7 "No more %sarticles" (if mark "" "unread "))) | |
8190 (gnus-summary-recenter) | |
8191 (gnus-summary-position-point) | |
8192 (gnus-set-mode-line 'summary) | |
8193 n)) | |
8194 | |
8195 (defun gnus-summary-mark-article-as-read (mark) | |
8196 "Mark the current article quickly as read with MARK." | |
8197 (let ((article (gnus-summary-article-number))) | |
8198 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) | |
8199 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) | |
8200 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) | |
8201 (push (cons article mark) gnus-newsgroup-reads) | |
8202 ;; Possibly remove from cache, if that is used. | |
8203 (when gnus-use-cache | |
8204 (gnus-cache-enter-remove-article article)) | |
8205 ;; Allow the backend to change the mark. | |
8206 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) | |
8207 ;; Check for auto-expiry. | |
8208 (when (and gnus-newsgroup-auto-expire | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8209 (memq mark gnus-auto-expirable-marks)) |
17493 | 8210 (setq mark gnus-expirable-mark) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8211 ;; 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
|
8212 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) |
17493 | 8213 (push article gnus-newsgroup-expirable)) |
8214 ;; Set the mark in the buffer. | |
8215 (gnus-summary-update-mark mark 'unread) | |
8216 t)) | |
8217 | |
8218 (defun gnus-summary-mark-article-as-unread (mark) | |
8219 "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
|
8220 (let* ((article (gnus-summary-article-number)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8221 (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
|
8222 ;; 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
|
8223 (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
|
8224 (if (eq mark old-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8225 t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8226 (if (<= article 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8227 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8228 (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
|
8229 nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8230 (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
|
8231 (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
|
8232 (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
|
8233 (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
|
8234 (cond ((= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8235 (push article gnus-newsgroup-marked)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8236 ((= mark gnus-dormant-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8237 (push article gnus-newsgroup-dormant)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8238 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8239 (push article gnus-newsgroup-unreads))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8240 (gnus-pull article gnus-newsgroup-reads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8241 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8242 ;; 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
|
8243 (and gnus-use-cache |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8244 (vectorp (gnus-summary-article-header article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8245 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8246 (gnus-cache-possibly-enter-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8247 gnus-newsgroup-name article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8248 (= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8249 (= 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
|
8250 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8251 ;; Fix the mark. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8252 (gnus-summary-update-mark mark 'unread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8253 t)))) |
17493 | 8254 |
8255 (defun gnus-summary-mark-article (&optional article mark no-expire) | |
8256 "Mark ARTICLE with MARK. MARK can be any character. | |
8257 Four MARK strings are reserved: `? ' (unread), `?!' (ticked), | |
8258 `??' (dormant) and `?E' (expirable). | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8259 If MARK is nil, then the default character `?r' is used. |
17493 | 8260 If ARTICLE is nil, then the article on the current line will be |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8261 marked. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8262 Iff NO-EXPIRE, auto-expiry will be inhibited." |
17493 | 8263 ;; The mark might be a string. |
8264 (when (stringp mark) | |
8265 (setq mark (aref mark 0))) | |
8266 ;; If no mark is given, then we check auto-expiring. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8267 (when (null mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8268 (setq mark gnus-del-mark)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8269 (when (and (not no-expire) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8270 gnus-newsgroup-auto-expire |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8271 (memq mark gnus-auto-expirable-marks)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8272 (setq mark gnus-expirable-mark)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8273 (let ((article (or article (gnus-summary-article-number))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8274 (old-mark (gnus-summary-article-mark article))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8275 ;; 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
|
8276 (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
|
8277 (if (eq mark old-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8278 t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8279 (unless article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8280 (error "No article on current line")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8281 (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
|
8282 (= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8283 (= mark gnus-dormant-mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8284 (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
|
8285 (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
|
8286 t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8287 ;; 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
|
8288 (and gnus-use-cache |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8289 (not (= mark gnus-canceled-mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8290 (vectorp (gnus-summary-article-header article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8291 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8292 (gnus-cache-possibly-enter-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8293 gnus-newsgroup-name article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8294 (= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8295 (= 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
|
8296 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8297 (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
|
8298 (let ((buffer-read-only nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8299 (gnus-summary-show-thread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8300 ;; Fix the mark. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8301 (gnus-summary-update-mark mark 'unread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8302 t)))))) |
17493 | 8303 |
8304 (defun gnus-summary-update-secondary-mark (article) | |
8305 "Update the secondary (read, process, cache) mark." | |
8306 (gnus-summary-update-mark | |
8307 (cond ((memq article gnus-newsgroup-processable) | |
8308 gnus-process-mark) | |
8309 ((memq article gnus-newsgroup-cached) | |
8310 gnus-cached-mark) | |
8311 ((memq article gnus-newsgroup-replied) | |
8312 gnus-replied-mark) | |
8313 ((memq article gnus-newsgroup-saved) | |
8314 gnus-saved-mark) | |
8315 (t gnus-unread-mark)) | |
8316 'replied) | |
8317 (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
|
8318 (gnus-run-hooks 'gnus-summary-update-hook)) |
17493 | 8319 t) |
8320 | |
8321 (defun gnus-summary-update-mark (mark type) | |
8322 (let ((forward (cdr (assq type gnus-summary-mark-positions))) | |
8323 (buffer-read-only nil)) | |
8324 (re-search-backward "[\n\r]" (gnus-point-at-bol) 'move-to-limit) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8325 (when forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8326 (when (looking-at "\r") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8327 (incf forward)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8328 (when (<= (+ forward (point)) (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8329 ;; Go to the right position on the line. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8330 (goto-char (+ forward (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8331 ;; Replace the old mark with the new mark. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8332 (subst-char-in-region (point) (1+ (point)) (char-after) mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8333 ;; Optionally update the marks by some user rule. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8334 (when (eq type 'unread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8335 (gnus-data-set-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8336 (gnus-data-find (gnus-summary-article-number)) mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8337 (gnus-summary-update-line (eq mark gnus-unread-mark))))))) |
17493 | 8338 |
8339 (defun gnus-mark-article-as-read (article &optional mark) | |
8340 "Enter ARTICLE in the pertinent lists and remove it from others." | |
8341 ;; Make the article expirable. | |
8342 (let ((mark (or mark gnus-del-mark))) | |
8343 (if (= mark gnus-expirable-mark) | |
8344 (push article gnus-newsgroup-expirable) | |
8345 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))) | |
8346 ;; Remove from unread and marked lists. | |
8347 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) | |
8348 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) | |
8349 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) | |
8350 (push (cons article mark) gnus-newsgroup-reads) | |
8351 ;; Possibly remove from cache, if that is used. | |
8352 (when gnus-use-cache | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8353 (gnus-cache-enter-remove-article article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8354 t)) |
17493 | 8355 |
8356 (defun gnus-mark-article-as-unread (article &optional mark) | |
8357 "Enter ARTICLE in the pertinent lists and remove it from others." | |
8358 (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
|
8359 (if (<= article 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8360 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8361 (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
|
8362 nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8363 (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
|
8364 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
|
8365 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
|
8366 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
|
8367 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8368 ;; Unsuppress duplicates? |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8369 (when gnus-suppress-duplicates |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8370 (gnus-dup-unsuppress-article article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8371 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8372 (cond ((= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8373 (push article gnus-newsgroup-marked)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8374 ((= mark gnus-dormant-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8375 (push article gnus-newsgroup-dormant)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8376 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8377 (push article gnus-newsgroup-unreads))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8378 (gnus-pull article gnus-newsgroup-reads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8379 t))) |
17493 | 8380 |
8381 (defalias 'gnus-summary-mark-as-unread-forward | |
8382 'gnus-summary-tick-article-forward) | |
8383 (make-obsolete 'gnus-summary-mark-as-unread-forward | |
8384 'gnus-summary-tick-article-forward) | |
8385 (defun gnus-summary-tick-article-forward (n) | |
8386 "Tick N articles forwards. | |
8387 If N is negative, tick backwards instead. | |
8388 The difference between N and the number of articles ticked is returned." | |
8389 (interactive "p") | |
8390 (gnus-summary-mark-forward n gnus-ticked-mark)) | |
8391 | |
8392 (defalias 'gnus-summary-mark-as-unread-backward | |
8393 'gnus-summary-tick-article-backward) | |
8394 (make-obsolete 'gnus-summary-mark-as-unread-backward | |
8395 'gnus-summary-tick-article-backward) | |
8396 (defun gnus-summary-tick-article-backward (n) | |
8397 "Tick N articles backwards. | |
8398 The difference between N and the number of articles ticked is returned." | |
8399 (interactive "p") | |
8400 (gnus-summary-mark-forward (- n) gnus-ticked-mark)) | |
8401 | |
8402 (defalias 'gnus-summary-mark-as-unread 'gnus-summary-tick-article) | |
8403 (make-obsolete 'gnus-summary-mark-as-unread 'gnus-summary-tick-article) | |
8404 (defun gnus-summary-tick-article (&optional article clear-mark) | |
8405 "Mark current article as unread. | |
8406 Optional 1st argument ARTICLE specifies article number to be marked as unread. | |
8407 Optional 2nd argument CLEAR-MARK remove any kinds of mark." | |
8408 (interactive) | |
8409 (gnus-summary-mark-article article (if clear-mark gnus-unread-mark | |
8410 gnus-ticked-mark))) | |
8411 | |
8412 (defun gnus-summary-mark-as-read-forward (n) | |
8413 "Mark N articles as read forwards. | |
8414 If N is negative, mark backwards instead. | |
8415 The difference between N and the actual number of articles marked is | |
8416 returned." | |
8417 (interactive "p") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8418 (gnus-summary-mark-forward n gnus-del-mark gnus-inhibit-user-auto-expire)) |
17493 | 8419 |
8420 (defun gnus-summary-mark-as-read-backward (n) | |
8421 "Mark the N articles as read backwards. | |
8422 The difference between N and the actual number of articles marked is | |
8423 returned." | |
8424 (interactive "p") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8425 (gnus-summary-mark-forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8426 (- n) gnus-del-mark gnus-inhibit-user-auto-expire)) |
17493 | 8427 |
8428 (defun gnus-summary-mark-as-read (&optional article mark) | |
8429 "Mark current article as read. | |
8430 ARTICLE specifies the article to be marked as read. | |
8431 MARK specifies a string to be inserted at the beginning of the line." | |
8432 (gnus-summary-mark-article article mark)) | |
8433 | |
8434 (defun gnus-summary-clear-mark-forward (n) | |
8435 "Clear marks from N articles forward. | |
8436 If N is negative, clear backward instead. | |
8437 The difference between N and the number of marks cleared is returned." | |
8438 (interactive "p") | |
8439 (gnus-summary-mark-forward n gnus-unread-mark)) | |
8440 | |
8441 (defun gnus-summary-clear-mark-backward (n) | |
8442 "Clear marks from N articles backward. | |
8443 The difference between N and the number of marks cleared is returned." | |
8444 (interactive "p") | |
8445 (gnus-summary-mark-forward (- n) gnus-unread-mark)) | |
8446 | |
8447 (defun gnus-summary-mark-unread-as-read () | |
8448 "Intended to be used by `gnus-summary-mark-article-hook'." | |
8449 (when (memq gnus-current-article gnus-newsgroup-unreads) | |
8450 (gnus-summary-mark-article gnus-current-article gnus-read-mark))) | |
8451 | |
8452 (defun gnus-summary-mark-read-and-unread-as-read () | |
8453 "Intended to be used by `gnus-summary-mark-article-hook'." | |
8454 (let ((mark (gnus-summary-article-mark))) | |
8455 (when (or (gnus-unread-mark-p mark) | |
8456 (gnus-read-mark-p mark)) | |
8457 (gnus-summary-mark-article gnus-current-article gnus-read-mark)))) | |
8458 | |
8459 (defun gnus-summary-mark-region-as-read (point mark all) | |
8460 "Mark all unread articles between point and mark as read. | |
8461 If given a prefix, mark all articles between point and mark as read, | |
8462 even ticked and dormant ones." | |
8463 (interactive "r\nP") | |
8464 (save-excursion | |
8465 (let (article) | |
8466 (goto-char point) | |
8467 (beginning-of-line) | |
8468 (while (and | |
8469 (< (point) mark) | |
8470 (progn | |
8471 (when (or all | |
8472 (memq (setq article (gnus-summary-article-number)) | |
8473 gnus-newsgroup-unreads)) | |
8474 (gnus-summary-mark-article article gnus-del-mark)) | |
8475 t) | |
8476 (gnus-summary-find-next)))))) | |
8477 | |
8478 (defun gnus-summary-mark-below (score mark) | |
8479 "Mark articles with score less than SCORE with MARK." | |
8480 (interactive "P\ncMark: ") | |
8481 (setq score (if score | |
8482 (prefix-numeric-value score) | |
8483 (or gnus-summary-default-score 0))) | |
8484 (save-excursion | |
8485 (set-buffer gnus-summary-buffer) | |
8486 (goto-char (point-min)) | |
8487 (while | |
8488 (progn | |
8489 (and (< (gnus-summary-article-score) score) | |
8490 (gnus-summary-mark-article nil mark)) | |
8491 (gnus-summary-find-next))))) | |
8492 | |
8493 (defun gnus-summary-kill-below (&optional score) | |
8494 "Mark articles with score below SCORE as read." | |
8495 (interactive "P") | |
8496 (gnus-summary-mark-below score gnus-killed-mark)) | |
8497 | |
8498 (defun gnus-summary-clear-above (&optional score) | |
8499 "Clear all marks from articles with score above SCORE." | |
8500 (interactive "P") | |
8501 (gnus-summary-mark-above score gnus-unread-mark)) | |
8502 | |
8503 (defun gnus-summary-tick-above (&optional score) | |
8504 "Tick all articles with score above SCORE." | |
8505 (interactive "P") | |
8506 (gnus-summary-mark-above score gnus-ticked-mark)) | |
8507 | |
8508 (defun gnus-summary-mark-above (score mark) | |
8509 "Mark articles with score over SCORE with MARK." | |
8510 (interactive "P\ncMark: ") | |
8511 (setq score (if score | |
8512 (prefix-numeric-value score) | |
8513 (or gnus-summary-default-score 0))) | |
8514 (save-excursion | |
8515 (set-buffer gnus-summary-buffer) | |
8516 (goto-char (point-min)) | |
8517 (while (and (progn | |
8518 (when (> (gnus-summary-article-score) score) | |
8519 (gnus-summary-mark-article nil mark)) | |
8520 t) | |
8521 (gnus-summary-find-next))))) | |
8522 | |
8523 ;; Suggested by Daniel Quinlan <quinlan@best.com>. | |
8524 (defalias 'gnus-summary-show-all-expunged 'gnus-summary-limit-include-expunged) | |
8525 (defun gnus-summary-limit-include-expunged (&optional no-error) | |
8526 "Display all the hidden articles that were expunged for low scores." | |
8527 (interactive) | |
8528 (let ((buffer-read-only nil)) | |
8529 (let ((scored gnus-newsgroup-scored) | |
8530 headers h) | |
8531 (while scored | |
8532 (unless (gnus-summary-goto-subject (caar scored)) | |
8533 (and (setq h (gnus-summary-article-header (caar scored))) | |
8534 (< (cdar scored) gnus-summary-expunge-below) | |
8535 (push h headers))) | |
8536 (setq scored (cdr scored))) | |
8537 (if (not headers) | |
8538 (when (not no-error) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8539 (error "No expunged articles hidden")) |
17493 | 8540 (goto-char (point-min)) |
8541 (gnus-summary-prepare-unthreaded (nreverse headers)) | |
8542 (goto-char (point-min)) | |
8543 (gnus-summary-position-point) | |
8544 t)))) | |
8545 | |
8546 (defun gnus-summary-catchup (&optional all quietly to-here not-mark) | |
8547 "Mark all unread articles in this newsgroup as read. | |
8548 If prefix argument ALL is non-nil, ticked and dormant articles will | |
8549 also be marked as read. | |
8550 If QUIETLY is non-nil, no questions will be asked. | |
8551 If TO-HERE is non-nil, it should be a point in the buffer. All | |
8552 articles before this point will be marked as read. | |
8553 Note that this function will only catch up the unread article | |
8554 in the current summary buffer limitation. | |
8555 The number of articles marked as read is returned." | |
8556 (interactive "P") | |
8557 (prog1 | |
8558 (save-excursion | |
8559 (when (or quietly | |
8560 (not gnus-interactive-catchup) ;Without confirmation? | |
8561 gnus-expert-user | |
8562 (gnus-y-or-n-p | |
8563 (if all | |
8564 "Mark absolutely all articles as read? " | |
8565 "Mark all unread articles as read? "))) | |
8566 (if (and not-mark | |
8567 (not gnus-newsgroup-adaptive) | |
8568 (not gnus-newsgroup-auto-expire) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8569 (not gnus-suppress-duplicates) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8570 (or (not gnus-use-cache) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8571 (eq gnus-use-cache 'passive))) |
17493 | 8572 (progn |
8573 (when all | |
8574 (setq gnus-newsgroup-marked nil | |
8575 gnus-newsgroup-dormant nil)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8576 (setq gnus-newsgroup-unreads gnus-newsgroup-downloadable)) |
17493 | 8577 ;; We actually mark all articles as canceled, which we |
8578 ;; have to do when using auto-expiry or adaptive scoring. | |
8579 (gnus-summary-show-all-threads) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8580 (when (gnus-summary-first-subject (not all) t) |
17493 | 8581 (while (and |
8582 (if to-here (< (point) to-here) t) | |
8583 (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
|
8584 (gnus-summary-find-next (not all) nil nil t)))) |
17493 | 8585 (gnus-set-mode-line 'summary)) |
8586 t)) | |
8587 (gnus-summary-position-point))) | |
8588 | |
8589 (defun gnus-summary-catchup-to-here (&optional all) | |
8590 "Mark all unticked articles before the current one as read. | |
8591 If ALL is non-nil, also mark ticked and dormant articles as read." | |
8592 (interactive "P") | |
8593 (save-excursion | |
8594 (gnus-save-hidden-threads | |
8595 (let ((beg (point))) | |
8596 ;; We check that there are unread articles. | |
8597 (when (or all (gnus-summary-find-prev)) | |
8598 (gnus-summary-catchup all t beg))))) | |
8599 (gnus-summary-position-point)) | |
8600 | |
8601 (defun gnus-summary-catchup-all (&optional quietly) | |
8602 "Mark all articles in this newsgroup as read." | |
8603 (interactive "P") | |
8604 (gnus-summary-catchup t quietly)) | |
8605 | |
8606 (defun gnus-summary-catchup-and-exit (&optional all quietly) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8607 "Mark all unread articles in this group as read, then exit. |
17493 | 8608 If prefix argument ALL is non-nil, all articles are marked as read." |
8609 (interactive "P") | |
8610 (when (gnus-summary-catchup all quietly nil 'fast) | |
8611 ;; Select next newsgroup or exit. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8612 (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
|
8613 (eq gnus-auto-select-next 'quietly)) |
17493 | 8614 (gnus-summary-next-group nil) |
8615 (gnus-summary-exit)))) | |
8616 | |
8617 (defun gnus-summary-catchup-all-and-exit (&optional quietly) | |
8618 "Mark all articles in this newsgroup as read, and then exit." | |
8619 (interactive "P") | |
8620 (gnus-summary-catchup-and-exit t quietly)) | |
8621 | |
8622 (defun gnus-summary-catchup-and-goto-next-group (&optional all) | |
8623 "Mark all articles in this group as read and select the next group. | |
8624 If given a prefix, mark all articles, unread as well as ticked, as | |
8625 read." | |
8626 (interactive "P") | |
8627 (save-excursion | |
8628 (gnus-summary-catchup all)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8629 (gnus-summary-next-group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8630 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8631 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8632 ;;; with article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8633 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8634 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8635 (defmacro gnus-with-article (article &rest forms) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8636 "Select ARTICLE and perform FORMS in the original article buffer. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8637 Then replace the article with the result." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8638 `(progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8639 ;; We don't want the article to be marked as read. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8640 (let (gnus-mark-article-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8641 (gnus-summary-select-article t t nil ,article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8642 (set-buffer gnus-original-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8643 ,@forms |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8644 (if (not (gnus-check-backend-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8645 'request-replace-article (car gnus-article-current))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8646 (gnus-message 5 "Read-only group; not replacing") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8647 (unless (gnus-request-replace-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8648 ,article (car gnus-article-current) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8649 (current-buffer) t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8650 (error "Couldn't replace article"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8651 ;; The cache and backlog have to be flushed somewhat. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8652 (when gnus-keep-backlog |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8653 (gnus-backlog-remove-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8654 (car gnus-article-current) (cdr gnus-article-current))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8655 (when gnus-use-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8656 (gnus-cache-update-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8657 (car gnus-article-current) (cdr gnus-article-current))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8658 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8659 (put 'gnus-with-article 'lisp-indent-function 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8660 (put 'gnus-with-article 'edebug-form-spec '(form body)) |
17493 | 8661 |
8662 ;; Thread-based commands. | |
8663 | |
8664 (defun gnus-summary-articles-in-thread (&optional article) | |
8665 "Return a list of all articles in the current thread. | |
8666 If ARTICLE is non-nil, return all articles in the thread that starts | |
8667 with that article." | |
8668 (let* ((article (or article (gnus-summary-article-number))) | |
8669 (data (gnus-data-find-list article)) | |
8670 (top-level (gnus-data-level (car data))) | |
8671 (top-subject | |
8672 (cond ((null gnus-thread-operation-ignore-subject) | |
8673 (gnus-simplify-subject-re | |
8674 (mail-header-subject (gnus-data-header (car data))))) | |
8675 ((eq gnus-thread-operation-ignore-subject 'fuzzy) | |
8676 (gnus-simplify-subject-fuzzy | |
8677 (mail-header-subject (gnus-data-header (car data))))) | |
8678 (t nil))) | |
8679 (end-point (save-excursion | |
8680 (if (gnus-summary-go-to-next-thread) | |
8681 (point) (point-max)))) | |
8682 articles) | |
8683 (while (and data | |
8684 (< (gnus-data-pos (car data)) end-point)) | |
8685 (when (or (not top-subject) | |
8686 (string= top-subject | |
8687 (if (eq gnus-thread-operation-ignore-subject 'fuzzy) | |
8688 (gnus-simplify-subject-fuzzy | |
8689 (mail-header-subject | |
8690 (gnus-data-header (car data)))) | |
8691 (gnus-simplify-subject-re | |
8692 (mail-header-subject | |
8693 (gnus-data-header (car data))))))) | |
8694 (push (gnus-data-number (car data)) articles)) | |
8695 (unless (and (setq data (cdr data)) | |
8696 (> (gnus-data-level (car data)) top-level)) | |
8697 (setq data nil))) | |
8698 ;; Return the list of articles. | |
8699 (nreverse articles))) | |
8700 | |
8701 (defun gnus-summary-rethread-current () | |
8702 "Rethread the thread the current article is part of." | |
8703 (interactive) | |
8704 (let* ((gnus-show-threads t) | |
8705 (article (gnus-summary-article-number)) | |
8706 (id (mail-header-id (gnus-summary-article-header))) | |
8707 (gnus-newsgroup-threads (list (gnus-id-to-thread (gnus-root-id id))))) | |
8708 (unless id | |
8709 (error "No article on the current line")) | |
8710 (gnus-rebuild-thread id) | |
8711 (gnus-summary-goto-subject article))) | |
8712 | |
8713 (defun gnus-summary-reparent-thread () | |
8714 "Make the current article child of the marked (or previous) article. | |
8715 | |
8716 Note that the re-threading will only work if `gnus-thread-ignore-subject' | |
8717 is non-nil or the Subject: of both articles are the same." | |
8718 (interactive) | |
8719 (unless (not (gnus-group-read-only-p)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8720 (error "The current newsgroup does not support article editing")) |
17493 | 8721 (unless (<= (length gnus-newsgroup-processable) 1) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8722 (error "No more than one article may be marked")) |
17493 | 8723 (save-window-excursion |
8724 (let ((gnus-article-buffer " *reparent*") | |
8725 (current-article (gnus-summary-article-number)) | |
8726 ;; First grab the marked article, otherwise one line up. | |
8727 (parent-article (if (not (null gnus-newsgroup-processable)) | |
8728 (car gnus-newsgroup-processable) | |
8729 (save-excursion | |
8730 (if (eq (forward-line -1) 0) | |
8731 (gnus-summary-article-number) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8732 (error "Beginning of summary buffer")))))) |
17493 | 8733 (unless (not (eq current-article parent-article)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8734 (error "An article may not be self-referential")) |
17493 | 8735 (let ((message-id (mail-header-id |
8736 (gnus-summary-article-header parent-article)))) | |
8737 (unless (and message-id (not (equal message-id ""))) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8738 (error "No message-id in desired parent")) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8739 (gnus-with-article current-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8740 (save-restriction |
17493 | 8741 (goto-char (point-min)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8742 (message-narrow-to-head) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8743 (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
|
8744 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8745 (re-search-forward "^[^ \t]" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8746 (forward-line -1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8747 (end-of-line) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8748 (insert " " message-id)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8749 (insert "References: " message-id "\n")))) |
17493 | 8750 (set-buffer gnus-summary-buffer) |
8751 (gnus-summary-unmark-all-processable) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8752 (gnus-summary-update-article current-article) |
17493 | 8753 (gnus-summary-rethread-current) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8754 (gnus-message 3 "Article %d is now the child of article %d" |
17493 | 8755 current-article parent-article))))) |
8756 | |
8757 (defun gnus-summary-toggle-threads (&optional arg) | |
8758 "Toggle showing conversation threads. | |
8759 If ARG is positive number, turn showing conversation threads on." | |
8760 (interactive "P") | |
8761 (let ((current (or (gnus-summary-article-number) gnus-newsgroup-end))) | |
8762 (setq gnus-show-threads | |
8763 (if (null arg) (not gnus-show-threads) | |
8764 (> (prefix-numeric-value arg) 0))) | |
8765 (gnus-summary-prepare) | |
8766 (gnus-summary-goto-subject current) | |
8767 (gnus-message 6 "Threading is now %s" (if gnus-show-threads "on" "off")) | |
8768 (gnus-summary-position-point))) | |
8769 | |
8770 (defun gnus-summary-show-all-threads () | |
8771 "Show all threads." | |
8772 (interactive) | |
8773 (save-excursion | |
8774 (let ((buffer-read-only nil)) | |
8775 (subst-char-in-region (point-min) (point-max) ?\^M ?\n t))) | |
8776 (gnus-summary-position-point)) | |
8777 | |
8778 (defun gnus-summary-show-thread () | |
8779 "Show thread subtrees. | |
8780 Returns nil if no thread was there to be shown." | |
8781 (interactive) | |
8782 (let ((buffer-read-only nil) | |
8783 (orig (point)) | |
8784 ;; first goto end then to beg, to have point at beg after let | |
8785 (end (progn (end-of-line) (point))) | |
8786 (beg (progn (beginning-of-line) (point)))) | |
8787 (prog1 | |
8788 ;; Any hidden lines here? | |
8789 (search-forward "\r" end t) | |
8790 (subst-char-in-region beg end ?\^M ?\n t) | |
8791 (goto-char orig) | |
8792 (gnus-summary-position-point)))) | |
8793 | |
8794 (defun gnus-summary-hide-all-threads () | |
8795 "Hide all thread subtrees." | |
8796 (interactive) | |
8797 (save-excursion | |
8798 (goto-char (point-min)) | |
8799 (gnus-summary-hide-thread) | |
8800 (while (zerop (gnus-summary-next-thread 1 t)) | |
8801 (gnus-summary-hide-thread))) | |
8802 (gnus-summary-position-point)) | |
8803 | |
8804 (defun gnus-summary-hide-thread () | |
8805 "Hide thread subtrees. | |
8806 Returns nil if no threads were there to be hidden." | |
8807 (interactive) | |
8808 (let ((buffer-read-only nil) | |
8809 (start (point)) | |
8810 (article (gnus-summary-article-number))) | |
8811 (goto-char start) | |
8812 ;; Go forward until either the buffer ends or the subthread | |
8813 ;; ends. | |
8814 (when (and (not (eobp)) | |
8815 (or (zerop (gnus-summary-next-thread 1 t)) | |
8816 (goto-char (point-max)))) | |
8817 (prog1 | |
8818 (if (and (> (point) start) | |
8819 (search-backward "\n" start t)) | |
8820 (progn | |
8821 (subst-char-in-region start (point) ?\n ?\^M) | |
8822 (gnus-summary-goto-subject article)) | |
8823 (goto-char start) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8824 nil))))) |
17493 | 8825 |
8826 (defun gnus-summary-go-to-next-thread (&optional previous) | |
8827 "Go to the same level (or less) next thread. | |
8828 If PREVIOUS is non-nil, go to previous thread instead. | |
8829 Return the article number moved to, or nil if moving was impossible." | |
8830 (let ((level (gnus-summary-thread-level)) | |
8831 (way (if previous -1 1)) | |
8832 (beg (point))) | |
8833 (forward-line way) | |
8834 (while (and (not (eobp)) | |
8835 (< level (gnus-summary-thread-level))) | |
8836 (forward-line way)) | |
8837 (if (eobp) | |
8838 (progn | |
8839 (goto-char beg) | |
8840 nil) | |
8841 (setq beg (point)) | |
8842 (prog1 | |
8843 (gnus-summary-article-number) | |
8844 (goto-char beg))))) | |
8845 | |
8846 (defun gnus-summary-next-thread (n &optional silent) | |
8847 "Go to the same level next N'th thread. | |
8848 If N is negative, search backward instead. | |
8849 Returns the difference between N and the number of skips actually | |
8850 done. | |
8851 | |
8852 If SILENT, don't output messages." | |
8853 (interactive "p") | |
8854 (let ((backward (< n 0)) | |
8855 (n (abs n))) | |
8856 (while (and (> n 0) | |
8857 (gnus-summary-go-to-next-thread backward)) | |
8858 (decf n)) | |
8859 (unless silent | |
8860 (gnus-summary-position-point)) | |
8861 (when (and (not silent) (/= 0 n)) | |
8862 (gnus-message 7 "No more threads")) | |
8863 n)) | |
8864 | |
8865 (defun gnus-summary-prev-thread (n) | |
8866 "Go to the same level previous N'th thread. | |
8867 Returns the difference between N and the number of skips actually | |
8868 done." | |
8869 (interactive "p") | |
8870 (gnus-summary-next-thread (- n))) | |
8871 | |
8872 (defun gnus-summary-go-down-thread () | |
8873 "Go down one level in the current thread." | |
8874 (let ((children (gnus-summary-article-children))) | |
8875 (when children | |
8876 (gnus-summary-goto-subject (car children))))) | |
8877 | |
8878 (defun gnus-summary-go-up-thread () | |
8879 "Go up one level in the current thread." | |
8880 (let ((parent (gnus-summary-article-parent))) | |
8881 (when parent | |
8882 (gnus-summary-goto-subject parent)))) | |
8883 | |
8884 (defun gnus-summary-down-thread (n) | |
8885 "Go down thread N steps. | |
8886 If N is negative, go up instead. | |
8887 Returns the difference between N and how many steps down that were | |
8888 taken." | |
8889 (interactive "p") | |
8890 (let ((up (< n 0)) | |
8891 (n (abs n))) | |
8892 (while (and (> n 0) | |
8893 (if up (gnus-summary-go-up-thread) | |
8894 (gnus-summary-go-down-thread))) | |
8895 (setq n (1- n))) | |
8896 (gnus-summary-position-point) | |
8897 (when (/= 0 n) | |
8898 (gnus-message 7 "Can't go further")) | |
8899 n)) | |
8900 | |
8901 (defun gnus-summary-up-thread (n) | |
8902 "Go up thread N steps. | |
8903 If N is negative, go up instead. | |
8904 Returns the difference between N and how many steps down that were | |
8905 taken." | |
8906 (interactive "p") | |
8907 (gnus-summary-down-thread (- n))) | |
8908 | |
8909 (defun gnus-summary-top-thread () | |
8910 "Go to the top of the thread." | |
8911 (interactive) | |
8912 (while (gnus-summary-go-up-thread)) | |
8913 (gnus-summary-article-number)) | |
8914 | |
8915 (defun gnus-summary-kill-thread (&optional unmark) | |
8916 "Mark articles under current thread as read. | |
8917 If the prefix argument is positive, remove any kinds of marks. | |
8918 If the prefix argument is negative, tick articles instead." | |
8919 (interactive "P") | |
8920 (when unmark | |
8921 (setq unmark (prefix-numeric-value unmark))) | |
8922 (let ((articles (gnus-summary-articles-in-thread))) | |
8923 (save-excursion | |
8924 ;; Expand the thread. | |
8925 (gnus-summary-show-thread) | |
8926 ;; Mark all the articles. | |
8927 (while articles | |
8928 (gnus-summary-goto-subject (car articles)) | |
8929 (cond ((null unmark) | |
8930 (gnus-summary-mark-article-as-read gnus-killed-mark)) | |
8931 ((> unmark 0) | |
8932 (gnus-summary-mark-article-as-unread gnus-unread-mark)) | |
8933 (t | |
8934 (gnus-summary-mark-article-as-unread gnus-ticked-mark))) | |
8935 (setq articles (cdr articles)))) | |
8936 ;; Hide killed subtrees. | |
8937 (and (null unmark) | |
8938 gnus-thread-hide-killed | |
8939 (gnus-summary-hide-thread)) | |
8940 ;; If marked as read, go to next unread subject. | |
8941 (when (null unmark) | |
8942 ;; Go to next unread subject. | |
8943 (gnus-summary-next-subject 1 t))) | |
8944 (gnus-set-mode-line 'summary)) | |
8945 | |
8946 ;; Summary sorting commands | |
8947 | |
8948 (defun gnus-summary-sort-by-number (&optional reverse) | |
8949 "Sort the summary buffer by article number. | |
8950 Argument REVERSE means reverse order." | |
8951 (interactive "P") | |
8952 (gnus-summary-sort 'number reverse)) | |
8953 | |
8954 (defun gnus-summary-sort-by-author (&optional reverse) | |
8955 "Sort the summary buffer by author name alphabetically. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8956 If `case-fold-search' is non-nil, case of letters is ignored. |
17493 | 8957 Argument REVERSE means reverse order." |
8958 (interactive "P") | |
8959 (gnus-summary-sort 'author reverse)) | |
8960 | |
8961 (defun gnus-summary-sort-by-subject (&optional reverse) | |
8962 "Sort the summary buffer by subject alphabetically. `Re:'s are ignored. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8963 If `case-fold-search' is non-nil, case of letters is ignored. |
17493 | 8964 Argument REVERSE means reverse order." |
8965 (interactive "P") | |
8966 (gnus-summary-sort 'subject reverse)) | |
8967 | |
8968 (defun gnus-summary-sort-by-date (&optional reverse) | |
8969 "Sort the summary buffer by date. | |
8970 Argument REVERSE means reverse order." | |
8971 (interactive "P") | |
8972 (gnus-summary-sort 'date reverse)) | |
8973 | |
8974 (defun gnus-summary-sort-by-score (&optional reverse) | |
8975 "Sort the summary buffer by score. | |
8976 Argument REVERSE means reverse order." | |
8977 (interactive "P") | |
8978 (gnus-summary-sort 'score reverse)) | |
8979 | |
8980 (defun gnus-summary-sort-by-lines (&optional reverse) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8981 "Sort the summary buffer by the number of lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8982 Argument REVERSE means reverse order." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8983 (interactive "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8984 (gnus-summary-sort 'lines reverse)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8985 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8986 (defun gnus-summary-sort-by-chars (&optional reverse) |
17493 | 8987 "Sort the summary buffer by article length. |
8988 Argument REVERSE means reverse order." | |
8989 (interactive "P") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8990 (gnus-summary-sort 'chars reverse)) |
17493 | 8991 |
8992 (defun gnus-summary-sort (predicate reverse) | |
8993 "Sort summary buffer by PREDICATE. REVERSE means reverse order." | |
8994 (let* ((thread (intern (format "gnus-thread-sort-by-%s" predicate))) | |
8995 (article (intern (format "gnus-article-sort-by-%s" predicate))) | |
8996 (gnus-thread-sort-functions | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8997 (if (not reverse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8998 thread |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8999 `(lambda (t1 t2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9000 (,thread t2 t1)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9001 (gnus-sort-gathered-threads-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9002 gnus-thread-sort-functions) |
17493 | 9003 (gnus-article-sort-functions |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9004 (if (not reverse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9005 article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9006 `(lambda (t1 t2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9007 (,article t2 t1)))) |
17493 | 9008 (buffer-read-only) |
9009 (gnus-summary-prepare-hook nil)) | |
9010 ;; We do the sorting by regenerating the threads. | |
9011 (gnus-summary-prepare) | |
9012 ;; Hide subthreads if needed. | |
9013 (when (and gnus-show-threads gnus-thread-hide-subtree) | |
9014 (gnus-summary-hide-all-threads)))) | |
9015 | |
9016 ;; Summary saving commands. | |
9017 | |
9018 (defun gnus-summary-save-article (&optional n not-saved) | |
9019 "Save the current article using the default saver function. | |
9020 If N is a positive number, save the N next articles. | |
9021 If N is a negative number, save the N previous articles. | |
9022 If N is nil and any articles have been marked with the process mark, | |
9023 save those articles instead. | |
9024 The variable `gnus-default-article-saver' specifies the saver function." | |
9025 (interactive "P") | |
9026 (let* ((articles (gnus-summary-work-articles n)) | |
9027 (save-buffer (save-excursion | |
9028 (nnheader-set-temp-buffer " *Gnus Save*"))) | |
9029 (num (length articles)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9030 header file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9031 (dolist (article articles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9032 (setq header (gnus-summary-article-header article)) |
17493 | 9033 (if (not (vectorp header)) |
9034 ;; This is a pseudo-article. | |
9035 (if (assq 'name header) | |
9036 (gnus-copy-file (cdr (assq 'name header))) | |
9037 (gnus-message 1 "Article %d is unsaveable" article)) | |
9038 ;; This is a real article. | |
9039 (save-window-excursion | |
9040 (gnus-summary-select-article t nil nil article)) | |
9041 (save-excursion | |
9042 (set-buffer save-buffer) | |
9043 (erase-buffer) | |
9044 (insert-buffer-substring gnus-original-article-buffer)) | |
9045 (setq file (gnus-article-save save-buffer file num)) | |
9046 (gnus-summary-remove-process-mark article) | |
9047 (unless not-saved | |
9048 (gnus-summary-set-saved-mark article)))) | |
9049 (gnus-kill-buffer save-buffer) | |
9050 (gnus-summary-position-point) | |
9051 (gnus-set-mode-line 'summary) | |
9052 n)) | |
9053 | |
9054 (defun gnus-summary-pipe-output (&optional arg) | |
9055 "Pipe the current article to a subprocess. | |
9056 If N is a positive number, pipe the N next articles. | |
9057 If N is a negative number, pipe the N previous articles. | |
9058 If N is nil and any articles have been marked with the process mark, | |
9059 pipe those articles instead." | |
9060 (interactive "P") | |
9061 (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe)) | |
9062 (gnus-summary-save-article arg t)) | |
9063 (gnus-configure-windows 'pipe)) | |
9064 | |
9065 (defun gnus-summary-save-article-mail (&optional arg) | |
9066 "Append the current article to an mail file. | |
9067 If N is a positive number, save the N next articles. | |
9068 If N is a negative number, save the N previous articles. | |
9069 If N is nil and any articles have been marked with the process mark, | |
9070 save those articles instead." | |
9071 (interactive "P") | |
9072 (let ((gnus-default-article-saver 'gnus-summary-save-in-mail)) | |
9073 (gnus-summary-save-article arg))) | |
9074 | |
9075 (defun gnus-summary-save-article-rmail (&optional arg) | |
9076 "Append the current article to an rmail file. | |
9077 If N is a positive number, save the N next articles. | |
9078 If N is a negative number, save the N previous articles. | |
9079 If N is nil and any articles have been marked with the process mark, | |
9080 save those articles instead." | |
9081 (interactive "P") | |
9082 (let ((gnus-default-article-saver 'gnus-summary-save-in-rmail)) | |
9083 (gnus-summary-save-article arg))) | |
9084 | |
9085 (defun gnus-summary-save-article-file (&optional arg) | |
9086 "Append the current article to a file. | |
9087 If N is a positive number, save the N next articles. | |
9088 If N is a negative number, save the N previous articles. | |
9089 If N is nil and any articles have been marked with the process mark, | |
9090 save those articles instead." | |
9091 (interactive "P") | |
9092 (let ((gnus-default-article-saver 'gnus-summary-save-in-file)) | |
9093 (gnus-summary-save-article arg))) | |
9094 | |
9095 (defun gnus-summary-write-article-file (&optional arg) | |
9096 "Write the current article to a file, deleting the previous file. | |
9097 If N is a positive number, save the N next articles. | |
9098 If N is a negative number, save the N previous articles. | |
9099 If N is nil and any articles have been marked with the process mark, | |
9100 save those articles instead." | |
9101 (interactive "P") | |
9102 (let ((gnus-default-article-saver 'gnus-summary-write-to-file)) | |
9103 (gnus-summary-save-article arg))) | |
9104 | |
9105 (defun gnus-summary-save-article-body-file (&optional arg) | |
9106 "Append the current article body to a file. | |
9107 If N is a positive number, save the N next articles. | |
9108 If N is a negative number, save the N previous articles. | |
9109 If N is nil and any articles have been marked with the process mark, | |
9110 save those articles instead." | |
9111 (interactive "P") | |
9112 (let ((gnus-default-article-saver 'gnus-summary-save-body-in-file)) | |
9113 (gnus-summary-save-article arg))) | |
9114 | |
9115 (defun gnus-summary-pipe-message (program) | |
9116 "Pipe the current article through PROGRAM." | |
9117 (interactive "sProgram: ") | |
9118 (gnus-summary-select-article) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9119 (let ((mail-header-separator "")) |
17493 | 9120 (gnus-eval-in-buffer-window gnus-article-buffer |
9121 (save-restriction | |
9122 (widen) | |
9123 (let ((start (window-start)) | |
9124 buffer-read-only) | |
9125 (message-pipe-buffer-body program) | |
9126 (set-window-start (get-buffer-window (current-buffer)) start)))))) | |
9127 | |
9128 (defun gnus-get-split-value (methods) | |
9129 "Return a value based on the split METHODS." | |
9130 (let (split-name method result match) | |
9131 (when methods | |
9132 (save-excursion | |
9133 (set-buffer gnus-original-article-buffer) | |
9134 (save-restriction | |
9135 (nnheader-narrow-to-headers) | |
32975
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
9136 (while (and methods (not split-name)) |
17493 | 9137 (goto-char (point-min)) |
9138 (setq method (pop methods)) | |
9139 (setq match (car method)) | |
9140 (when (cond | |
9141 ((stringp match) | |
9142 ;; Regular expression. | |
9143 (ignore-errors | |
9144 (re-search-forward match nil t))) | |
9145 ((gnus-functionp match) | |
9146 ;; Function. | |
9147 (save-restriction | |
9148 (widen) | |
9149 (setq result (funcall match gnus-newsgroup-name)))) | |
9150 ((consp match) | |
9151 ;; Form. | |
9152 (save-restriction | |
9153 (widen) | |
9154 (setq result (eval match))))) | |
32975
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
9155 (setq split-name (cdr method)) |
17493 | 9156 (cond ((stringp result) |
9157 (push (expand-file-name | |
9158 result gnus-article-save-directory) | |
9159 split-name)) | |
9160 ((consp result) | |
9161 (setq split-name (append result split-name))))))))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9162 (nreverse split-name))) |
17493 | 9163 |
9164 (defun gnus-valid-move-group-p (group) | |
9165 (and (boundp group) | |
9166 (symbol-name group) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9167 (symbol-value group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9168 (gnus-get-function (gnus-find-method-for-group |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9169 (symbol-name group)) 'request-accept-article t))) |
17493 | 9170 |
9171 (defun gnus-read-move-group-name (prompt default articles prefix) | |
9172 "Read a group name." | |
9173 (let* ((split-name (gnus-get-split-value gnus-move-split-methods)) | |
9174 (minibuffer-confirm-incomplete nil) ; XEmacs | |
9175 (prom | |
9176 (format "%s %s to:" | |
9177 prompt | |
9178 (if (> (length articles) 1) | |
9179 (format "these %d articles" (length articles)) | |
9180 "this article"))) | |
9181 (to-newsgroup | |
9182 (cond | |
9183 ((null split-name) | |
9184 (gnus-completing-read default prom | |
9185 gnus-active-hashtb | |
9186 'gnus-valid-move-group-p | |
9187 nil prefix | |
9188 'gnus-group-history)) | |
9189 ((= 1 (length split-name)) | |
9190 (gnus-completing-read (car split-name) prom | |
9191 gnus-active-hashtb | |
9192 'gnus-valid-move-group-p | |
9193 nil nil | |
9194 'gnus-group-history)) | |
9195 (t | |
9196 (gnus-completing-read nil prom | |
9197 (mapcar (lambda (el) (list el)) | |
9198 (nreverse split-name)) | |
9199 nil nil nil | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9200 'gnus-group-history)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9201 (to-method (gnus-server-to-method (gnus-group-method to-newsgroup)))) |
17493 | 9202 (when to-newsgroup |
9203 (if (or (string= to-newsgroup "") | |
9204 (string= to-newsgroup prefix)) | |
9205 (setq to-newsgroup default)) | |
9206 (unless to-newsgroup | |
9207 (error "No group name entered")) | |
9208 (or (gnus-active to-newsgroup) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9209 (gnus-activate-group to-newsgroup nil nil to-method) |
17493 | 9210 (if (gnus-y-or-n-p (format "No such group: %s. Create it? " |
9211 to-newsgroup)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9212 (or (and (gnus-request-create-group to-newsgroup to-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9213 (gnus-activate-group |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9214 to-newsgroup nil nil to-method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9215 (gnus-subscribe-group to-newsgroup)) |
17493 | 9216 (error "Couldn't create group %s" to-newsgroup))) |
9217 (error "No such group: %s" to-newsgroup))) | |
9218 to-newsgroup)) | |
9219 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9220 (defun gnus-summary-save-parts (type dir n &optional reverse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9221 "Save parts matching TYPE to DIR. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9222 If REVERSE, save parts that do not match TYPE." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9223 (interactive |
31785 | 9224 (list (read-string "Save parts of type: " |
9225 (or (car gnus-summary-save-parts-type-history) | |
9226 gnus-summary-save-parts-default-mime) | |
9227 'gnus-summary-save-parts-type-history) | |
9228 (setq gnus-summary-save-parts-last-directory | |
9229 (read-file-name "Save to directory: " | |
9230 gnus-summary-save-parts-last-directory | |
9231 nil t)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9232 current-prefix-arg)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9233 (gnus-summary-iterate n |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9234 (let ((gnus-display-mime-function nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9235 (gnus-inhibit-treatment t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9236 (gnus-summary-select-article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9237 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9238 (set-buffer gnus-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9239 (let ((handles (or gnus-article-mime-handles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9240 (mm-dissect-buffer) (mm-uu-dissect)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9241 (when handles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9242 (gnus-summary-save-parts-1 type dir handles reverse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9243 (unless gnus-article-mime-handles ;; Don't destroy this case. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9244 (mm-destroy-parts handles))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9245 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9246 (defun gnus-summary-save-parts-1 (type dir handle reverse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9247 (if (stringp (car handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9248 (mapcar (lambda (h) (gnus-summary-save-parts-1 type dir h reverse)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9249 (cdr handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9250 (when (if reverse |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9251 (not (string-match type (mm-handle-media-type handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9252 (string-match type (mm-handle-media-type handle))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9253 (let ((file (expand-file-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9254 (file-name-nondirectory |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9255 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9256 (mail-content-type-get |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9257 (mm-handle-disposition handle) 'filename) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9258 (concat gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9259 "." (number-to-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9260 (cdr gnus-article-current))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9261 dir))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9262 (unless (file-exists-p file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9263 (mm-save-part-to-file handle file)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9264 |
17493 | 9265 ;; Summary extract commands |
9266 | |
9267 (defun gnus-summary-insert-pseudos (pslist &optional not-view) | |
9268 (let ((buffer-read-only nil) | |
9269 (article (gnus-summary-article-number)) | |
9270 after-article b e) | |
9271 (unless (gnus-summary-goto-subject article) | |
9272 (error "No such article: %d" article)) | |
9273 (gnus-summary-position-point) | |
9274 ;; If all commands are to be bunched up on one line, we collect | |
9275 ;; them here. | |
9276 (unless gnus-view-pseudos-separately | |
9277 (let ((ps (setq pslist (sort pslist 'gnus-pseudos<))) | |
9278 files action) | |
9279 (while ps | |
9280 (setq action (cdr (assq 'action (car ps)))) | |
9281 (setq files (list (cdr (assq 'name (car ps))))) | |
9282 (while (and ps (cdr ps) | |
9283 (string= (or action "1") | |
9284 (or (cdr (assq 'action (cadr ps))) "2"))) | |
9285 (push (cdr (assq 'name (cadr ps))) files) | |
9286 (setcdr ps (cddr ps))) | |
9287 (when files | |
9288 (when (not (string-match "%s" action)) | |
9289 (push " " files)) | |
9290 (push " " files) | |
9291 (when (assq 'execute (car ps)) | |
9292 (setcdr (assq 'execute (car ps)) | |
9293 (funcall (if (string-match "%s" action) | |
9294 'format 'concat) | |
9295 action | |
9296 (mapconcat | |
9297 (lambda (f) | |
9298 (if (equal f " ") | |
9299 f | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9300 (mm-quote-arg f))) |
17493 | 9301 files " "))))) |
9302 (setq ps (cdr ps))))) | |
9303 (if (and gnus-view-pseudos (not not-view)) | |
9304 (while pslist | |
9305 (when (assq 'execute (car pslist)) | |
9306 (gnus-execute-command (cdr (assq 'execute (car pslist))) | |
9307 (eq gnus-view-pseudos 'not-confirm))) | |
9308 (setq pslist (cdr pslist))) | |
9309 (save-excursion | |
9310 (while pslist | |
9311 (setq after-article (or (cdr (assq 'article (car pslist))) | |
9312 (gnus-summary-article-number))) | |
9313 (gnus-summary-goto-subject after-article) | |
9314 (forward-line 1) | |
9315 (setq b (point)) | |
9316 (insert " " (file-name-nondirectory | |
9317 (cdr (assq 'name (car pslist)))) | |
9318 ": " (or (cdr (assq 'execute (car pslist))) "") "\n") | |
9319 (setq e (point)) | |
9320 (forward-line -1) ; back to `b' | |
9321 (gnus-add-text-properties | |
9322 b (1- e) (list 'gnus-number gnus-reffed-article-number | |
9323 gnus-mouse-face-prop gnus-mouse-face)) | |
9324 (gnus-data-enter | |
9325 after-article gnus-reffed-article-number | |
9326 gnus-unread-mark b (car pslist) 0 (- e b)) | |
9327 (push gnus-reffed-article-number gnus-newsgroup-unreads) | |
9328 (setq gnus-reffed-article-number (1- gnus-reffed-article-number)) | |
9329 (setq pslist (cdr pslist))))))) | |
9330 | |
9331 (defun gnus-pseudos< (p1 p2) | |
9332 (let ((c1 (cdr (assq 'action p1))) | |
9333 (c2 (cdr (assq 'action p2)))) | |
9334 (and c1 c2 (string< c1 c2)))) | |
9335 | |
9336 (defun gnus-request-pseudo-article (props) | |
9337 (cond ((assq 'execute props) | |
9338 (gnus-execute-command (cdr (assq 'execute props))))) | |
9339 (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
|
9340 (gnus-run-hooks 'gnus-mark-article-hook))) |
17493 | 9341 |
9342 (defun gnus-execute-command (command &optional automatic) | |
9343 (save-excursion | |
9344 (gnus-article-setup-buffer) | |
9345 (set-buffer gnus-article-buffer) | |
9346 (setq buffer-read-only nil) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
9347 (let ((command (if automatic command |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
9348 (read-string "Command: " (cons command 0))))) |
17493 | 9349 (erase-buffer) |
9350 (insert "$ " command "\n\n") | |
9351 (if gnus-view-pseudo-asynchronously | |
9352 (start-process "gnus-execute" (current-buffer) shell-file-name | |
9353 shell-command-switch command) | |
9354 (call-process shell-file-name nil t nil | |
9355 shell-command-switch command))))) | |
9356 | |
9357 ;; Summary kill commands. | |
9358 | |
9359 (defun gnus-summary-edit-global-kill (article) | |
9360 "Edit the \"global\" kill file." | |
9361 (interactive (list (gnus-summary-article-number))) | |
9362 (gnus-group-edit-global-kill article)) | |
9363 | |
9364 (defun gnus-summary-edit-local-kill () | |
9365 "Edit a local kill file applied to the current newsgroup." | |
9366 (interactive) | |
9367 (setq gnus-current-headers (gnus-summary-article-header)) | |
9368 (gnus-group-edit-local-kill | |
9369 (gnus-summary-article-number) gnus-newsgroup-name)) | |
9370 | |
9371 ;;; Header reading. | |
9372 | |
9373 (defun gnus-read-header (id &optional header) | |
9374 "Read the headers of article ID and enter them into the Gnus system." | |
9375 (let ((group gnus-newsgroup-name) | |
9376 (gnus-override-method | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9377 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9378 gnus-override-method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9379 (and (gnus-news-group-p gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9380 (car (gnus-refer-article-methods))))) |
17493 | 9381 where) |
9382 ;; First we check to see whether the header in question is already | |
9383 ;; fetched. | |
9384 (if (stringp id) | |
9385 ;; This is a Message-ID. | |
9386 (setq header (or header (gnus-id-to-header id))) | |
9387 ;; This is an article number. | |
9388 (setq header (or header (gnus-summary-article-header id)))) | |
9389 (if (and header | |
9390 (not (gnus-summary-article-sparse-p (mail-header-number header)))) | |
9391 ;; We have found the header. | |
9392 header | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9393 ;; 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
|
9394 ;; previous entry in the thread hashtb. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9395 (when (and header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9396 (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
|
9397 (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
|
9398 (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
|
9399 (when thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9400 (delq (assq header thread) thread)))) |
17493 | 9401 ;; We have to really fetch the header to this article. |
9402 (save-excursion | |
9403 (set-buffer nntp-server-buffer) | |
9404 (when (setq where (gnus-request-head id group)) | |
9405 (nnheader-fold-continuation-lines) | |
9406 (goto-char (point-max)) | |
9407 (insert ".\n") | |
9408 (goto-char (point-min)) | |
9409 (insert "211 ") | |
9410 (princ (cond | |
9411 ((numberp id) id) | |
9412 ((cdr where) (cdr where)) | |
9413 (header (mail-header-number header)) | |
9414 (t gnus-reffed-article-number)) | |
9415 (current-buffer)) | |
9416 (insert " Article retrieved.\n")) | |
9417 (if (or (not where) | |
9418 (not (setq header (car (gnus-get-newsgroup-headers nil t))))) | |
9419 () ; Malformed head. | |
9420 (unless (gnus-summary-article-sparse-p (mail-header-number header)) | |
9421 (when (and (stringp id) | |
9422 (not (string= (gnus-group-real-name group) | |
9423 (car where)))) | |
9424 ;; If we fetched by Message-ID and the article came | |
9425 ;; from a different group, we fudge some bogus article | |
9426 ;; numbers for this article. | |
9427 (mail-header-set-number header gnus-reffed-article-number)) | |
9428 (save-excursion | |
9429 (set-buffer gnus-summary-buffer) | |
9430 (decf gnus-reffed-article-number) | |
9431 (gnus-remove-header (mail-header-number header)) | |
9432 (push header gnus-newsgroup-headers) | |
9433 (setq gnus-current-headers header) | |
9434 (push (mail-header-number header) gnus-newsgroup-limit))) | |
9435 header))))) | |
9436 | |
9437 (defun gnus-remove-header (number) | |
9438 "Remove header NUMBER from `gnus-newsgroup-headers'." | |
9439 (if (and gnus-newsgroup-headers | |
9440 (= number (mail-header-number (car gnus-newsgroup-headers)))) | |
9441 (pop gnus-newsgroup-headers) | |
9442 (let ((headers gnus-newsgroup-headers)) | |
9443 (while (and (cdr headers) | |
9444 (not (= number (mail-header-number (cadr headers))))) | |
9445 (pop headers)) | |
9446 (when (cdr headers) | |
9447 (setcdr headers (cddr headers)))))) | |
9448 | |
9449 ;;; | |
9450 ;;; summary highlights | |
9451 ;;; | |
9452 | |
9453 (defun gnus-highlight-selected-summary () | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9454 "Highlight selected article in summary buffer." |
17493 | 9455 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>. |
9456 (when gnus-summary-selected-face | |
9457 (save-excursion | |
9458 (let* ((beg (progn (beginning-of-line) (point))) | |
9459 (end (progn (end-of-line) (point))) | |
9460 ;; Fix by Mike Dugan <dugan@bucrf16.bu.edu>. | |
9461 (from (if (get-text-property beg gnus-mouse-face-prop) | |
9462 beg | |
9463 (or (next-single-property-change | |
9464 beg gnus-mouse-face-prop nil end) | |
9465 beg))) | |
9466 (to | |
9467 (if (= from end) | |
9468 (- from 2) | |
9469 (or (next-single-property-change | |
9470 from gnus-mouse-face-prop nil end) | |
9471 end)))) | |
9472 ;; If no mouse-face prop on line we will have to = from = end, | |
9473 ;; so we highlight the entire line instead. | |
9474 (when (= (+ to 2) from) | |
9475 (setq from beg) | |
9476 (setq to end)) | |
9477 (if gnus-newsgroup-selected-overlay | |
9478 ;; Move old overlay. | |
9479 (gnus-move-overlay | |
9480 gnus-newsgroup-selected-overlay from to (current-buffer)) | |
9481 ;; Create new overlay. | |
9482 (gnus-overlay-put | |
9483 (setq gnus-newsgroup-selected-overlay (gnus-make-overlay from to)) | |
9484 'face gnus-summary-selected-face)))))) | |
9485 | |
9486 ;; New implementation by Christian Limpach <Christian.Limpach@nice.ch>. | |
9487 (defun gnus-summary-highlight-line () | |
9488 "Highlight current line according to `gnus-summary-highlight'." | |
9489 (let* ((list gnus-summary-highlight) | |
9490 (p (point)) | |
9491 (end (progn (end-of-line) (point))) | |
9492 ;; now find out where the line starts and leave point there. | |
9493 (beg (progn (beginning-of-line) (point))) | |
9494 (article (gnus-summary-article-number)) | |
9495 (score (or (cdr (assq (or article gnus-current-article) | |
9496 gnus-newsgroup-scored)) | |
9497 gnus-summary-default-score 0)) | |
9498 (mark (or (gnus-summary-article-mark) gnus-unread-mark)) | |
9499 (inhibit-read-only t)) | |
9500 ;; Eval the cars of the lists until we find a match. | |
9501 (let ((default gnus-summary-default-score)) | |
9502 (while (and list | |
9503 (not (eval (caar list)))) | |
9504 (setq list (cdr list)))) | |
9505 (let ((face (cdar list))) | |
9506 (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
|
9507 (gnus-put-text-property-excluding-characters-with-faces |
17493 | 9508 beg end 'face |
9509 (setq face (if (boundp face) (symbol-value face) face))) | |
9510 (when gnus-summary-highlight-line-function | |
9511 (funcall gnus-summary-highlight-line-function article face)))) | |
9512 (goto-char p))) | |
9513 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9514 (defun gnus-update-read-articles (group unread &optional compute) |
17493 | 9515 "Update the list of read articles in GROUP." |
9516 (let* ((active (or gnus-newsgroup-active (gnus-active group))) | |
9517 (entry (gnus-gethash group gnus-newsrc-hashtb)) | |
9518 (info (nth 2 entry)) | |
9519 (prev 1) | |
9520 (unread (sort (copy-sequence unread) '<)) | |
9521 read) | |
9522 (if (or (not info) (not active)) | |
9523 ;; There is no info on this group if it was, in fact, | |
9524 ;; killed. Gnus stores no information on killed groups, so | |
9525 ;; there's nothing to be done. | |
9526 ;; One could store the information somewhere temporarily, | |
9527 ;; perhaps... Hmmm... | |
9528 () | |
9529 ;; Remove any negative articles numbers. | |
9530 (while (and unread (< (car unread) 0)) | |
9531 (setq unread (cdr unread))) | |
9532 ;; Remove any expired article numbers | |
9533 (while (and unread (< (car unread) (car active))) | |
9534 (setq unread (cdr unread))) | |
9535 ;; Compute the ranges of read articles by looking at the list of | |
9536 ;; unread articles. | |
9537 (while unread | |
9538 (when (/= (car unread) prev) | |
9539 (push (if (= prev (1- (car unread))) prev | |
9540 (cons prev (1- (car unread)))) | |
9541 read)) | |
9542 (setq prev (1+ (car unread))) | |
9543 (setq unread (cdr unread))) | |
9544 (when (<= prev (cdr active)) | |
9545 (push (cons prev (cdr active)) read)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9546 (setq read (if (> (length read) 1) (nreverse read) read)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9547 (if compute |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9548 read |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9549 (save-excursion |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9550 (let (setmarkundo) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9551 ;; Propagate the read marks to the backend. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9552 (when (gnus-check-backend-function 'request-set-mark group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9553 (let ((del (gnus-remove-from-range (gnus-info-read info) read)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9554 (add (gnus-remove-from-range read (gnus-info-read info)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9555 (when (or add del) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9556 (unless (gnus-check-group group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9557 (error "Can't open server for %s" group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9558 (gnus-request-set-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9559 group (delq nil (list (if add (list add 'add '(read))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9560 (if del (list del 'del '(read)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9561 (setq setmarkundo |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9562 `(gnus-request-set-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9563 ,group |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9564 ',(delq nil (list |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9565 (if del (list del 'add '(read))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9566 (if add (list add 'del '(read)))))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9567 (set-buffer gnus-group-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9568 (gnus-undo-register |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9569 `(progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9570 (gnus-info-set-marks ',info ',(gnus-info-marks info) t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9571 (gnus-info-set-read ',info ',(gnus-info-read info)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9572 (gnus-get-unread-articles-in-group ',info |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9573 (gnus-active ,group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9574 (gnus-group-update-group ,group t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9575 ,setmarkundo)))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9576 ;; Enter this list into the group info. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9577 (gnus-info-set-read info read) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9578 ;; 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
|
9579 (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
|
9580 t)))) |
17493 | 9581 |
9582 (defun gnus-offer-save-summaries () | |
9583 "Offer to save all active summary buffers." | |
9584 (save-excursion | |
9585 (let ((buflist (buffer-list)) | |
9586 buffers bufname) | |
9587 ;; Go through all buffers and find all summaries. | |
9588 (while buflist | |
9589 (and (setq bufname (buffer-name (car buflist))) | |
9590 (string-match "Summary" bufname) | |
9591 (save-excursion | |
9592 (set-buffer bufname) | |
9593 ;; We check that this is, indeed, a summary buffer. | |
9594 (and (eq major-mode 'gnus-summary-mode) | |
9595 ;; Also make sure this isn't bogus. | |
9596 gnus-newsgroup-prepared | |
9597 ;; Also make sure that this isn't a dead summary buffer. | |
9598 (not gnus-dead-summary-mode))) | |
9599 (push bufname buffers)) | |
9600 (setq buflist (cdr buflist))) | |
9601 ;; Go through all these summary buffers and offer to save them. | |
9602 (when buffers | |
9603 (map-y-or-n-p | |
9604 "Update summary buffer %s? " | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9605 (lambda (buf) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9606 (switch-to-buffer buf) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9607 (gnus-summary-exit)) |
17493 | 9608 buffers))))) |
9609 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9610 (defun gnus-summary-setup-default-charset () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9611 "Setup newsgroup default charset." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9612 (if (equal gnus-newsgroup-name "nndraft:drafts") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9613 (setq gnus-newsgroup-charset nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9614 (let* ((name (and gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9615 (gnus-group-real-name gnus-newsgroup-name))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9616 (ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9617 (or gnus-newsgroup-ephemeral-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9618 (append |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9619 (and gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9620 (or (gnus-group-find-parameter gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9621 'ignored-charsets t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9622 (let ((alist gnus-group-ignored-charsets-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9623 elem (charsets nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9624 (while (setq elem (pop alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9625 (when (and name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9626 (string-match (car elem) name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9627 (setq alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9628 charsets (cdr elem)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9629 charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9630 gnus-newsgroup-ignored-charsets)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9631 (setq gnus-newsgroup-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9632 (or gnus-newsgroup-ephemeral-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9633 (and gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9634 (or (gnus-group-find-parameter gnus-newsgroup-name 'charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9635 (let ((alist gnus-group-charset-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9636 elem charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9637 (while (setq elem (pop alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9638 (when (and name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9639 (string-match (car elem) name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9640 (setq alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9641 charset (cadr elem)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9642 charset))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9643 gnus-default-charset)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9644 (set (make-local-variable 'gnus-newsgroup-ignored-charsets) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9645 ignored-charsets)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9646 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9647 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9648 ;;; Mime Commands |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9649 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9650 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9651 (defun gnus-summary-display-buttonized (&optional show-all-parts) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9652 "Display the current article buffer fully MIME-buttonized. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9653 If SHOW-ALL-PARTS (the prefix) is non-nil, all multipart/* parts are |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9654 treated as multipart/mixed." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9655 (interactive "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9656 (require 'gnus-art) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9657 (let ((gnus-unbuttonized-mime-types nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9658 (gnus-mime-display-multipart-as-mixed show-all-parts)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9659 (gnus-summary-show-article))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9660 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9661 (defun gnus-summary-repair-multipart (article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9662 "Add a Content-Type header to a multipart article without one." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9663 (interactive (list (gnus-summary-article-number))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9664 (gnus-with-article article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9665 (message-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9666 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9667 (widen) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9668 (when (search-forward "\n--" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9669 (let ((separator (buffer-substring (point) (gnus-point-at-eol)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9670 (message-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9671 (message-remove-header "Mime-Version") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9672 (message-remove-header "Content-Type") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9673 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9674 (insert (format "Content-Type: multipart/mixed; boundary=\"%s\"\n" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9675 separator)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9676 (insert "Mime-Version: 1.0\n") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9677 (widen)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9678 (let (gnus-mark-article-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9679 (gnus-summary-select-article t t nil article))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9680 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9681 (defun gnus-summary-toggle-display-buttonized () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9682 "Toggle the buttonizing of the article buffer." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9683 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9684 (require 'gnus-art) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9685 (if (setq gnus-inhibit-mime-unbuttonizing |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9686 (not gnus-inhibit-mime-unbuttonizing)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9687 (let ((gnus-unbuttonized-mime-types nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9688 (gnus-summary-show-article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9689 (gnus-summary-show-article))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9690 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9691 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9692 ;;; Generic summary marking commands |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9693 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9694 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9695 (defvar gnus-summary-marking-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9696 '((read gnus-del-mark "d") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9697 (unread gnus-unread-mark "u") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9698 (ticked gnus-ticked-mark "!") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9699 (dormant gnus-dormant-mark "?") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9700 (expirable gnus-expirable-mark "e")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9701 "An alist of names/marks/keystrokes.") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9702 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9703 (defvar gnus-summary-generic-mark-map (make-sparse-keymap)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9704 (defvar gnus-summary-mark-map) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9705 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9706 (defun gnus-summary-make-all-marking-commands () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9707 (define-key gnus-summary-mark-map "M" gnus-summary-generic-mark-map) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9708 (dolist (elem gnus-summary-marking-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9709 (apply 'gnus-summary-make-marking-command elem))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9710 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9711 (defun gnus-summary-make-marking-command (name mark keystroke) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9712 (let ((map (make-sparse-keymap))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9713 (define-key gnus-summary-generic-mark-map keystroke map) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9714 (dolist (lway `((next "next" next nil "n") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9715 (next-unread "next unread" next t "N") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9716 (prev "previous" prev nil "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9717 (prev-unread "previous unread" prev t "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9718 (nomove "" nil nil ,keystroke))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9719 (let ((func (gnus-summary-make-marking-command-1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9720 mark (car lway) lway name))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9721 (setq func (eval func)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9722 (define-key map (nth 4 lway) func))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9723 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9724 (defun gnus-summary-make-marking-command-1 (mark way lway name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9725 `(defun ,(intern |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9726 (format "gnus-summary-put-mark-as-%s%s" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9727 name (if (eq way 'nomove) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9728 "" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9729 (concat "-" (symbol-name way))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9730 (n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9731 ,(format |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9732 "Mark the current article as %s%s. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9733 If N, the prefix, then repeat N times. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9734 If N is negative, move in reverse order. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9735 The difference between N and the actual number of articles marked is |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9736 returned." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9737 name (cadr lway)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9738 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9739 (gnus-summary-generic-mark n ,mark ',(nth 2 lway) ,(nth 3 lway)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9740 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9741 (defun gnus-summary-generic-mark (n mark move unread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9742 "Mark N articles with MARK." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9743 (unless (eq major-mode 'gnus-summary-mode) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9744 (error "This command can only be used in the summary buffer")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9745 (gnus-summary-show-thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9746 (let ((nummove |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9747 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9748 ((eq move 'next) 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9749 ((eq move 'prev) -1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9750 (t 0)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9751 (if (zerop nummove) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9752 (setq n 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9753 (when (< n 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9754 (setq n (abs n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9755 nummove (* -1 nummove)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9756 (while (and (> n 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9757 (gnus-summary-mark-article nil mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9758 (zerop (gnus-summary-next-subject nummove unread t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9759 (setq n (1- n))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9760 (when (/= 0 n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9761 (gnus-message 7 "No more %sarticles" (if mark "" "unread "))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9762 (gnus-summary-recenter) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9763 (gnus-summary-position-point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9764 (gnus-set-mode-line 'summary) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9765 n)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9766 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9767 (gnus-summary-make-all-marking-commands) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9768 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
9769 (gnus-ems-redefine) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
9770 |
17493 | 9771 (provide 'gnus-sum) |
9772 | |
9773 (run-hooks 'gnus-sum-load-hook) | |
9774 | |
9775 ;;; gnus-sum.el ends here |