Mercurial > emacs
annotate lisp/gnus/gnus-sum.el @ 33732:539994bfd07d
(_LARGEFILE_SOURCE, _FILE_OFFSET_BITS): Don't define.
author | Dave Love <fx@gnu.org> |
---|---|
date | Wed, 22 Nov 2000 10:37:31 +0000 |
parents | 9bdbbcd7be00 |
children | 158463f1a26e |
rev | line source |
---|---|
17493 | 1 ;;; gnus-sum.el --- summary mode commands for Gnus |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3 ;; Free Software Foundation, Inc. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 6 ;; Keywords: news |
7 | |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
23 ;; Boston, MA 02111-1307, USA. | |
24 | |
25 ;;; Commentary: | |
26 | |
27 ;;; Code: | |
28 | |
19521
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
29 (eval-when-compile (require 'cl)) |
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
30 |
17493 | 31 (require 'gnus) |
32 (require 'gnus-group) | |
33 (require 'gnus-spec) | |
34 (require 'gnus-range) | |
35 (require 'gnus-int) | |
36 (require 'gnus-undo) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
37 (require 'gnus-util) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
38 (require 'mm-decode) |
33126 | 39 ;; Recursive :-(. |
40 ;; (require 'gnus-art) | |
41 (require 'nnoo) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
42 (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
|
43 (autoload 'gnus-cache-write-active "gnus-cache") |
33126 | 44 (autoload 'mm-uu-dissect "mm-uu") |
17493 | 45 |
46 (defcustom gnus-kill-summary-on-exit t | |
47 "*If non-nil, kill the summary buffer when you exit from it. | |
48 If nil, the summary will become a \"*Dead Summary*\" buffer, and | |
49 it will be killed sometime later." | |
50 :group 'gnus-summary-exit | |
51 :type 'boolean) | |
52 | |
53 (defcustom gnus-fetch-old-headers nil | |
54 "*Non-nil means that Gnus will try to build threads by grabbing old headers. | |
55 If an unread article in the group refers to an older, already read (or | |
56 just marked as read) article, the old article will not normally be | |
57 displayed in the Summary buffer. If this variable is non-nil, Gnus | |
58 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
|
59 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
|
60 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
|
61 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
|
62 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
|
63 old headers will be fetched, but none will be displayed. |
17493 | 64 |
65 The server has to support NOV for any of this to work." | |
66 :group 'gnus-thread | |
67 :type '(choice (const :tag "off" nil) | |
68 (const some) | |
69 number | |
70 (sexp :menu-tag "other" t))) | |
71 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
72 (defcustom gnus-refer-thread-limit 200 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
73 "*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
|
74 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
|
75 :group 'gnus-thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
76 :type '(choice number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
77 (sexp :menu-tag "other" t))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
78 |
17493 | 79 (defcustom gnus-summary-make-false-root 'adopt |
80 "*nil means that Gnus won't gather loose threads. | |
81 If the root of a thread has expired or been read in a previous | |
82 session, the information necessary to build a complete thread has been | |
83 lost. Instead of having many small sub-threads from this original thread | |
84 scattered all over the summary buffer, Gnus can gather them. | |
85 | |
86 If non-nil, Gnus will try to gather all loose sub-threads from an | |
87 original thread into one large thread. | |
88 | |
89 If this variable is non-nil, it should be one of `none', `adopt', | |
90 `dummy' or `empty'. | |
91 | |
92 If this variable is `none', Gnus will not make a false root, but just | |
93 present the sub-threads after another. | |
94 If this variable is `dummy', Gnus will create a dummy root that will | |
95 have all the sub-threads as children. | |
96 If this variable is `adopt', Gnus will make one of the \"children\" | |
97 the parent and mark all the step-children as such. | |
98 If this variable is `empty', the \"children\" are printed with empty | |
99 subject fields. (Or rather, they will be printed with a string | |
100 given by the `gnus-summary-same-subject' variable.)" | |
101 :group 'gnus-thread | |
102 :type '(choice (const :tag "off" nil) | |
103 (const none) | |
104 (const dummy) | |
105 (const adopt) | |
106 (const empty))) | |
107 | |
108 (defcustom gnus-summary-gather-exclude-subject "^ *$\\|^(none)$" | |
109 "*A regexp to match subjects to be excluded from loose thread gathering. | |
110 As loose thread gathering is done on subjects only, that means that | |
111 there can be many false gatherings performed. By rooting out certain | |
112 common subjects, gathering might become saner." | |
113 :group 'gnus-thread | |
114 :type 'regexp) | |
115 | |
116 (defcustom gnus-summary-gather-subject-limit nil | |
117 "*Maximum length of subject comparisons when gathering loose threads. | |
118 Use nil to compare full subjects. Setting this variable to a low | |
119 number will help gather threads that have been corrupted by | |
120 newsreaders chopping off subject lines, but it might also mean that | |
121 unrelated articles that have subject that happen to begin with the | |
122 same few characters will be incorrectly gathered. | |
123 | |
124 If this variable is `fuzzy', Gnus will use a fuzzy algorithm when | |
125 comparing subjects." | |
126 :group 'gnus-thread | |
127 :type '(choice (const :tag "off" nil) | |
128 (const fuzzy) | |
129 (sexp :menu-tag "on" t))) | |
130 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
131 (defcustom gnus-simplify-subject-functions nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
132 "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
|
133 The functions are applied recursively. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
134 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
135 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
|
136 `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
|
137 :group 'gnus-thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
138 :type '(repeat function)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
139 |
17493 | 140 (defcustom gnus-simplify-ignored-prefixes nil |
141 "*Regexp, matches for which are removed from subject lines when simplifying fuzzily." | |
142 :group 'gnus-thread | |
143 :type '(choice (const :tag "off" nil) | |
144 regexp)) | |
145 | |
146 (defcustom gnus-build-sparse-threads nil | |
147 "*If non-nil, fill in the gaps in threads. | |
148 If `some', only fill in the gaps that are needed to tie loose threads | |
149 together. If `more', fill in all leaf nodes that Gnus can find. If | |
150 non-nil and non-`some', fill in all gaps that Gnus manages to guess." | |
151 :group 'gnus-thread | |
152 :type '(choice (const :tag "off" nil) | |
153 (const some) | |
154 (const more) | |
155 (sexp :menu-tag "all" t))) | |
156 | |
157 (defcustom gnus-summary-thread-gathering-function | |
158 'gnus-gather-threads-by-subject | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
159 "*Function used for gathering loose threads. |
17493 | 160 There are two pre-defined functions: `gnus-gather-threads-by-subject', |
161 which only takes Subjects into consideration; and | |
162 `gnus-gather-threads-by-references', which compared the References | |
163 headers of the articles to find matches." | |
164 :group 'gnus-thread | |
19912
4355457d9749
(gnus-summary-thread-gathering-function): Fix customize type.
Richard M. Stallman <rms@gnu.org>
parents:
19594
diff
changeset
|
165 :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
|
166 (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
|
167 (function :tag "other"))) |
17493 | 168 |
169 (defcustom gnus-summary-same-subject "" | |
170 "*String indicating that the current article has the same subject as the previous. | |
171 This variable will only be used if the value of | |
172 `gnus-summary-make-false-root' is `empty'." | |
173 :group 'gnus-summary-format | |
174 :type 'string) | |
175 | |
176 (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
|
177 "*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
|
178 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
|
179 \"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
|
180 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
|
181 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
182 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
|
183 (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
|
184 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
|
185 whether it is read or not." |
17493 | 186 :group 'gnus-summary-marks |
187 :link '(custom-manual "(gnus)Setting Marks") | |
188 :type '(choice (const :tag "off" nil) | |
189 (const never) | |
190 (sexp :menu-tag "on" t))) | |
191 | |
192 (defcustom gnus-summary-default-score 0 | |
193 "*Default article score level. | |
194 All scores generated by the score files will be added to this score. | |
195 If this variable is nil, scoring will be disabled." | |
196 :group 'gnus-score-default | |
197 :type '(choice (const :tag "disable") | |
198 integer)) | |
199 | |
200 (defcustom gnus-summary-zcore-fuzz 0 | |
201 "*Fuzziness factor for the zcore in the summary buffer. | |
202 Articles with scores closer than this to `gnus-summary-default-score' | |
203 will not be marked." | |
204 :group 'gnus-summary-format | |
205 :type 'integer) | |
206 | |
207 (defcustom gnus-simplify-subject-fuzzy-regexp nil | |
208 "*Strings to be removed when doing fuzzy matches. | |
209 This can either be a regular expression or list of regular expressions | |
210 that will be removed from subject strings if fuzzy subject | |
211 simplification is selected." | |
212 :group 'gnus-thread | |
213 :type '(repeat regexp)) | |
214 | |
215 (defcustom gnus-show-threads t | |
216 "*If non-nil, display threads in summary mode." | |
217 :group 'gnus-thread | |
218 :type 'boolean) | |
219 | |
220 (defcustom gnus-thread-hide-subtree nil | |
221 "*If non-nil, hide all threads initially. | |
222 If threads are hidden, you have to run the command | |
223 `gnus-summary-show-thread' by hand or use `gnus-select-article-hook' | |
224 to expose hidden threads." | |
225 :group 'gnus-thread | |
226 :type 'boolean) | |
227 | |
228 (defcustom gnus-thread-hide-killed t | |
229 "*If non-nil, hide killed threads automatically." | |
230 :group 'gnus-thread | |
231 :type 'boolean) | |
232 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
233 (defcustom gnus-thread-ignore-subject t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
234 "*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
|
235 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
|
236 start separate threads." |
17493 | 237 :group 'gnus-thread |
238 :type 'boolean) | |
239 | |
240 (defcustom gnus-thread-operation-ignore-subject t | |
241 "*If non-nil, subjects will be ignored when doing thread commands. | |
242 This affects commands like `gnus-summary-kill-thread' and | |
243 `gnus-summary-lower-thread'. | |
244 | |
245 If this variable is nil, articles in the same thread with different | |
246 subjects will not be included in the operation in question. If this | |
247 variable is `fuzzy', only articles that have subjects that are fuzzily | |
248 equal will be included." | |
249 :group 'gnus-thread | |
250 :type '(choice (const :tag "off" nil) | |
251 (const fuzzy) | |
252 (sexp :tag "on" t))) | |
253 | |
254 (defcustom gnus-thread-indent-level 4 | |
255 "*Number that says how much each sub-thread should be indented." | |
256 :group 'gnus-thread | |
257 :type 'integer) | |
258 | |
259 (defcustom gnus-auto-extend-newsgroup t | |
260 "*If non-nil, extend newsgroup forward and backward when requested." | |
261 :group 'gnus-summary-choose | |
262 :type 'boolean) | |
263 | |
264 (defcustom gnus-auto-select-first t | |
265 "*If nil, don't select the first unread article when entering a group. | |
266 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
|
267 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
|
268 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
269 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
|
270 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
|
271 `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
|
272 `gnus-summary-best-unread-article'. |
17493 | 273 |
274 If you want to prevent automatic selection of the first unread article | |
275 in some newsgroups, set the variable to nil in | |
276 `gnus-select-group-hook'." | |
277 :group 'gnus-group-select | |
278 :type '(choice (const :tag "none" nil) | |
279 (const best) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
280 (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
|
281 (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
|
282 (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
|
283 (function-item gnus-summary-best-unread-article))) |
17493 | 284 |
285 (defcustom gnus-auto-select-next t | |
286 "*If non-nil, offer to go to the next group from the end of the previous. | |
287 If the value is t and the next newsgroup is empty, Gnus will exit | |
288 summary mode and go back to group mode. If the value is neither nil | |
289 nor t, Gnus will select the following unread newsgroup. In | |
290 particular, if the value is the symbol `quietly', the next unread | |
291 newsgroup will be selected without any confirmation, and if it is | |
292 `almost-quietly', the next group will be selected without any | |
293 confirmation if you are located on the last article in the group. | |
294 Finally, if this variable is `slightly-quietly', the `Z n' command | |
295 will go to the next group without confirmation." | |
296 :group 'gnus-summary-maneuvering | |
297 :type '(choice (const :tag "off" nil) | |
298 (const quietly) | |
299 (const almost-quietly) | |
300 (const slightly-quietly) | |
301 (sexp :menu-tag "on" t))) | |
302 | |
303 (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
|
304 "*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
|
305 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
|
306 the first unread article." |
17493 | 307 :group 'gnus-summary-maneuvering |
308 :type 'boolean) | |
309 | |
310 (defcustom gnus-summary-check-current nil | |
311 "*If non-nil, consider the current article when moving. | |
312 The \"unread\" movement commands will stay on the same line if the | |
313 current article is unread." | |
314 :group 'gnus-summary-maneuvering | |
315 :type 'boolean) | |
316 | |
317 (defcustom gnus-auto-center-summary t | |
318 "*If non-nil, always center the current summary buffer. | |
319 In particular, if `vertical' do only vertical recentering. If non-nil | |
320 and non-`vertical', do both horizontal and vertical recentering." | |
321 :group 'gnus-summary-maneuvering | |
322 :type '(choice (const :tag "none" nil) | |
323 (const vertical) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
324 (integer :tag "height") |
17493 | 325 (sexp :menu-tag "both" t))) |
326 | |
327 (defcustom gnus-show-all-headers nil | |
328 "*If non-nil, don't hide any headers." | |
329 :group 'gnus-article-hiding | |
330 :group 'gnus-article-headers | |
331 :type 'boolean) | |
332 | |
333 (defcustom gnus-summary-ignore-duplicates nil | |
334 "*If non-nil, ignore articles with identical Message-ID headers." | |
335 :group 'gnus-summary | |
336 :type 'boolean) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
337 |
17493 | 338 (defcustom gnus-single-article-buffer t |
339 "*If non-nil, display all articles in the same buffer. | |
340 If nil, each group will get its own article buffer." | |
341 :group 'gnus-article-various | |
342 :type 'boolean) | |
343 | |
344 (defcustom gnus-break-pages t | |
345 "*If non-nil, do page breaking on articles. | |
346 The page delimiter is specified by the `gnus-page-delimiter' | |
347 variable." | |
348 :group 'gnus-article-various | |
349 :type 'boolean) | |
350 | |
351 (defcustom gnus-move-split-methods nil | |
352 "*Variable used to suggest where articles are to be moved to. | |
353 It uses the same syntax as the `gnus-split-methods' variable." | |
354 :group 'gnus-summary-mail | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
355 :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
|
356 (cons :value ("" "") regexp (repeat string)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
357 (sexp :value nil)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
358 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
359 (defcustom gnus-unread-mark ? ;Whitespace |
17493 | 360 "*Mark used for unread articles." |
361 :group 'gnus-summary-marks | |
362 :type 'character) | |
363 | |
364 (defcustom gnus-ticked-mark ?! | |
365 "*Mark used for ticked articles." | |
366 :group 'gnus-summary-marks | |
367 :type 'character) | |
368 | |
369 (defcustom gnus-dormant-mark ?? | |
370 "*Mark used for dormant articles." | |
371 :group 'gnus-summary-marks | |
372 :type 'character) | |
373 | |
374 (defcustom gnus-del-mark ?r | |
375 "*Mark used for del'd articles." | |
376 :group 'gnus-summary-marks | |
377 :type 'character) | |
378 | |
379 (defcustom gnus-read-mark ?R | |
380 "*Mark used for read articles." | |
381 :group 'gnus-summary-marks | |
382 :type 'character) | |
383 | |
384 (defcustom gnus-expirable-mark ?E | |
385 "*Mark used for expirable articles." | |
386 :group 'gnus-summary-marks | |
387 :type 'character) | |
388 | |
389 (defcustom gnus-killed-mark ?K | |
390 "*Mark used for killed articles." | |
391 :group 'gnus-summary-marks | |
392 :type 'character) | |
393 | |
394 (defcustom gnus-souped-mark ?F | |
395 "*Mark used for killed articles." | |
396 :group 'gnus-summary-marks | |
397 :type 'character) | |
398 | |
399 (defcustom gnus-kill-file-mark ?X | |
400 "*Mark used for articles killed by kill files." | |
401 :group 'gnus-summary-marks | |
402 :type 'character) | |
403 | |
404 (defcustom gnus-low-score-mark ?Y | |
405 "*Mark used for articles with a low score." | |
406 :group 'gnus-summary-marks | |
407 :type 'character) | |
408 | |
409 (defcustom gnus-catchup-mark ?C | |
410 "*Mark used for articles that are caught up." | |
411 :group 'gnus-summary-marks | |
412 :type 'character) | |
413 | |
414 (defcustom gnus-replied-mark ?A | |
415 "*Mark used for articles that have been replied to." | |
416 :group 'gnus-summary-marks | |
417 :type 'character) | |
418 | |
419 (defcustom gnus-cached-mark ?* | |
420 "*Mark used for articles that are in the cache." | |
421 :group 'gnus-summary-marks | |
422 :type 'character) | |
423 | |
424 (defcustom gnus-saved-mark ?S | |
425 "*Mark used for articles that have been saved to." | |
426 :group 'gnus-summary-marks | |
427 :type 'character) | |
428 | |
429 (defcustom gnus-ancient-mark ?O | |
430 "*Mark used for ancient articles." | |
431 :group 'gnus-summary-marks | |
432 :type 'character) | |
433 | |
434 (defcustom gnus-sparse-mark ?Q | |
435 "*Mark used for sparsely reffed articles." | |
436 :group 'gnus-summary-marks | |
437 :type 'character) | |
438 | |
439 (defcustom gnus-canceled-mark ?G | |
440 "*Mark used for canceled articles." | |
441 :group 'gnus-summary-marks | |
442 :type 'character) | |
443 | |
444 (defcustom gnus-duplicate-mark ?M | |
445 "*Mark used for duplicate articles." | |
446 :group 'gnus-summary-marks | |
447 :type 'character) | |
448 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
449 (defcustom gnus-undownloaded-mark ?@ |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
450 "*Mark used for articles that weren't downloaded." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
451 :group 'gnus-summary-marks |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
452 :type 'character) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
453 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
454 (defcustom gnus-downloadable-mark ?% |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
455 "*Mark used for articles that are to be downloaded." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
456 :group 'gnus-summary-marks |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
457 :type 'character) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
458 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
459 (defcustom gnus-unsendable-mark ?= |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
460 "*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
|
461 :group 'gnus-summary-marks |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
462 :type 'character) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
463 |
17493 | 464 (defcustom gnus-score-over-mark ?+ |
465 "*Score mark used for articles with high scores." | |
466 :group 'gnus-summary-marks | |
467 :type 'character) | |
468 | |
469 (defcustom gnus-score-below-mark ?- | |
470 "*Score mark used for articles with low scores." | |
471 :group 'gnus-summary-marks | |
472 :type 'character) | |
473 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
474 (defcustom gnus-empty-thread-mark ? ;Whitespace |
17493 | 475 "*There is no thread under the article." |
476 :group 'gnus-summary-marks | |
477 :type 'character) | |
478 | |
479 (defcustom gnus-not-empty-thread-mark ?= | |
480 "*There is a thread under the article." | |
481 :group 'gnus-summary-marks | |
482 :type 'character) | |
483 | |
484 (defcustom gnus-view-pseudo-asynchronously nil | |
485 "*If non-nil, Gnus will view pseudo-articles asynchronously." | |
486 :group 'gnus-extract-view | |
487 :type 'boolean) | |
488 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
489 (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
|
490 (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
|
491 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
|
492 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
|
493 "*The list of marks converted into expiration if a group is auto-expirable." |
33399 | 494 :version "21.1" |
31716
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." |
33399 | 500 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
501 :group 'gnus-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
502 :type 'boolean) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
503 |
17493 | 504 (defcustom gnus-view-pseudos nil |
505 "*If `automatic', pseudo-articles will be viewed automatically. | |
506 If `not-confirm', pseudos will be viewed automatically, and the user | |
507 will not be asked to confirm the command." | |
508 :group 'gnus-extract-view | |
509 :type '(choice (const :tag "off" nil) | |
510 (const automatic) | |
511 (const not-confirm))) | |
512 | |
513 (defcustom gnus-view-pseudos-separately t | |
514 "*If non-nil, one pseudo-article will be created for each file to be viewed. | |
515 If nil, all files that use the same viewing command will be given as a | |
516 list of parameters to that command." | |
517 :group 'gnus-extract-view | |
518 :type 'boolean) | |
519 | |
520 (defcustom gnus-insert-pseudo-articles t | |
521 "*If non-nil, insert pseudo-articles when decoding articles." | |
522 :group 'gnus-extract-view | |
523 :type 'boolean) | |
524 | |
525 (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
|
526 " %(: :%) %S\n" |
17493 | 527 "*The format specification for the dummy roots in the summary buffer. |
528 It works along the same lines as a normal formatting string, | |
529 with some simple extensions. | |
530 | |
531 %S The subject" | |
532 :group 'gnus-threading | |
533 :type 'string) | |
534 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
535 (defcustom gnus-summary-mode-line-format "Gnus: %g [%A] %Z" |
17493 | 536 "*The format specification for the summary mode line. |
537 It works along the same lines as a normal formatting string, | |
538 with some simple extensions: | |
539 | |
540 %G Group name | |
541 %p Unprefixed group name | |
542 %A Current article number | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
543 %z Current article score |
17493 | 544 %V Gnus version |
545 %U Number of unread articles in the group | |
546 %e Number of unselected articles in the group | |
547 %Z A string with unread/unselected article counts | |
548 %g Shortish group name | |
549 %S Subject of the current article | |
550 %u User-defined spec | |
551 %s Current score file name | |
552 %d Number of dormant articles | |
553 %r Number of articles that have been marked as read in this session | |
554 %E Number of articles expunged by the score files" | |
555 :group 'gnus-summary-format | |
556 :type 'string) | |
557 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
558 (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
|
559 "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
|
560 This can also be a list of regexps." |
33399 | 561 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
562 :group 'gnus-summary-format |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
563 :group 'gnus-article-hiding |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
564 :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
|
565 (regexp :value ".*") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
566 (repeat :value (".*") regexp))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
567 |
17493 | 568 (defcustom gnus-summary-mark-below 0 |
569 "*Mark all articles with a score below this variable as read. | |
570 This variable is local to each summary buffer and usually set by the | |
571 score file." | |
572 :group 'gnus-score-default | |
573 :type 'integer) | |
574 | |
575 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number) | |
576 "*List of functions used for sorting articles in the summary buffer. | |
577 This variable is only used when not using a threaded display." | |
578 :group 'gnus-summary-sort | |
579 :type '(repeat (choice (function-item gnus-article-sort-by-number) | |
580 (function-item gnus-article-sort-by-author) | |
581 (function-item gnus-article-sort-by-subject) | |
582 (function-item gnus-article-sort-by-date) | |
583 (function-item gnus-article-sort-by-score) | |
584 (function :tag "other")))) | |
585 | |
586 (defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number) | |
587 "*List of functions used for sorting threads in the summary buffer. | |
588 By default, threads are sorted by article number. | |
589 | |
590 Each function takes two threads and return non-nil if the first thread | |
591 should be sorted before the other. If you use more than one function, | |
592 the primary sort function should be the last. You should probably | |
593 always include `gnus-thread-sort-by-number' in the list of sorting | |
594 functions -- preferably first. | |
595 | |
596 Ready-made functions include `gnus-thread-sort-by-number', | |
597 `gnus-thread-sort-by-author', `gnus-thread-sort-by-subject', | |
598 `gnus-thread-sort-by-date', `gnus-thread-sort-by-score' and | |
599 `gnus-thread-sort-by-total-score' (see `gnus-thread-score-function')." | |
600 :group 'gnus-summary-sort | |
601 :type '(repeat (choice (function-item gnus-thread-sort-by-number) | |
602 (function-item gnus-thread-sort-by-author) | |
603 (function-item gnus-thread-sort-by-subject) | |
604 (function-item gnus-thread-sort-by-date) | |
605 (function-item gnus-thread-sort-by-score) | |
606 (function-item gnus-thread-sort-by-total-score) | |
607 (function :tag "other")))) | |
608 | |
609 (defcustom gnus-thread-score-function '+ | |
610 "*Function used for calculating the total score of a thread. | |
611 | |
612 The function is called with the scores of the article and each | |
613 subthread and should then return the score of the thread. | |
614 | |
615 Some functions you can use are `+', `max', or `min'." | |
616 :group 'gnus-summary-sort | |
617 :type 'function) | |
618 | |
619 (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
|
620 "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
|
621 This variable is local to the summary buffers." |
17493 | 622 :group 'gnus-score-default |
623 :type '(choice (const :tag "off" nil) | |
624 integer)) | |
625 | |
626 (defcustom gnus-thread-expunge-below nil | |
627 "All threads that have a total score less than this variable will be expunged. | |
628 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
|
629 \"thread score\" is. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
630 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
631 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
|
632 :group 'gnus-threading |
17493 | 633 :group 'gnus-score-default |
634 :type '(choice (const :tag "off" nil) | |
635 integer)) | |
636 | |
637 (defcustom gnus-summary-mode-hook nil | |
638 "*A hook for Gnus summary mode. | |
639 This hook is run before any variables are set in the summary buffer." | |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
640 :options '(turn-on-gnus-mailing-list-mode) |
17493 | 641 :group 'gnus-summary-various |
642 :type 'hook) | |
643 | |
644 (defcustom gnus-summary-menu-hook nil | |
645 "*Hook run after the creation of the summary mode menu." | |
646 :group 'gnus-summary-visual | |
647 :type 'hook) | |
648 | |
649 (defcustom gnus-summary-exit-hook nil | |
650 "*A hook called on exit from the summary buffer. | |
651 It will be called with point in the group buffer." | |
652 :group 'gnus-summary-exit | |
653 :type 'hook) | |
654 | |
655 (defcustom gnus-summary-prepare-hook nil | |
656 "*A hook called after the summary buffer has been generated. | |
657 If you want to modify the summary buffer, you can use this hook." | |
658 :group 'gnus-summary-various | |
659 :type 'hook) | |
660 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
661 (defcustom gnus-summary-prepared-hook nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
662 "*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
|
663 :group 'gnus-summary-various |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
664 :type 'hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
665 |
17493 | 666 (defcustom gnus-summary-generate-hook nil |
667 "*A hook run just before generating the summary buffer. | |
668 This hook is commonly used to customize threading variables and the | |
669 like." | |
670 :group 'gnus-summary-various | |
671 :type 'hook) | |
672 | |
673 (defcustom gnus-select-group-hook nil | |
674 "*A hook called when a newsgroup is selected. | |
675 | |
676 If you'd like to simplify subjects like the | |
677 `gnus-summary-next-same-subject' command does, you can use the | |
678 following hook: | |
679 | |
680 (setq gnus-select-group-hook | |
681 (list | |
682 (lambda () | |
683 (mapcar (lambda (header) | |
684 (mail-header-set-subject | |
685 header | |
686 (gnus-simplify-subject | |
687 (mail-header-subject header) 're-only))) | |
688 gnus-newsgroup-headers))))" | |
689 :group 'gnus-group-select | |
690 :type 'hook) | |
691 | |
692 (defcustom gnus-select-article-hook nil | |
693 "*A hook called when an article is selected." | |
694 :group 'gnus-summary-choose | |
695 :type 'hook) | |
696 | |
697 (defcustom gnus-visual-mark-article-hook | |
698 (list 'gnus-highlight-selected-summary) | |
699 "*Hook run after selecting an article in the summary buffer. | |
700 It is meant to be used for highlighting the article in some way. It | |
701 is not run if `gnus-visual' is nil." | |
702 :group 'gnus-summary-visual | |
703 :type 'hook) | |
704 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
705 (defcustom gnus-parse-headers-hook nil |
17493 | 706 "*A hook called before parsing the headers." |
707 :group 'gnus-various | |
708 :type 'hook) | |
709 | |
710 (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
|
711 "*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
|
712 This hook is not called from the non-updating exit commands like `Q'." |
17493 | 713 :group 'gnus-various |
714 :type 'hook) | |
715 | |
716 (defcustom gnus-summary-update-hook | |
717 (list 'gnus-summary-highlight-line) | |
718 "*A hook called when a summary line is changed. | |
719 The hook will not be called if `gnus-visual' is nil. | |
720 | |
721 The default function `gnus-summary-highlight-line' will | |
722 highlight the line according to the `gnus-summary-highlight' | |
723 variable." | |
724 :group 'gnus-summary-visual | |
725 :type 'hook) | |
726 | |
727 (defcustom gnus-mark-article-hook '(gnus-summary-mark-read-and-unread-as-read) | |
728 "*A hook called when an article is selected for the first time. | |
729 The hook is intended to mark an article as read (or unread) | |
730 automatically when it is selected." | |
731 :group 'gnus-summary-choose | |
732 :type 'hook) | |
733 | |
734 (defcustom gnus-group-no-more-groups-hook nil | |
735 "*A hook run when returning to group mode having no more (unread) groups." | |
736 :group 'gnus-group-select | |
737 :type 'hook) | |
738 | |
739 (defcustom gnus-ps-print-hook nil | |
740 "*A hook run before ps-printing something from Gnus." | |
741 :group 'gnus-summary | |
742 :type 'hook) | |
743 | |
744 (defcustom gnus-summary-selected-face 'gnus-summary-selected-face | |
745 "Face used for highlighting the current article in the summary buffer." | |
746 :group 'gnus-summary-visual | |
747 :type 'face) | |
748 | |
749 (defcustom gnus-summary-highlight | |
750 '(((= mark gnus-canceled-mark) | |
751 . gnus-summary-cancelled-face) | |
752 ((and (> score default) | |
753 (or (= mark gnus-dormant-mark) | |
754 (= mark gnus-ticked-mark))) | |
755 . gnus-summary-high-ticked-face) | |
756 ((and (< score default) | |
757 (or (= mark gnus-dormant-mark) | |
758 (= mark gnus-ticked-mark))) | |
759 . gnus-summary-low-ticked-face) | |
760 ((or (= mark gnus-dormant-mark) | |
761 (= mark gnus-ticked-mark)) | |
762 . gnus-summary-normal-ticked-face) | |
763 ((and (> score default) (= mark gnus-ancient-mark)) | |
764 . gnus-summary-high-ancient-face) | |
765 ((and (< score default) (= mark gnus-ancient-mark)) | |
766 . gnus-summary-low-ancient-face) | |
767 ((= mark gnus-ancient-mark) | |
768 . gnus-summary-normal-ancient-face) | |
769 ((and (> score default) (= mark gnus-unread-mark)) | |
770 . gnus-summary-high-unread-face) | |
771 ((and (< score default) (= mark gnus-unread-mark)) | |
772 . gnus-summary-low-unread-face) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
773 ((= mark gnus-unread-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
774 . gnus-summary-normal-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-high-unread-face) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
778 ((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
|
779 gnus-undownloaded-mark))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
780 . gnus-summary-low-unread-face) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
781 ((memq mark (list gnus-downloadable-mark gnus-undownloaded-mark)) |
17493 | 782 . gnus-summary-normal-unread-face) |
783 ((> score default) | |
784 . gnus-summary-high-read-face) | |
785 ((< score default) | |
786 . gnus-summary-low-read-face) | |
787 (t | |
788 . gnus-summary-normal-read-face)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
789 "*Controls the highlighting of summary buffer lines. |
17493 | 790 |
791 A list of (FORM . FACE) pairs. When deciding how a a particular | |
792 summary line should be displayed, each form is evaluated. The content | |
793 of the face field after the first true form is used. You can change | |
794 how those summary lines are displayed, by editing the face field. | |
795 | |
796 You can use the following variables in the FORM field. | |
797 | |
798 score: The articles score | |
799 default: The default article score. | |
800 below: The score below which articles are automatically marked as read. | |
801 mark: The articles mark." | |
802 :group 'gnus-summary-visual | |
803 :type '(repeat (cons (sexp :tag "Form" nil) | |
804 face))) | |
805 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
806 (defcustom gnus-alter-header-function nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
807 "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
|
808 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
|
809 which it may alter in any way.") |
17493 | 810 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
811 (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
|
812 "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
|
813 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
814 (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
|
815 "*Extra headers to parse." |
33399 | 816 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
817 :group 'gnus-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
818 :type '(repeat symbol)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
819 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
820 (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
|
821 (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
|
822 "*Regexp of From headers that may be suppressed in favor of To headers." |
33399 | 823 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
824 :group 'gnus-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
825 :type 'regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
826 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
827 (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
|
828 '(("^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
|
829 ("^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
|
830 ("^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
|
831 ("^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
|
832 ("^relcom\\>" koi8-r) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
833 ("^fido7\\>" koi8-r) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
834 ("^\\(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
|
835 ("^israel\\>" iso-8859-1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
836 ("^han\\>" euc-kr) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
837 ("^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
|
838 ("^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
|
839 ("^\\(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
|
840 (".*" iso-8859-1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
841 "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
|
842 :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
|
843 (symbol :tag "Charset"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
844 :group 'gnus-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
845 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
846 (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
|
847 "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
|
848 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
|
849 default charset will be used instead." |
33399 | 850 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
851 :type '(repeat symbol) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
852 :group 'gnus-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
853 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
854 (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
|
855 '(("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
|
856 "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
|
857 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
|
858 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
|
859 :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
|
860 (repeat symbol))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
861 :group 'gnus-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
862 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
863 (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
|
864 "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
|
865 This variable uses the same syntax as `gnus-emphasis-alist'." |
33399 | 866 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
867 :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
|
868 (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
|
869 (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
|
870 (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
|
871 (symbol :tag "Face" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
872 gnus-emphasis-highlight-words))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
873 :group 'gnus-summary-visual) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
874 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
875 (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
|
876 nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
877 "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
|
878 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
|
879 numbered argument. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
880 For example: ((1 . cn-gb-2312) (2 . big5))." |
33399 | 881 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
882 :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
|
883 (symbol :tag "Charset"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
884 :group 'gnus-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
885 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
886 (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
|
887 "Whether marks are preserved when moving, copying and respooling messages." |
33399 | 888 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
889 :type 'boolean |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
890 :group 'gnus-summary-marks) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
891 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
892 (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
|
893 "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
|
894 :type 'function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
895 :group 'gnus-summary) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
896 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
897 (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
|
898 "*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
|
899 :group 'gnus-score-default |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
900 :type '(choice (const nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
901 integer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
902 |
31785 | 903 (defcustom gnus-summary-save-parts-default-mime "image/.*" |
904 "*A regexp to match MIME parts when saving multiple parts of a message | |
905 with gnus-summary-save-parts (X m). This regexp will be used by default | |
906 when prompting the user for which type of files to save." | |
907 :group 'gnus-summary | |
908 :type 'regexp) | |
909 | |
910 | |
17493 | 911 ;;; Internal variables |
912 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
913 (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
|
914 (defvar gnus-article-decoded-p nil) |
17493 | 915 (defvar gnus-scores-exclude-files nil) |
916 (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
|
917 (defvar gnus-inhibit-mime-unbuttonizing nil) |
17493 | 918 |
919 (defvar gnus-original-article nil) | |
920 (defvar gnus-article-internal-prepare-hook nil) | |
921 (defvar gnus-newsgroup-process-stack nil) | |
922 | |
923 (defvar gnus-thread-indent-array nil) | |
924 (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
|
925 (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
|
926 "Function called to sort the articles within a thread after it has been gathered together.") |
17493 | 927 |
31785 | 928 (defvar gnus-summary-save-parts-type-history nil) |
929 (defvar gnus-summary-save-parts-last-directory nil) | |
930 | |
17493 | 931 ;; Avoid highlighting in kill files. |
932 (defvar gnus-summary-inhibit-highlight nil) | |
933 (defvar gnus-newsgroup-selected-overlay nil) | |
934 (defvar gnus-inhibit-limiting nil) | |
935 (defvar gnus-newsgroup-adaptive-score-file nil) | |
936 (defvar gnus-current-score-file nil) | |
937 (defvar gnus-current-move-group nil) | |
938 (defvar gnus-current-copy-group nil) | |
939 (defvar gnus-current-crosspost-group nil) | |
940 | |
941 (defvar gnus-newsgroup-dependencies nil) | |
942 (defvar gnus-newsgroup-adaptive nil) | |
943 (defvar gnus-summary-display-article-function nil) | |
944 (defvar gnus-summary-highlight-line-function nil | |
945 "Function called after highlighting a summary line.") | |
946 | |
947 (defvar gnus-summary-line-format-alist | |
948 `((?N ,(macroexpand '(mail-header-number gnus-tmp-header)) ?d) | |
949 (?S ,(macroexpand '(mail-header-subject gnus-tmp-header)) ?s) | |
950 (?s gnus-tmp-subject-or-nil ?s) | |
951 (?n gnus-tmp-name ?s) | |
952 (?A (car (cdr (funcall gnus-extract-address-components gnus-tmp-from))) | |
953 ?s) | |
954 (?a (or (car (funcall gnus-extract-address-components gnus-tmp-from)) | |
955 gnus-tmp-from) ?s) | |
956 (?F gnus-tmp-from ?s) | |
957 (?x ,(macroexpand '(mail-header-xref gnus-tmp-header)) ?s) | |
958 (?D ,(macroexpand '(mail-header-date gnus-tmp-header)) ?s) | |
959 (?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
|
960 (?o (gnus-date-iso8601 (mail-header-date gnus-tmp-header)) ?s) |
17493 | 961 (?M ,(macroexpand '(mail-header-id gnus-tmp-header)) ?s) |
962 (?r ,(macroexpand '(mail-header-references gnus-tmp-header)) ?s) | |
963 (?c (or (mail-header-chars gnus-tmp-header) 0) ?d) | |
964 (?L gnus-tmp-lines ?d) | |
965 (?I gnus-tmp-indentation ?s) | |
966 (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s) | |
967 (?R gnus-tmp-replied ?c) | |
968 (?\[ gnus-tmp-opening-bracket ?c) | |
969 (?\] gnus-tmp-closing-bracket ?c) | |
970 (?\> (make-string gnus-tmp-level ? ) ?s) | |
971 (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s) | |
972 (?i gnus-tmp-score ?d) | |
973 (?z gnus-tmp-score-char ?c) | |
974 (?l (bbb-grouplens-score gnus-tmp-header) ?s) | |
975 (?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d) | |
976 (?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
|
977 (?f (gnus-summary-from-or-to-or-newsgroups gnus-tmp-header) ?s) |
17493 | 978 (?t (gnus-summary-number-of-articles-in-thread |
979 (and (boundp 'thread) (car thread)) gnus-tmp-level) | |
980 ?d) | |
981 (?e (gnus-summary-number-of-articles-in-thread | |
982 (and (boundp 'thread) (car thread)) gnus-tmp-level t) | |
983 ?c) | |
984 (?u gnus-tmp-user-defined ?s) | |
985 (?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
|
986 "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
|
987 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
|
988 the type of the variable (string, integer, character, etc).") |
17493 | 989 |
990 (defvar gnus-summary-dummy-line-format-alist | |
991 `((?S gnus-tmp-subject ?s) | |
992 (?N gnus-tmp-number ?d) | |
993 (?u gnus-tmp-user-defined ?s))) | |
994 | |
995 (defvar gnus-summary-mode-line-format-alist | |
996 `((?G gnus-tmp-group-name ?s) | |
997 (?g (gnus-short-group-name gnus-tmp-group-name) ?s) | |
998 (?p (gnus-group-real-name gnus-tmp-group-name) ?s) | |
999 (?A gnus-tmp-article-number ?d) | |
1000 (?Z gnus-tmp-unread-and-unselected ?s) | |
1001 (?V gnus-version ?s) | |
1002 (?U gnus-tmp-unread-and-unticked ?d) | |
1003 (?S gnus-tmp-subject ?s) | |
1004 (?e gnus-tmp-unselected ?d) | |
1005 (?u gnus-tmp-user-defined ?s) | |
1006 (?d (length gnus-newsgroup-dormant) ?d) | |
1007 (?t (length gnus-newsgroup-marked) ?d) | |
1008 (?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
|
1009 (?z (gnus-summary-article-score gnus-tmp-article-number) ?d) |
17493 | 1010 (?E gnus-newsgroup-expunged-tally ?d) |
1011 (?s (gnus-current-score-file-nondirectory) ?s))) | |
1012 | |
1013 (defvar gnus-last-search-regexp nil | |
1014 "Default regexp for article search command.") | |
1015 | |
1016 (defvar gnus-last-shell-command nil | |
1017 "Default shell command on article.") | |
1018 | |
1019 (defvar gnus-newsgroup-begin nil) | |
1020 (defvar gnus-newsgroup-end nil) | |
1021 (defvar gnus-newsgroup-last-rmail nil) | |
1022 (defvar gnus-newsgroup-last-mail nil) | |
1023 (defvar gnus-newsgroup-last-folder nil) | |
1024 (defvar gnus-newsgroup-last-file nil) | |
1025 (defvar gnus-newsgroup-auto-expire nil) | |
1026 (defvar gnus-newsgroup-active nil) | |
1027 | |
1028 (defvar gnus-newsgroup-data nil) | |
1029 (defvar gnus-newsgroup-data-reverse nil) | |
1030 (defvar gnus-newsgroup-limit nil) | |
1031 (defvar gnus-newsgroup-limits nil) | |
1032 | |
1033 (defvar gnus-newsgroup-unreads nil | |
1034 "List of unread articles in the current newsgroup.") | |
1035 | |
1036 (defvar gnus-newsgroup-unselected nil | |
1037 "List of unselected unread articles in the current newsgroup.") | |
1038 | |
1039 (defvar gnus-newsgroup-reads nil | |
1040 "Alist of read articles and article marks in the current newsgroup.") | |
1041 | |
1042 (defvar gnus-newsgroup-expunged-tally nil) | |
1043 | |
1044 (defvar gnus-newsgroup-marked nil | |
1045 "List of ticked articles in the current newsgroup (a subset of unread art).") | |
1046 | |
1047 (defvar gnus-newsgroup-killed nil | |
1048 "List of ranges of articles that have been through the scoring process.") | |
1049 | |
1050 (defvar gnus-newsgroup-cached nil | |
1051 "List of articles that come from the article cache.") | |
1052 | |
1053 (defvar gnus-newsgroup-saved nil | |
1054 "List of articles that have been saved.") | |
1055 | |
1056 (defvar gnus-newsgroup-kill-headers nil) | |
1057 | |
1058 (defvar gnus-newsgroup-replied nil | |
1059 "List of articles that have been replied to in the current newsgroup.") | |
1060 | |
1061 (defvar gnus-newsgroup-expirable nil | |
1062 "List of articles in the current newsgroup that can be expired.") | |
1063 | |
1064 (defvar gnus-newsgroup-processable nil | |
1065 "List of articles in the current newsgroup that can be processed.") | |
1066 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1067 (defvar gnus-newsgroup-downloadable nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1068 "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
|
1069 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1070 (defvar gnus-newsgroup-undownloaded nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1071 "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
|
1072 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1073 (defvar gnus-newsgroup-unsendable nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1074 "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
|
1075 |
17493 | 1076 (defvar gnus-newsgroup-bookmarks nil |
1077 "List of articles in the current newsgroup that have bookmarks.") | |
1078 | |
1079 (defvar gnus-newsgroup-dormant nil | |
1080 "List of dormant articles in the current newsgroup.") | |
1081 | |
1082 (defvar gnus-newsgroup-scored nil | |
1083 "List of scored articles in the current newsgroup.") | |
1084 | |
1085 (defvar gnus-newsgroup-headers nil | |
1086 "List of article headers in the current newsgroup.") | |
1087 | |
1088 (defvar gnus-newsgroup-threads nil) | |
1089 | |
1090 (defvar gnus-newsgroup-prepared nil | |
1091 "Whether the current group has been prepared properly.") | |
1092 | |
1093 (defvar gnus-newsgroup-ancient nil | |
1094 "List of `gnus-fetch-old-headers' articles in the current newsgroup.") | |
1095 | |
1096 (defvar gnus-newsgroup-sparse nil) | |
1097 | |
1098 (defvar gnus-current-article nil) | |
1099 (defvar gnus-article-current nil) | |
1100 (defvar gnus-current-headers nil) | |
1101 (defvar gnus-have-all-headers nil) | |
1102 (defvar gnus-last-article nil) | |
1103 (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
|
1104 (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
|
1105 (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
|
1106 (defvar gnus-newsgroup-ephemeral-ignored-charsets nil) |
17493 | 1107 |
1108 (defconst gnus-summary-local-variables | |
1109 '(gnus-newsgroup-name | |
1110 gnus-newsgroup-begin gnus-newsgroup-end | |
1111 gnus-newsgroup-last-rmail gnus-newsgroup-last-mail | |
1112 gnus-newsgroup-last-folder gnus-newsgroup-last-file | |
1113 gnus-newsgroup-auto-expire gnus-newsgroup-unreads | |
1114 gnus-newsgroup-unselected gnus-newsgroup-marked | |
1115 gnus-newsgroup-reads gnus-newsgroup-saved | |
1116 gnus-newsgroup-replied gnus-newsgroup-expirable | |
1117 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
|
1118 gnus-newsgroup-downloadable gnus-newsgroup-undownloaded |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1119 gnus-newsgroup-unsendable |
17493 | 1120 gnus-newsgroup-bookmarks gnus-newsgroup-dormant |
1121 gnus-newsgroup-headers gnus-newsgroup-threads | |
1122 gnus-newsgroup-prepared gnus-summary-highlight-line-function | |
1123 gnus-current-article gnus-current-headers gnus-have-all-headers | |
1124 gnus-last-article gnus-article-internal-prepare-hook | |
1125 gnus-newsgroup-dependencies gnus-newsgroup-selected-overlay | |
1126 gnus-newsgroup-scored gnus-newsgroup-kill-headers | |
1127 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
|
1128 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
|
1129 (gnus-summary-expunge-below . global) |
17493 | 1130 (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
|
1131 (gnus-orphan-score . global) |
17493 | 1132 gnus-newsgroup-active gnus-scores-exclude-files |
1133 gnus-newsgroup-history gnus-newsgroup-ancient | |
1134 gnus-newsgroup-sparse gnus-newsgroup-process-stack | |
1135 (gnus-newsgroup-adaptive . gnus-use-adaptive-scoring) | |
1136 gnus-newsgroup-adaptive-score-file (gnus-reffed-article-number . -1) | |
1137 (gnus-newsgroup-expunged-tally . 0) | |
1138 gnus-cache-removable-articles gnus-newsgroup-cached | |
1139 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
|
1140 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
|
1141 gnus-newsgroup-charset) |
17493 | 1142 "Variables that are buffer-local to the summary buffers.") |
1143 | |
1144 ;; Byte-compiler warning. | |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1145 (eval-when-compile (defvar gnus-article-mode-map)) |
17493 | 1146 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1147 ;; MIME stuff. |
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 (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
|
1150 '(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
|
1151 "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
|
1152 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1153 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
|
1154 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
|
1155 (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
|
1156 whose names match REGEXP. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1157 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1158 For example: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1159 ((\"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
|
1160 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
|
1161 (\"chinese\" . rfc1843-decode-string))") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1162 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1163 (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
|
1164 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1165 (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
|
1166 "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
|
1167 (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
|
1168 (eq gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1169 (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
|
1170 (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
|
1171 (mapcar (lambda (x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1172 (if (symbolp x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1173 (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
|
1174 (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
|
1175 (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
|
1176 (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
|
1177 (list (cdr x)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1178 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
|
1179 (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
|
1180 (pop xlist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1181 (while xlist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1182 (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
|
1183 string) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1184 |
17493 | 1185 ;; Subject simplification. |
1186 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1187 (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
|
1188 "Remove excessive whitespace from STR." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1189 (let ((mystr str)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1190 ;; Multiple spaces. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1191 (while (string-match "[ \t][ \t]+" mystr) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1192 (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
|
1193 " " |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1194 (substring mystr (match-end 0))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1195 ;; Leading spaces. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1196 (when (string-match "^[ \t]+" mystr) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1197 (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
|
1198 ;; Trailing spaces. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1199 (when (string-match "[ \t]+$" mystr) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1200 (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
|
1201 mystr)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1202 |
17493 | 1203 (defsubst gnus-simplify-subject-re (subject) |
1204 "Remove \"Re:\" from subject lines." | |
1205 (if (string-match "^[Rr][Ee]: *" subject) | |
1206 (substring subject (match-end 0)) | |
1207 subject)) | |
1208 | |
1209 (defun gnus-simplify-subject (subject &optional re-only) | |
1210 "Remove `Re:' and words in parentheses. | |
1211 If RE-ONLY is non-nil, strip leading `Re:'s only." | |
1212 (let ((case-fold-search t)) ;Ignore case. | |
1213 ;; Remove `Re:', `Re^N:', `Re(n)', and `Re[n]:'. | |
1214 (when (string-match "\\`\\(re\\([[(^][0-9]+[])]?\\)?:[ \t]*\\)+" subject) | |
1215 (setq subject (substring subject (match-end 0)))) | |
1216 ;; Remove uninteresting prefixes. | |
1217 (when (and (not re-only) | |
1218 gnus-simplify-ignored-prefixes | |
1219 (string-match gnus-simplify-ignored-prefixes subject)) | |
1220 (setq subject (substring subject (match-end 0)))) | |
1221 ;; Remove words in parentheses from end. | |
1222 (unless re-only | |
1223 (while (string-match "[ \t\n]*([^()]*)[ \t\n]*\\'" subject) | |
1224 (setq subject (substring subject 0 (match-beginning 0))))) | |
1225 ;; Return subject string. | |
1226 subject)) | |
1227 | |
1228 ;; Remove any leading "re:"s, any trailing paren phrases, and simplify | |
1229 ;; all whitespace. | |
1230 (defsubst gnus-simplify-buffer-fuzzy-step (regexp &optional newtext) | |
1231 (goto-char (point-min)) | |
1232 (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
|
1233 (replace-match (or newtext "")))) |
17493 | 1234 |
1235 (defun gnus-simplify-buffer-fuzzy () | |
1236 "Simplify string in the buffer fuzzily. | |
1237 The string in the accessible portion of the current buffer is simplified. | |
1238 It is assumed to be a single-line subject. | |
1239 Whitespace is generally cleaned up, and miscellaneous leading/trailing | |
1240 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
|
1241 `gnus-simplify-subject-fuzzy-regexp'." |
17493 | 1242 (let ((case-fold-search t) |
1243 (modified-tick)) | |
1244 (gnus-simplify-buffer-fuzzy-step "\t" " ") | |
1245 | |
1246 (while (not (eq modified-tick (buffer-modified-tick))) | |
1247 (setq modified-tick (buffer-modified-tick)) | |
1248 (cond | |
1249 ((listp gnus-simplify-subject-fuzzy-regexp) | |
1250 (mapcar 'gnus-simplify-buffer-fuzzy-step | |
1251 gnus-simplify-subject-fuzzy-regexp)) | |
1252 (gnus-simplify-subject-fuzzy-regexp | |
1253 (gnus-simplify-buffer-fuzzy-step gnus-simplify-subject-fuzzy-regexp))) | |
1254 (gnus-simplify-buffer-fuzzy-step "^ *\\[[-+?*!][-+?*!]\\] *") | |
1255 (gnus-simplify-buffer-fuzzy-step | |
1256 "^ *\\(re\\|fw\\|fwd\\)[[{(^0-9]*[])}]?[:;] *") | |
1257 (gnus-simplify-buffer-fuzzy-step "^[[].*:\\( .*\\)[]]$" "\\1")) | |
1258 | |
1259 (gnus-simplify-buffer-fuzzy-step " *[[{(][^()\n]*[]})] *$") | |
1260 (gnus-simplify-buffer-fuzzy-step " +" " ") | |
1261 (gnus-simplify-buffer-fuzzy-step " $") | |
1262 (gnus-simplify-buffer-fuzzy-step "^ +"))) | |
1263 | |
1264 (defun gnus-simplify-subject-fuzzy (subject) | |
1265 "Simplify a subject string fuzzily. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1266 See `gnus-simplify-buffer-fuzzy' for details." |
17493 | 1267 (save-excursion |
1268 (gnus-set-work-buffer) | |
1269 (let ((case-fold-search t)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1270 ;; Remove uninteresting prefixes. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1271 (when (and gnus-simplify-ignored-prefixes |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1272 (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
|
1273 (setq subject (substring subject (match-end 0)))) |
17493 | 1274 (insert subject) |
1275 (inline (gnus-simplify-buffer-fuzzy)) | |
1276 (buffer-string)))) | |
1277 | |
1278 (defsubst gnus-simplify-subject-fully (subject) | |
1279 "Simplify a subject string according to gnus-summary-gather-subject-limit." | |
1280 (cond | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1281 (gnus-simplify-subject-functions |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1282 (gnus-map-function gnus-simplify-subject-functions subject)) |
17493 | 1283 ((null gnus-summary-gather-subject-limit) |
1284 (gnus-simplify-subject-re subject)) | |
1285 ((eq gnus-summary-gather-subject-limit 'fuzzy) | |
1286 (gnus-simplify-subject-fuzzy subject)) | |
1287 ((numberp gnus-summary-gather-subject-limit) | |
1288 (gnus-limit-string (gnus-simplify-subject-re subject) | |
1289 gnus-summary-gather-subject-limit)) | |
1290 (t | |
1291 subject))) | |
1292 | |
1293 (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
|
1294 "Check whether two subjects are equal. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1295 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
|
1296 simplified." |
17493 | 1297 (cond |
1298 ((null simple-first) | |
1299 (equal (gnus-simplify-subject-fully s1) | |
1300 (gnus-simplify-subject-fully s2))) | |
1301 (t | |
1302 (equal s1 | |
1303 (gnus-simplify-subject-fully s2))))) | |
1304 | |
1305 (defun gnus-summary-bubble-group () | |
1306 "Increase the score of the current group. | |
1307 This is a handy function to add to `gnus-summary-exit-hook' to | |
1308 increase the score of each group you read." | |
1309 (gnus-group-add-score gnus-newsgroup-name)) | |
1310 | |
1311 | |
1312 ;;; | |
1313 ;;; Gnus summary mode | |
1314 ;;; | |
1315 | |
1316 (put 'gnus-summary-mode 'mode-class 'special) | |
1317 | |
1318 (when t | |
1319 ;; Non-orthogonal keys | |
1320 | |
1321 (gnus-define-keys gnus-summary-mode-map | |
1322 " " gnus-summary-next-page | |
1323 "\177" gnus-summary-prev-page | |
1324 [delete] gnus-summary-prev-page | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1325 [backspace] gnus-summary-prev-page |
17493 | 1326 "\r" gnus-summary-scroll-up |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1327 "\M-\r" gnus-summary-scroll-down |
17493 | 1328 "n" gnus-summary-next-unread-article |
1329 "p" gnus-summary-prev-unread-article | |
1330 "N" gnus-summary-next-article | |
1331 "P" gnus-summary-prev-article | |
1332 "\M-\C-n" gnus-summary-next-same-subject | |
1333 "\M-\C-p" gnus-summary-prev-same-subject | |
1334 "\M-n" gnus-summary-next-unread-subject | |
1335 "\M-p" gnus-summary-prev-unread-subject | |
1336 "." gnus-summary-first-unread-article | |
1337 "," gnus-summary-best-unread-article | |
1338 "\M-s" gnus-summary-search-article-forward | |
1339 "\M-r" gnus-summary-search-article-backward | |
1340 "<" gnus-summary-beginning-of-article | |
1341 ">" gnus-summary-end-of-article | |
1342 "j" gnus-summary-goto-article | |
1343 "^" gnus-summary-refer-parent-article | |
1344 "\M-^" gnus-summary-refer-article | |
1345 "u" gnus-summary-tick-article-forward | |
1346 "!" gnus-summary-tick-article-forward | |
1347 "U" gnus-summary-tick-article-backward | |
1348 "d" gnus-summary-mark-as-read-forward | |
1349 "D" gnus-summary-mark-as-read-backward | |
1350 "E" gnus-summary-mark-as-expirable | |
1351 "\M-u" gnus-summary-clear-mark-forward | |
1352 "\M-U" gnus-summary-clear-mark-backward | |
1353 "k" gnus-summary-kill-same-subject-and-select | |
1354 "\C-k" gnus-summary-kill-same-subject | |
1355 "\M-\C-k" gnus-summary-kill-thread | |
1356 "\M-\C-l" gnus-summary-lower-thread | |
1357 "e" gnus-summary-edit-article | |
1358 "#" gnus-summary-mark-as-processable | |
1359 "\M-#" gnus-summary-unmark-as-processable | |
1360 "\M-\C-t" gnus-summary-toggle-threads | |
1361 "\M-\C-s" gnus-summary-show-thread | |
1362 "\M-\C-h" gnus-summary-hide-thread | |
1363 "\M-\C-f" gnus-summary-next-thread | |
1364 "\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
|
1365 [(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
|
1366 [(meta up)] gnus-summary-prev-thread |
17493 | 1367 "\M-\C-u" gnus-summary-up-thread |
1368 "\M-\C-d" gnus-summary-down-thread | |
1369 "&" gnus-summary-execute-command | |
1370 "c" gnus-summary-catchup-and-exit | |
1371 "\C-w" gnus-summary-mark-region-as-read | |
1372 "\C-t" gnus-summary-toggle-truncation | |
1373 "?" gnus-summary-mark-as-dormant | |
1374 "\C-c\M-\C-s" gnus-summary-limit-include-expunged | |
1375 "\C-c\C-s\C-n" gnus-summary-sort-by-number | |
1376 "\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
|
1377 "\C-c\C-s\C-c" gnus-summary-sort-by-chars |
17493 | 1378 "\C-c\C-s\C-a" gnus-summary-sort-by-author |
1379 "\C-c\C-s\C-s" gnus-summary-sort-by-subject | |
1380 "\C-c\C-s\C-d" gnus-summary-sort-by-date | |
1381 "\C-c\C-s\C-i" gnus-summary-sort-by-score | |
1382 "=" gnus-summary-expand-window | |
1383 "\C-x\C-s" gnus-summary-reselect-current-group | |
1384 "\M-g" gnus-summary-rescan-group | |
1385 "w" gnus-summary-stop-page-breaking | |
1386 "\C-c\C-r" gnus-summary-caesar-message | |
1387 "f" gnus-summary-followup | |
1388 "F" gnus-summary-followup-with-original | |
1389 "C" gnus-summary-cancel-article | |
1390 "r" gnus-summary-reply | |
1391 "R" gnus-summary-reply-with-original | |
1392 "\C-c\C-f" gnus-summary-mail-forward | |
1393 "o" gnus-summary-save-article | |
1394 "\C-o" gnus-summary-save-article-mail | |
1395 "|" gnus-summary-pipe-output | |
1396 "\M-k" gnus-summary-edit-local-kill | |
1397 "\M-K" gnus-summary-edit-global-kill | |
1398 ;; "V" gnus-version | |
1399 "\C-c\C-d" gnus-summary-describe-group | |
1400 "q" gnus-summary-exit | |
1401 "Q" gnus-summary-exit-no-update | |
1402 "\C-c\C-i" gnus-info-find-node | |
1403 gnus-mouse-2 gnus-mouse-pick-article | |
1404 "m" gnus-summary-mail-other-window | |
1405 "a" gnus-summary-post-news | |
1406 "x" gnus-summary-limit-to-unread | |
1407 "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
|
1408 "t" gnus-summary-toggle-header |
17493 | 1409 "g" gnus-summary-show-article |
1410 "l" gnus-summary-goto-last-article | |
1411 "\C-c\C-v\C-v" gnus-uu-decode-uu-view | |
1412 "\C-d" gnus-summary-enter-digest-group | |
1413 "\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
|
1414 "\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
|
1415 "\M-\C-a" gnus-summary-customize-parameters |
17493 | 1416 "\C-c\C-b" gnus-bug |
1417 "*" gnus-cache-enter-article | |
1418 "\M-*" gnus-cache-remove-article | |
1419 "\M-&" gnus-summary-universal-argument | |
1420 "\C-l" gnus-recenter | |
1421 "I" gnus-summary-increase-score | |
1422 "L" gnus-summary-lower-score | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1423 "\M-i" gnus-symbolic-argument |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1424 "h" gnus-summary-select-article-buffer |
17493 | 1425 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1426 "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
|
1427 "\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
|
1428 |
17493 | 1429 "V" gnus-summary-score-map |
1430 "X" gnus-uu-extract-map | |
1431 "S" gnus-summary-send-map) | |
1432 | |
1433 ;; Sort of orthogonal keymap | |
1434 (gnus-define-keys (gnus-summary-mark-map "M" gnus-summary-mode-map) | |
1435 "t" gnus-summary-tick-article-forward | |
1436 "!" gnus-summary-tick-article-forward | |
1437 "d" gnus-summary-mark-as-read-forward | |
1438 "r" gnus-summary-mark-as-read-forward | |
1439 "c" gnus-summary-clear-mark-forward | |
1440 " " gnus-summary-clear-mark-forward | |
1441 "e" gnus-summary-mark-as-expirable | |
1442 "x" gnus-summary-mark-as-expirable | |
1443 "?" gnus-summary-mark-as-dormant | |
1444 "b" gnus-summary-set-bookmark | |
1445 "B" gnus-summary-remove-bookmark | |
1446 "#" gnus-summary-mark-as-processable | |
1447 "\M-#" gnus-summary-unmark-as-processable | |
1448 "S" gnus-summary-limit-include-expunged | |
1449 "C" gnus-summary-catchup | |
1450 "H" gnus-summary-catchup-to-here | |
1451 "\C-c" gnus-summary-catchup-all | |
1452 "k" gnus-summary-kill-same-subject-and-select | |
1453 "K" gnus-summary-kill-same-subject | |
1454 "P" gnus-uu-mark-map) | |
1455 | |
1456 (gnus-define-keys (gnus-summary-mscore-map "V" gnus-summary-mark-map) | |
1457 "c" gnus-summary-clear-above | |
1458 "u" gnus-summary-tick-above | |
1459 "m" gnus-summary-mark-above | |
1460 "k" gnus-summary-kill-below) | |
1461 | |
1462 (gnus-define-keys (gnus-summary-limit-map "/" gnus-summary-mode-map) | |
1463 "/" gnus-summary-limit-to-subject | |
1464 "n" gnus-summary-limit-to-articles | |
1465 "w" gnus-summary-pop-limit | |
1466 "s" gnus-summary-limit-to-subject | |
1467 "a" gnus-summary-limit-to-author | |
1468 "u" gnus-summary-limit-to-unread | |
1469 "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
|
1470 "M" gnus-summary-limit-exclude-marks |
17493 | 1471 "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
|
1472 "*" gnus-summary-limit-include-cached |
17493 | 1473 "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
|
1474 "T" gnus-summary-limit-include-thread |
17493 | 1475 "d" gnus-summary-limit-exclude-dormant |
1476 "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
|
1477 "x" gnus-summary-limit-to-extra |
17493 | 1478 "E" gnus-summary-limit-include-expunged |
1479 "c" gnus-summary-limit-exclude-childless-dormant | |
1480 "C" gnus-summary-limit-mark-excluded-as-read) | |
1481 | |
1482 (gnus-define-keys (gnus-summary-goto-map "G" gnus-summary-mode-map) | |
1483 "n" gnus-summary-next-unread-article | |
1484 "p" gnus-summary-prev-unread-article | |
1485 "N" gnus-summary-next-article | |
1486 "P" gnus-summary-prev-article | |
1487 "\C-n" gnus-summary-next-same-subject | |
1488 "\C-p" gnus-summary-prev-same-subject | |
1489 "\M-n" gnus-summary-next-unread-subject | |
1490 "\M-p" gnus-summary-prev-unread-subject | |
1491 "f" gnus-summary-first-unread-article | |
1492 "b" gnus-summary-best-unread-article | |
1493 "j" gnus-summary-goto-article | |
1494 "g" gnus-summary-goto-subject | |
1495 "l" gnus-summary-goto-last-article | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
1496 "o" gnus-summary-pop-article) |
17493 | 1497 |
1498 (gnus-define-keys (gnus-summary-thread-map "T" gnus-summary-mode-map) | |
1499 "k" gnus-summary-kill-thread | |
1500 "l" gnus-summary-lower-thread | |
1501 "i" gnus-summary-raise-thread | |
1502 "T" gnus-summary-toggle-threads | |
1503 "t" gnus-summary-rethread-current | |
1504 "^" gnus-summary-reparent-thread | |
1505 "s" gnus-summary-show-thread | |
1506 "S" gnus-summary-show-all-threads | |
1507 "h" gnus-summary-hide-thread | |
1508 "H" gnus-summary-hide-all-threads | |
1509 "n" gnus-summary-next-thread | |
1510 "p" gnus-summary-prev-thread | |
1511 "u" gnus-summary-up-thread | |
1512 "o" gnus-summary-top-thread | |
1513 "d" gnus-summary-down-thread | |
1514 "#" gnus-uu-mark-thread | |
1515 "\M-#" gnus-uu-unmark-thread) | |
1516 | |
1517 (gnus-define-keys (gnus-summary-buffer-map "Y" gnus-summary-mode-map) | |
1518 "g" gnus-summary-prepare | |
1519 "c" gnus-summary-insert-cached-articles) | |
1520 | |
1521 (gnus-define-keys (gnus-summary-exit-map "Z" gnus-summary-mode-map) | |
1522 "c" gnus-summary-catchup-and-exit | |
1523 "C" gnus-summary-catchup-all-and-exit | |
1524 "E" gnus-summary-exit-no-update | |
1525 "Q" gnus-summary-exit | |
1526 "Z" gnus-summary-exit | |
1527 "n" gnus-summary-catchup-and-goto-next-group | |
1528 "R" gnus-summary-reselect-current-group | |
1529 "G" gnus-summary-rescan-group | |
1530 "N" gnus-summary-next-group | |
1531 "s" gnus-summary-save-newsrc | |
1532 "P" gnus-summary-prev-group) | |
1533 | |
1534 (gnus-define-keys (gnus-summary-article-map "A" gnus-summary-mode-map) | |
1535 " " gnus-summary-next-page | |
1536 "n" gnus-summary-next-page | |
1537 "\177" gnus-summary-prev-page | |
1538 [delete] gnus-summary-prev-page | |
1539 "p" gnus-summary-prev-page | |
1540 "\r" gnus-summary-scroll-up | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1541 "\M-\r" gnus-summary-scroll-down |
17493 | 1542 "<" gnus-summary-beginning-of-article |
1543 ">" gnus-summary-end-of-article | |
1544 "b" gnus-summary-beginning-of-article | |
1545 "e" gnus-summary-end-of-article | |
1546 "^" gnus-summary-refer-parent-article | |
1547 "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
|
1548 "D" gnus-summary-enter-digest-group |
17493 | 1549 "R" gnus-summary-refer-references |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1550 "T" gnus-summary-refer-thread |
17493 | 1551 "g" gnus-summary-show-article |
1552 "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
|
1553 "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
|
1554 "t" gnus-article-babel) |
17493 | 1555 |
1556 (gnus-define-keys (gnus-summary-wash-map "W" gnus-summary-mode-map) | |
1557 "b" gnus-article-add-buttons | |
1558 "B" gnus-article-add-buttons-to-head | |
1559 "o" gnus-article-treat-overstrike | |
1560 "e" gnus-article-emphasize | |
1561 "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
|
1562 "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
|
1563 "C" gnus-article-capitalize-sentences |
17493 | 1564 "c" gnus-article-remove-cr |
1565 "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
|
1566 "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
|
1567 "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
|
1568 "h" gnus-article-wash-html |
17493 | 1569 "f" gnus-article-display-x-face |
1570 "l" gnus-summary-stop-page-breaking | |
1571 "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
|
1572 "t" gnus-summary-toggle-header |
17493 | 1573 "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
|
1574 "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
|
1575 "d" gnus-article-treat-dumbquotes) |
17493 | 1576 |
1577 (gnus-define-keys (gnus-summary-wash-hide-map "W" gnus-summary-wash-map) | |
1578 "a" gnus-article-hide | |
1579 "h" gnus-article-hide-headers | |
1580 "b" gnus-article-hide-boring-headers | |
1581 "s" gnus-article-hide-signature | |
1582 "c" gnus-article-hide-citation | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1583 "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
|
1584 "l" gnus-article-hide-list-identifiers |
17493 | 1585 "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
|
1586 "B" gnus-article-strip-banner |
17493 | 1587 "P" gnus-article-hide-pem |
1588 "\C-c" gnus-article-hide-citation-maybe) | |
1589 | |
1590 (gnus-define-keys (gnus-summary-wash-highlight-map "H" gnus-summary-wash-map) | |
1591 "a" gnus-article-highlight | |
1592 "h" gnus-article-highlight-headers | |
1593 "c" gnus-article-highlight-citation | |
1594 "s" gnus-article-highlight-signature) | |
1595 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1596 (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
|
1597 "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
|
1598 "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
|
1599 "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
|
1600 "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
|
1601 |
17493 | 1602 (gnus-define-keys (gnus-summary-wash-time-map "T" gnus-summary-wash-map) |
1603 "z" gnus-article-date-ut | |
1604 "u" gnus-article-date-ut | |
1605 "l" gnus-article-date-local | |
1606 "e" gnus-article-date-lapsed | |
1607 "o" gnus-article-date-original | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1608 "i" gnus-article-date-iso8601 |
17493 | 1609 "s" gnus-article-date-user) |
1610 | |
1611 (gnus-define-keys (gnus-summary-wash-empty-map "E" gnus-summary-wash-map) | |
1612 "t" gnus-article-remove-trailing-blank-lines | |
1613 "l" gnus-article-strip-leading-blank-lines | |
1614 "m" gnus-article-strip-multiple-blank-lines | |
1615 "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
|
1616 "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
|
1617 "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
|
1618 "e" gnus-article-strip-trailing-space) |
17493 | 1619 |
1620 (gnus-define-keys (gnus-summary-help-map "H" gnus-summary-mode-map) | |
1621 "v" gnus-version | |
1622 "f" gnus-summary-fetch-faq | |
1623 "d" gnus-summary-describe-group | |
1624 "h" gnus-summary-describe-briefly | |
1625 "i" gnus-info-find-node) | |
1626 | |
1627 (gnus-define-keys (gnus-summary-backend-map "B" gnus-summary-mode-map) | |
1628 "e" gnus-summary-expire-articles | |
1629 "\M-\C-e" gnus-summary-expire-articles-now | |
1630 "\177" gnus-summary-delete-article | |
1631 [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
|
1632 [backspace] gnus-summary-delete-article |
17493 | 1633 "m" gnus-summary-move-article |
1634 "r" gnus-summary-respool-article | |
1635 "w" gnus-summary-edit-article | |
1636 "c" gnus-summary-copy-article | |
1637 "B" gnus-summary-crosspost-article | |
1638 "q" gnus-summary-respool-query | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1639 "t" gnus-summary-respool-trace |
17493 | 1640 "i" gnus-summary-import-article |
1641 "p" gnus-summary-article-posted-p) | |
1642 | |
1643 (gnus-define-keys (gnus-summary-save-map "O" gnus-summary-mode-map) | |
1644 "o" gnus-summary-save-article | |
1645 "m" gnus-summary-save-article-mail | |
1646 "F" gnus-summary-write-article-file | |
1647 "r" gnus-summary-save-article-rmail | |
1648 "f" gnus-summary-save-article-file | |
1649 "b" gnus-summary-save-article-body-file | |
1650 "h" gnus-summary-save-article-folder | |
1651 "v" gnus-summary-save-article-vm | |
1652 "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
|
1653 "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
|
1654 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1655 (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
|
1656 "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
|
1657 "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
|
1658 "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
|
1659 "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
|
1660 "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
|
1661 "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
|
1662 "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
|
1663 "|" gnus-article-pipe-part)) |
17493 | 1664 |
1665 (defun gnus-summary-make-menu-bar () | |
1666 (gnus-turn-off-edit-menu 'summary) | |
1667 | |
1668 (unless (boundp 'gnus-summary-misc-menu) | |
1669 | |
1670 (easy-menu-define | |
1671 gnus-summary-kill-menu gnus-summary-mode-map "" | |
1672 (cons | |
1673 "Score" | |
1674 (nconc | |
1675 (list | |
1676 ["Enter score..." gnus-summary-score-entry t] | |
1677 ["Customize" gnus-score-customize t]) | |
1678 (gnus-make-score-map 'increase) | |
1679 (gnus-make-score-map 'lower) | |
1680 '(("Mark" | |
1681 ["Kill below" gnus-summary-kill-below t] | |
1682 ["Mark above" gnus-summary-mark-above t] | |
1683 ["Tick above" gnus-summary-tick-above t] | |
1684 ["Clear above" gnus-summary-clear-above t]) | |
1685 ["Current score" gnus-summary-current-score t] | |
1686 ["Set score" gnus-summary-set-score t] | |
1687 ["Switch current score file..." gnus-score-change-score-file t] | |
1688 ["Set mark below..." gnus-score-set-mark-below t] | |
1689 ["Set expunge below..." gnus-score-set-expunge-below t] | |
1690 ["Edit current score file" gnus-score-edit-current-scores t] | |
1691 ["Edit score file" gnus-score-edit-file t] | |
1692 ["Trace score" gnus-score-find-trace t] | |
1693 ["Find words" gnus-score-find-favourite-words t] | |
1694 ["Rescore buffer" gnus-summary-rescore t] | |
1695 ["Increase score..." gnus-summary-increase-score t] | |
1696 ["Lower score..." gnus-summary-lower-score t])))) | |
1697 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1698 ;; 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
|
1699 ;; 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
|
1700 (let ((innards |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1701 '(("Hide" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1702 ["All" gnus-article-hide t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1703 ["Headers" gnus-article-hide-headers t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1704 ["Signature" gnus-article-hide-signature t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1705 ["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
|
1706 ["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
|
1707 ["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
|
1708 ["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
|
1709 ["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
|
1710 ("Highlight" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1711 ["All" gnus-article-highlight t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1712 ["Headers" gnus-article-highlight-headers t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1713 ["Signature" gnus-article-highlight-signature t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1714 ["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
|
1715 ("MIME" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
1716 ["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
|
1717 ["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
|
1718 ["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
|
1719 ["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
|
1720 ["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
|
1721 ("Date" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1722 ["Local" gnus-article-date-local t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1723 ["ISO8601" gnus-article-date-iso8601 t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1724 ["UT" gnus-article-date-ut t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1725 ["Original" gnus-article-date-original t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1726 ["Lapsed" gnus-article-date-lapsed t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1727 ["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
|
1728 ("Washing" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1729 ("Remove Blanks" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1730 ["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
|
1731 ["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
|
1732 ["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
|
1733 ["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
|
1734 ["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
|
1735 ["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
|
1736 ["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
|
1737 ["Overstrike" gnus-article-treat-overstrike t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1738 ["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
|
1739 ["Emphasis" gnus-article-emphasize t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1740 ["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
|
1741 ["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
|
1742 ["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
|
1743 ["CR" gnus-article-remove-cr t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1744 ["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
|
1745 ["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
|
1746 ["Base64" gnus-article-de-base64-unreadable t] |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1747 ["Rot 13" gnus-summary-caesar-message |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1748 :help "\"Caesar rotate\" article by 13"] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1749 ["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
|
1750 ["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
|
1751 ["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
|
1752 ["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
|
1753 ["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
|
1754 ["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
|
1755 ["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
|
1756 ["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
|
1757 ("Output" |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1758 ["Save in default format" gnus-summary-save-article |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1759 :help "Save article using default method"] |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1760 ["Save in file" gnus-summary-save-article-file |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1761 :help "Save article in file"] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1762 ["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
|
1763 ["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
|
1764 ["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
|
1765 ["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
|
1766 ["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
|
1767 ["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
|
1768 ["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
|
1769 ["Print" gnus-summary-print-article t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1770 ("Backend" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1771 ["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
|
1772 ["Move article..." gnus-summary-move-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1773 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1774 'request-move-article gnus-newsgroup-name)] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1775 ["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
|
1776 ["Crosspost article..." gnus-summary-crosspost-article |
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-replace-article gnus-newsgroup-name)] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1779 ["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
|
1780 ["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
|
1781 ["Edit article" gnus-summary-edit-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1782 (not (gnus-group-read-only-p))] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1783 ["Delete article" gnus-summary-delete-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1784 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1785 'request-expire-articles gnus-newsgroup-name)] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1786 ["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
|
1787 ["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
|
1788 ["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
|
1789 (gnus-check-backend-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1790 'request-expire-articles gnus-newsgroup-name)]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1791 ("Extract" |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1792 ["Uudecode" gnus-uu-decode-uu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1793 :help "Decode uuencoded article(s)"] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1794 ["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
|
1795 ["Unshar" gnus-uu-decode-unshar t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1796 ["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
|
1797 ["Save" gnus-uu-decode-save t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1798 ["Binhex" gnus-uu-decode-binhex t] |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1799 ["Postscript" gnus-uu-decode-postscript t]) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1800 ("Cache" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1801 ["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
|
1802 ["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
|
1803 ["Translate" gnus-article-babel t] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1804 ["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
|
1805 ["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
|
1806 ["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
|
1807 ["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
|
1808 ["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
|
1809 ["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
|
1810 ["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
|
1811 ["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
|
1812 ["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
|
1813 ["Redisplay" gnus-summary-show-article t]))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1814 (easy-menu-define |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1815 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
|
1816 (cons "Article" innards)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1817 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1818 (easy-menu-define |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1819 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
|
1820 (cons "Commands" innards))) |
17493 | 1821 |
1822 (easy-menu-define | |
1823 gnus-summary-thread-menu gnus-summary-mode-map "" | |
1824 '("Threads" | |
1825 ["Toggle threading" gnus-summary-toggle-threads t] | |
1826 ["Hide threads" gnus-summary-hide-all-threads t] | |
1827 ["Show threads" gnus-summary-show-all-threads t] | |
1828 ["Hide thread" gnus-summary-hide-thread t] | |
1829 ["Show thread" gnus-summary-show-thread t] | |
1830 ["Go to next thread" gnus-summary-next-thread t] | |
1831 ["Go to previous thread" gnus-summary-prev-thread t] | |
1832 ["Go down thread" gnus-summary-down-thread t] | |
1833 ["Go up thread" gnus-summary-up-thread t] | |
1834 ["Top of thread" gnus-summary-top-thread t] | |
1835 ["Mark thread as read" gnus-summary-kill-thread t] | |
1836 ["Lower thread score" gnus-summary-lower-thread t] | |
1837 ["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
|
1838 ["Rethread current" gnus-summary-rethread-current t])) |
17493 | 1839 |
1840 (easy-menu-define | |
1841 gnus-summary-post-menu gnus-summary-mode-map "" | |
1842 '("Post" | |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1843 ["Post an article" gnus-summary-post-news |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1844 :help "Post an article"] |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1845 ["Followup" gnus-summary-followup |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1846 :help "Post followup to this article"] |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1847 ["Followup and yank" gnus-summary-followup-with-original |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1848 :help "Post followup to this article, quoting its contents"] |
17493 | 1849 ["Supersede article" gnus-summary-supersede-article t] |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1850 ["Cancel article" gnus-summary-cancel-article |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1851 :help "Cancel an article you posted"] |
17493 | 1852 ["Reply" gnus-summary-reply t] |
1853 ["Reply and yank" gnus-summary-reply-with-original t] | |
1854 ["Wide reply" gnus-summary-wide-reply t] | |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1855 ["Wide reply and yank" gnus-summary-wide-reply-with-original |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1856 :help "Mail a reply, quoting this article"] |
17493 | 1857 ["Mail forward" gnus-summary-mail-forward t] |
1858 ["Post forward" gnus-summary-post-forward t] | |
1859 ["Digest and mail" gnus-uu-digest-mail-forward t] | |
1860 ["Digest and post" gnus-uu-digest-post-forward t] | |
1861 ["Resend message" gnus-summary-resend-message t] | |
1862 ["Send bounced mail" gnus-summary-resend-bounced-mail t] | |
1863 ["Send a mail" gnus-summary-mail-other-window t] | |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1864 ["Uuencode and post" gnus-uu-post-news |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1865 :help "Post a uuencoded article"] |
17493 | 1866 ["Followup via news" gnus-summary-followup-to-mail t] |
1867 ["Followup via news and yank" | |
1868 gnus-summary-followup-to-mail-with-original t] | |
1869 ;;("Draft" | |
1870 ;;["Send" gnus-summary-send-draft t] | |
1871 ;;["Send bounced" gnus-resend-bounced-mail t]) | |
1872 )) | |
1873 | |
1874 (easy-menu-define | |
1875 gnus-summary-misc-menu gnus-summary-mode-map "" | |
1876 '("Misc" | |
1877 ("Mark Read" | |
1878 ["Mark as read" gnus-summary-mark-as-read-forward t] | |
1879 ["Mark same subject and select" | |
1880 gnus-summary-kill-same-subject-and-select t] | |
1881 ["Mark same subject" gnus-summary-kill-same-subject t] | |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1882 ["Catchup" gnus-summary-catchup |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1883 :help "Mark unread articles in this group as read"] |
17493 | 1884 ["Catchup all" gnus-summary-catchup-all t] |
1885 ["Catchup to here" gnus-summary-catchup-to-here t] | |
1886 ["Catchup region" gnus-summary-mark-region-as-read t] | |
1887 ["Mark excluded" gnus-summary-limit-mark-excluded-as-read t]) | |
1888 ("Mark Various" | |
1889 ["Tick" gnus-summary-tick-article-forward t] | |
1890 ["Mark as dormant" gnus-summary-mark-as-dormant t] | |
1891 ["Remove marks" gnus-summary-clear-mark-forward t] | |
1892 ["Set expirable mark" gnus-summary-mark-as-expirable t] | |
1893 ["Set bookmark" gnus-summary-set-bookmark t] | |
1894 ["Remove bookmark" gnus-summary-remove-bookmark t]) | |
1895 ("Mark Limit" | |
1896 ["Marks..." gnus-summary-limit-to-marks t] | |
1897 ["Subject..." gnus-summary-limit-to-subject t] | |
1898 ["Author..." gnus-summary-limit-to-author t] | |
1899 ["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
|
1900 ["Extra..." gnus-summary-limit-to-extra t] |
17493 | 1901 ["Score" gnus-summary-limit-to-score t] |
1902 ["Unread" gnus-summary-limit-to-unread t] | |
1903 ["Non-dormant" gnus-summary-limit-exclude-dormant t] | |
1904 ["Articles" gnus-summary-limit-to-articles t] | |
1905 ["Pop limit" gnus-summary-pop-limit t] | |
1906 ["Show dormant" gnus-summary-limit-include-dormant t] | |
1907 ["Hide childless dormant" | |
1908 gnus-summary-limit-exclude-childless-dormant t] | |
1909 ;;["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
|
1910 ["Hide marked" gnus-summary-limit-exclude-marks t] |
17493 | 1911 ["Show expunged" gnus-summary-show-all-expunged t]) |
1912 ("Process Mark" | |
1913 ["Set mark" gnus-summary-mark-as-processable t] | |
1914 ["Remove mark" gnus-summary-unmark-as-processable t] | |
1915 ["Remove all marks" gnus-summary-unmark-all-processable t] | |
1916 ["Mark above" gnus-uu-mark-over t] | |
1917 ["Mark series" gnus-uu-mark-series t] | |
1918 ["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
|
1919 ["Unmark region" gnus-uu-unmark-region t] |
17493 | 1920 ["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
|
1921 ["Unmark by regexp..." gnus-uu-unmark-by-regexp t] |
17493 | 1922 ["Mark all" gnus-uu-mark-all t] |
1923 ["Mark buffer" gnus-uu-mark-buffer t] | |
1924 ["Mark sparse" gnus-uu-mark-sparse t] | |
1925 ["Mark thread" gnus-uu-mark-thread t] | |
1926 ["Unmark thread" gnus-uu-unmark-thread t] | |
1927 ("Process Mark Sets" | |
1928 ["Kill" gnus-summary-kill-process-mark t] | |
1929 ["Yank" gnus-summary-yank-process-mark | |
1930 gnus-newsgroup-process-stack] | |
1931 ["Save" gnus-summary-save-process-mark t])) | |
1932 ("Scroll article" | |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1933 ["Page forward" gnus-summary-next-page |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1934 :help "Show next page of article"] |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1935 ["Page backward" gnus-summary-prev-page |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1936 :help "Show previous page of article"] |
17493 | 1937 ["Line forward" gnus-summary-scroll-up t]) |
1938 ("Move" | |
1939 ["Next unread article" gnus-summary-next-unread-article t] | |
1940 ["Previous unread article" gnus-summary-prev-unread-article t] | |
1941 ["Next article" gnus-summary-next-article t] | |
1942 ["Previous article" gnus-summary-prev-article t] | |
1943 ["Next unread subject" gnus-summary-next-unread-subject t] | |
1944 ["Previous unread subject" gnus-summary-prev-unread-subject t] | |
1945 ["Next article same subject" gnus-summary-next-same-subject t] | |
1946 ["Previous article same subject" gnus-summary-prev-same-subject t] | |
1947 ["First unread article" gnus-summary-first-unread-article t] | |
1948 ["Best unread article" gnus-summary-best-unread-article t] | |
1949 ["Go to subject number..." gnus-summary-goto-subject t] | |
1950 ["Go to article number..." gnus-summary-goto-article t] | |
1951 ["Go to the last article" gnus-summary-goto-last-article t] | |
1952 ["Pop article off history" gnus-summary-pop-article t]) | |
1953 ("Sort" | |
1954 ["Sort by number" gnus-summary-sort-by-number t] | |
1955 ["Sort by author" gnus-summary-sort-by-author t] | |
1956 ["Sort by subject" gnus-summary-sort-by-subject t] | |
1957 ["Sort by date" gnus-summary-sort-by-date t] | |
1958 ["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
|
1959 ["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
|
1960 ["Sort by characters" gnus-summary-sort-by-chars t]) |
17493 | 1961 ("Help" |
1962 ["Fetch group FAQ" gnus-summary-fetch-faq t] | |
1963 ["Describe group" gnus-summary-describe-group t] | |
1964 ["Read manual" gnus-info-find-node t]) | |
1965 ("Modes" | |
1966 ["Pick and read" gnus-pick-mode t] | |
1967 ["Binary" gnus-binary-mode t]) | |
1968 ("Regeneration" | |
1969 ["Regenerate" gnus-summary-prepare t] | |
1970 ["Insert cached articles" gnus-summary-insert-cached-articles t] | |
1971 ["Toggle threading" gnus-summary-toggle-threads t]) | |
1972 ["Filter articles..." gnus-summary-execute-command t] | |
1973 ["Run command on subjects..." gnus-summary-universal-argument t] | |
1974 ["Search articles forward..." gnus-summary-search-article-forward t] | |
1975 ["Search articles backward..." gnus-summary-search-article-backward t] | |
1976 ["Toggle line truncation" gnus-summary-toggle-truncation t] | |
1977 ["Expand window" gnus-summary-expand-window t] | |
1978 ["Expire expirable articles" gnus-summary-expire-articles | |
1979 (gnus-check-backend-function | |
1980 'request-expire-articles gnus-newsgroup-name)] | |
1981 ["Edit local kill file" gnus-summary-edit-local-kill t] | |
1982 ["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
|
1983 ["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
|
1984 ["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
|
1985 ["Send a bug report" gnus-bug t] |
17493 | 1986 ("Exit" |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1987 ["Catchup and exit" gnus-summary-catchup-and-exit |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1988 :help "Mark unread articles in this group as read, then exit"] |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
1989 ["Catchup all and exit" gnus-summary-catchup-all-and-exit t] |
17493 | 1990 ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t] |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1991 ["Exit group" gnus-summary-exit |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
1992 :help "Exit current group, return to group selection mode"] |
17493 | 1993 ["Exit group without updating" gnus-summary-exit-no-update t] |
1994 ["Exit and goto next group" gnus-summary-next-group t] | |
1995 ["Exit and goto prev group" gnus-summary-prev-group t] | |
1996 ["Reselect group" gnus-summary-reselect-current-group t] | |
1997 ["Rescan group" gnus-summary-rescan-group t] | |
1998 ["Update dribble" gnus-summary-save-newsrc t]))) | |
1999 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2000 (gnus-run-hooks 'gnus-summary-menu-hook))) |
17493 | 2001 |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2002 (defvar gnus-summary-tool-bar-map nil) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2003 |
33316 | 2004 ;; Emacs 21 tool bar. Should be no-op otherwise. |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2005 (defun gnus-summary-make-tool-bar () |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2006 (if (and (fboundp 'tool-bar-add-item-from-menu) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2007 (default-value 'tool-bar-mode) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2008 (not gnus-summary-tool-bar-map)) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2009 (setq gnus-summary-tool-bar-map |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2010 (let ((tool-bar-map (make-sparse-keymap))) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2011 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2012 'gnus-summary-prev-unread "prev-ur" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2013 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2014 'gnus-summary-next-unread "next-ur" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2015 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2016 'gnus-summary-post-news "post" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2017 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2018 'gnus-summary-followup-with-original "fuwo" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2019 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2020 'gnus-summary-followup "followup" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2021 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2022 'gnus-summary-reply-with-original "reply-wo" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2023 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2024 'gnus-summary-reply "reply" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2025 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2026 'gnus-summary-caesar-message "rot13" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2027 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2028 'gnus-uu-decode-uu "uu-decode" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2029 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2030 'gnus-summary-save-article-file "save-aif" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2031 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2032 'gnus-summary-save-article "save-art" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2033 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2034 'gnus-uu-post-news "uu-post" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2035 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2036 'gnus-summary-catchup "catchup" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2037 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2038 'gnus-summary-catchup-and-exit "cu-exit" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2039 (tool-bar-add-item-from-menu |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2040 'gnus-summary-exit "exit-summ" gnus-summary-mode-map) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2041 tool-bar-map))) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2042 (if gnus-summary-tool-bar-map |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2043 (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map))) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2044 |
17493 | 2045 (defun gnus-score-set-default (var value) |
2046 "A version of set that updates the GNU Emacs menu-bar." | |
2047 (set var value) | |
2048 ;; It is the message that forces the active status to be updated. | |
2049 (message "")) | |
2050 | |
2051 (defun gnus-make-score-map (type) | |
2052 "Make a summary score map of type TYPE." | |
2053 (if t | |
2054 nil | |
2055 (let ((headers '(("author" "from" string) | |
2056 ("subject" "subject" string) | |
2057 ("article body" "body" string) | |
2058 ("article head" "head" string) | |
2059 ("xref" "xref" string) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2060 ("extra header" "extra" string) |
17493 | 2061 ("lines" "lines" number) |
2062 ("followups to author" "followup" string))) | |
2063 (types '((number ("less than" <) | |
2064 ("greater than" >) | |
2065 ("equal" =)) | |
2066 (string ("substring" s) | |
2067 ("exact string" e) | |
2068 ("fuzzy string" f) | |
2069 ("regexp" r)))) | |
2070 (perms '(("temporary" (current-time-string)) | |
2071 ("permanent" nil) | |
2072 ("immediate" now))) | |
2073 header) | |
2074 (list | |
2075 (apply | |
2076 'nconc | |
2077 (list | |
2078 (if (eq type 'lower) | |
2079 "Lower score" | |
2080 "Increase score")) | |
2081 (let (outh) | |
2082 (while headers | |
2083 (setq header (car headers)) | |
2084 (setq outh | |
2085 (cons | |
2086 (apply | |
2087 'nconc | |
2088 (list (car header)) | |
2089 (let ((ts (cdr (assoc (nth 2 header) types))) | |
2090 outt) | |
2091 (while ts | |
2092 (setq outt | |
2093 (cons | |
2094 (apply | |
2095 'nconc | |
2096 (list (caar ts)) | |
2097 (let ((ps perms) | |
2098 outp) | |
2099 (while ps | |
2100 (setq outp | |
2101 (cons | |
2102 (vector | |
2103 (caar ps) | |
2104 (list | |
2105 'gnus-summary-score-entry | |
2106 (nth 1 header) | |
2107 (if (or (string= (nth 1 header) | |
2108 "head") | |
2109 (string= (nth 1 header) | |
2110 "body")) | |
2111 "" | |
2112 (list 'gnus-summary-header | |
2113 (nth 1 header))) | |
2114 (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
|
2115 (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
|
2116 nil) |
17493 | 2117 (nth 1 (car ps)) |
2118 t) | |
2119 t) | |
2120 outp)) | |
2121 (setq ps (cdr ps))) | |
2122 (list (nreverse outp)))) | |
2123 outt)) | |
2124 (setq ts (cdr ts))) | |
2125 (list (nreverse outt)))) | |
2126 outh)) | |
2127 (setq headers (cdr headers))) | |
2128 (list (nreverse outh)))))))) | |
2129 | |
2130 | |
2131 | |
2132 (defun gnus-summary-mode (&optional group) | |
2133 "Major mode for reading articles. | |
2134 | |
2135 All normal editing commands are switched off. | |
2136 \\<gnus-summary-mode-map> | |
2137 Each line in this buffer represents one article. To read an | |
2138 article, you can, for instance, type `\\[gnus-summary-next-page]'. To move forwards | |
2139 and backwards while displaying articles, type `\\[gnus-summary-next-unread-article]' and `\\[gnus-summary-prev-unread-article]', | |
2140 respectively. | |
2141 | |
2142 You can also post articles and send mail from this buffer. To | |
2143 follow up an article, type `\\[gnus-summary-followup]'. To mail a reply to the author | |
2144 of an article, type `\\[gnus-summary-reply]'. | |
2145 | |
2146 There are approx. one gazillion commands you can execute in this | |
2147 buffer; read the info pages for more information (`\\[gnus-info-find-node]'). | |
2148 | |
2149 The following commands are available: | |
2150 | |
2151 \\{gnus-summary-mode-map}" | |
2152 (interactive) | |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2153 (kill-all-local-variables) |
17493 | 2154 (when (gnus-visual-p 'summary-menu 'menu) |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2155 (gnus-summary-make-menu-bar) |
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
2156 (gnus-summary-make-tool-bar)) |
17493 | 2157 (gnus-summary-make-local-variables) |
2158 (gnus-make-thread-indent-array) | |
2159 (gnus-simplify-mode-line) | |
2160 (setq major-mode 'gnus-summary-mode) | |
2161 (setq mode-name "Summary") | |
2162 (make-local-variable 'minor-mode-alist) | |
2163 (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
|
2164 (buffer-disable-undo) |
17493 | 2165 (setq buffer-read-only t) ;Disable modification |
2166 (setq truncate-lines t) | |
2167 (setq selective-display t) | |
2168 (setq selective-display-ellipses t) ;Display `...' | |
2169 (gnus-summary-set-display-table) | |
2170 (gnus-set-default-directory) | |
2171 (setq gnus-newsgroup-name group) | |
2172 (make-local-variable 'gnus-summary-line-format) | |
2173 (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
|
2174 (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
|
2175 (make-local-variable 'gnus-summary-dummy-line-format-spec) |
17493 | 2176 (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
|
2177 (make-local-hook 'pre-command-hook) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2178 (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
|
2179 (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
|
2180 (mm-enable-multibyte-mule4) |
17493 | 2181 (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy) |
2182 (gnus-update-summary-mark-positions)) | |
2183 | |
2184 (defun gnus-summary-make-local-variables () | |
2185 "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
|
2186 (let (global) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2187 (dolist (local gnus-summary-local-variables) |
17493 | 2188 (if (consp local) |
2189 (progn | |
2190 (if (eq (cdr local) 'global) | |
2191 ;; Copy the global value of the variable. | |
2192 (setq global (symbol-value (car local))) | |
2193 ;; Use the value from the list. | |
2194 (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
|
2195 (set (make-local-variable (car local)) global)) |
17493 | 2196 ;; 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
|
2197 (set (make-local-variable local) nil))))) |
17493 | 2198 |
2199 (defun gnus-summary-clear-local-variables () | |
2200 (let ((locals gnus-summary-local-variables)) | |
2201 (while locals | |
2202 (if (consp (car locals)) | |
2203 (and (vectorp (caar locals)) | |
2204 (set (caar locals) nil)) | |
2205 (and (vectorp (car locals)) | |
2206 (set (car locals) nil))) | |
2207 (setq locals (cdr locals))))) | |
2208 | |
2209 ;; Summary data functions. | |
2210 | |
2211 (defmacro gnus-data-number (data) | |
2212 `(car ,data)) | |
2213 | |
2214 (defmacro gnus-data-set-number (data number) | |
2215 `(setcar ,data ,number)) | |
2216 | |
2217 (defmacro gnus-data-mark (data) | |
2218 `(nth 1 ,data)) | |
2219 | |
2220 (defmacro gnus-data-set-mark (data mark) | |
2221 `(setcar (nthcdr 1 ,data) ,mark)) | |
2222 | |
2223 (defmacro gnus-data-pos (data) | |
2224 `(nth 2 ,data)) | |
2225 | |
2226 (defmacro gnus-data-set-pos (data pos) | |
2227 `(setcar (nthcdr 2 ,data) ,pos)) | |
2228 | |
2229 (defmacro gnus-data-header (data) | |
2230 `(nth 3 ,data)) | |
2231 | |
2232 (defmacro gnus-data-set-header (data header) | |
2233 `(setf (nth 3 ,data) ,header)) | |
2234 | |
2235 (defmacro gnus-data-level (data) | |
2236 `(nth 4 ,data)) | |
2237 | |
2238 (defmacro gnus-data-unread-p (data) | |
2239 `(= (nth 1 ,data) gnus-unread-mark)) | |
2240 | |
2241 (defmacro gnus-data-read-p (data) | |
2242 `(/= (nth 1 ,data) gnus-unread-mark)) | |
2243 | |
2244 (defmacro gnus-data-pseudo-p (data) | |
2245 `(consp (nth 3 ,data))) | |
2246 | |
2247 (defmacro gnus-data-find (number) | |
2248 `(assq ,number gnus-newsgroup-data)) | |
2249 | |
2250 (defmacro gnus-data-find-list (number &optional data) | |
2251 `(let ((bdata ,(or data 'gnus-newsgroup-data))) | |
2252 (memq (assq ,number bdata) | |
2253 bdata))) | |
2254 | |
2255 (defmacro gnus-data-make (number mark pos header level) | |
2256 `(list ,number ,mark ,pos ,header ,level)) | |
2257 | |
2258 (defun gnus-data-enter (after-article number mark pos header level offset) | |
2259 (let ((data (gnus-data-find-list after-article))) | |
2260 (unless data | |
2261 (error "No such article: %d" after-article)) | |
2262 (setcdr data (cons (gnus-data-make number mark pos header level) | |
2263 (cdr data))) | |
2264 (setq gnus-newsgroup-data-reverse nil) | |
2265 (gnus-data-update-list (cddr data) offset))) | |
2266 | |
2267 (defun gnus-data-enter-list (after-article list &optional offset) | |
2268 (when list | |
2269 (let ((data (and after-article (gnus-data-find-list after-article))) | |
2270 (ilist list)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2271 (if (not (or data |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2272 after-article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2273 (let ((odata gnus-newsgroup-data)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2274 (setq gnus-newsgroup-data (nconc list gnus-newsgroup-data)) |
17493 | 2275 (when offset |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2276 (gnus-data-update-list odata offset))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2277 ;; 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
|
2278 ;; list. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2279 (while (cdr list) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2280 (setq list (cdr list))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2281 (if (not data) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2282 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2283 (setcdr list gnus-newsgroup-data) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2284 (setq gnus-newsgroup-data ilist) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2285 (when offset |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2286 (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
|
2287 (setcdr list (cdr data)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2288 (setcdr data ilist) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2289 (when offset |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2290 (gnus-data-update-list (cdr list) offset)))) |
17493 | 2291 (setq gnus-newsgroup-data-reverse nil)))) |
2292 | |
2293 (defun gnus-data-remove (article &optional offset) | |
2294 (let ((data gnus-newsgroup-data)) | |
2295 (if (= (gnus-data-number (car data)) article) | |
2296 (progn | |
2297 (setq gnus-newsgroup-data (cdr gnus-newsgroup-data) | |
2298 gnus-newsgroup-data-reverse nil) | |
2299 (when offset | |
2300 (gnus-data-update-list gnus-newsgroup-data offset))) | |
2301 (while (cdr data) | |
2302 (when (= (gnus-data-number (cadr data)) article) | |
2303 (setcdr data (cddr data)) | |
2304 (when offset | |
2305 (gnus-data-update-list (cdr data) offset)) | |
2306 (setq data nil | |
2307 gnus-newsgroup-data-reverse nil)) | |
2308 (setq data (cdr data)))))) | |
2309 | |
2310 (defmacro gnus-data-list (backward) | |
2311 `(if ,backward | |
2312 (or gnus-newsgroup-data-reverse | |
2313 (setq gnus-newsgroup-data-reverse | |
2314 (reverse gnus-newsgroup-data))) | |
2315 gnus-newsgroup-data)) | |
2316 | |
2317 (defun gnus-data-update-list (data offset) | |
2318 "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
|
2319 (setq gnus-newsgroup-data-reverse nil) |
17493 | 2320 (while data |
2321 (setcar (nthcdr 2 (car data)) (+ offset (nth 2 (car data)))) | |
2322 (setq data (cdr data)))) | |
2323 | |
2324 (defun gnus-summary-article-pseudo-p (article) | |
2325 "Say whether this article is a pseudo article or not." | |
2326 (not (vectorp (gnus-data-header (gnus-data-find article))))) | |
2327 | |
2328 (defmacro gnus-summary-article-sparse-p (article) | |
2329 "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
|
2330 `(memq ,article gnus-newsgroup-sparse)) |
17493 | 2331 |
2332 (defmacro gnus-summary-article-ancient-p (article) | |
2333 "Say whether this article is a sparse article or not." | |
2334 `(memq ,article gnus-newsgroup-ancient)) | |
2335 | |
2336 (defun gnus-article-parent-p (number) | |
2337 "Say whether this article is a parent or not." | |
2338 (let ((data (gnus-data-find-list number))) | |
2339 (and (cdr data) ; There has to be an article after... | |
2340 (< (gnus-data-level (car data)) ; And it has to have a higher level. | |
2341 (gnus-data-level (nth 1 data)))))) | |
2342 | |
2343 (defun gnus-article-children (number) | |
2344 "Return a list of all children to NUMBER." | |
2345 (let* ((data (gnus-data-find-list number)) | |
2346 (level (gnus-data-level (car data))) | |
2347 children) | |
2348 (setq data (cdr data)) | |
2349 (while (and data | |
2350 (= (gnus-data-level (car data)) (1+ level))) | |
2351 (push (gnus-data-number (car data)) children) | |
2352 (setq data (cdr data))) | |
2353 children)) | |
2354 | |
2355 (defmacro gnus-summary-skip-intangible () | |
2356 "If the current article is intangible, then jump to a different article." | |
2357 '(let ((to (get-text-property (point) 'gnus-intangible))) | |
2358 (and to (gnus-summary-goto-subject to)))) | |
2359 | |
2360 (defmacro gnus-summary-article-intangible-p () | |
2361 "Say whether this article is intangible or not." | |
2362 '(get-text-property (point) 'gnus-intangible)) | |
2363 | |
2364 (defun gnus-article-read-p (article) | |
2365 "Say whether ARTICLE is read or not." | |
2366 (not (or (memq article gnus-newsgroup-marked) | |
2367 (memq article gnus-newsgroup-unreads) | |
2368 (memq article gnus-newsgroup-unselected) | |
2369 (memq article gnus-newsgroup-dormant)))) | |
2370 | |
2371 ;; Some summary mode macros. | |
2372 | |
2373 (defmacro gnus-summary-article-number () | |
2374 "The article number of the article on the current line. | |
2375 If there isn's an article number here, then we return the current | |
2376 article number." | |
2377 '(progn | |
2378 (gnus-summary-skip-intangible) | |
2379 (or (get-text-property (point) 'gnus-number) | |
2380 (gnus-summary-last-subject)))) | |
2381 | |
2382 (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
|
2383 "Return the header of article NUMBER." |
17493 | 2384 `(gnus-data-header (gnus-data-find |
2385 ,(or number '(gnus-summary-article-number))))) | |
2386 | |
2387 (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
|
2388 "Return the level of thread that starts with article NUMBER." |
17493 | 2389 `(if (and (eq gnus-summary-make-false-root 'dummy) |
2390 (get-text-property (point) 'gnus-intangible)) | |
2391 0 | |
2392 (gnus-data-level (gnus-data-find | |
2393 ,(or number '(gnus-summary-article-number)))))) | |
2394 | |
2395 (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
|
2396 "Return the mark of article NUMBER." |
17493 | 2397 `(gnus-data-mark (gnus-data-find |
2398 ,(or number '(gnus-summary-article-number))))) | |
2399 | |
2400 (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
|
2401 "Return the position of the line of article NUMBER." |
17493 | 2402 `(gnus-data-pos (gnus-data-find |
2403 ,(or number '(gnus-summary-article-number))))) | |
2404 | |
2405 (defalias 'gnus-summary-subject-string 'gnus-summary-article-subject) | |
2406 (defmacro gnus-summary-article-subject (&optional number) | |
2407 "Return current subject string or nil if nothing." | |
2408 `(let ((headers | |
2409 ,(if number | |
2410 `(gnus-data-header (assq ,number gnus-newsgroup-data)) | |
2411 '(gnus-data-header (assq (gnus-summary-article-number) | |
2412 gnus-newsgroup-data))))) | |
2413 (and headers | |
2414 (vectorp headers) | |
2415 (mail-header-subject headers)))) | |
2416 | |
2417 (defmacro gnus-summary-article-score (&optional number) | |
2418 "Return current article score." | |
2419 `(or (cdr (assq ,(or number '(gnus-summary-article-number)) | |
2420 gnus-newsgroup-scored)) | |
2421 gnus-summary-default-score 0)) | |
2422 | |
2423 (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
|
2424 "Return a list of article numbers that are children of article NUMBER." |
17493 | 2425 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number)))) |
2426 (level (gnus-data-level (car data))) | |
2427 l children) | |
2428 (while (and (setq data (cdr data)) | |
2429 (> (setq l (gnus-data-level (car data))) level)) | |
2430 (and (= (1+ level) l) | |
2431 (push (gnus-data-number (car data)) | |
2432 children))) | |
2433 (nreverse children))) | |
2434 | |
2435 (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
|
2436 "Return the article number of the parent of article NUMBER." |
17493 | 2437 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number)) |
2438 (gnus-data-list t))) | |
2439 (level (gnus-data-level (car data)))) | |
2440 (if (zerop level) | |
2441 () ; This is a root. | |
2442 ;; We search until we find an article with a level less than | |
2443 ;; this one. That function has to be the parent. | |
2444 (while (and (setq data (cdr data)) | |
2445 (not (< (gnus-data-level (car data)) level)))) | |
2446 (and data (gnus-data-number (car data)))))) | |
2447 | |
2448 (defun gnus-unread-mark-p (mark) | |
2449 "Say whether MARK is the unread mark." | |
2450 (= mark gnus-unread-mark)) | |
2451 | |
2452 (defun gnus-read-mark-p (mark) | |
2453 "Say whether MARK is one of the marks that mark as read. | |
2454 This is all marks except unread, ticked, dormant, and expirable." | |
2455 (not (or (= mark gnus-unread-mark) | |
2456 (= mark gnus-ticked-mark) | |
2457 (= mark gnus-dormant-mark) | |
2458 (= mark gnus-expirable-mark)))) | |
2459 | |
2460 (defmacro gnus-article-mark (number) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2461 "Return the MARK of article NUMBER. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2462 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
|
2463 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
|
2464 `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
|
2465 marks of articles." |
17493 | 2466 `(cond |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2467 ((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
|
2468 ((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
|
2469 ((memq ,number gnus-newsgroup-downloadable) gnus-downloadable-mark) |
17493 | 2470 ((memq ,number gnus-newsgroup-unreads) gnus-unread-mark) |
2471 ((memq ,number gnus-newsgroup-marked) gnus-ticked-mark) | |
2472 ((memq ,number gnus-newsgroup-dormant) gnus-dormant-mark) | |
2473 ((memq ,number gnus-newsgroup-expirable) gnus-expirable-mark) | |
2474 (t (or (cdr (assq ,number gnus-newsgroup-reads)) | |
2475 gnus-ancient-mark)))) | |
2476 | |
2477 ;; Saving hidden threads. | |
2478 | |
2479 (put 'gnus-save-hidden-threads 'lisp-indent-function 0) | |
2480 (put 'gnus-save-hidden-threads 'edebug-form-spec '(body)) | |
2481 | |
2482 (defmacro gnus-save-hidden-threads (&rest forms) | |
2483 "Save hidden threads, eval FORMS, and restore the hidden threads." | |
2484 (let ((config (make-symbol "config"))) | |
2485 `(let ((,config (gnus-hidden-threads-configuration))) | |
2486 (unwind-protect | |
2487 (save-excursion | |
2488 ,@forms) | |
2489 (gnus-restore-hidden-threads-configuration ,config))))) | |
2490 | |
24552
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2491 (defun gnus-data-compute-positions () |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2492 "Compute the positions of all articles." |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2493 (setq gnus-newsgroup-data-reverse nil) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2494 (let ((data gnus-newsgroup-data)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2495 (save-excursion |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2496 (gnus-save-hidden-threads |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2497 (gnus-summary-show-all-threads) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2498 (goto-char (point-min)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2499 (while data |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2500 (while (get-text-property (point) 'gnus-intangible) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2501 (forward-line 1)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2502 (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
|
2503 (setq data (cdr data)) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2504 (forward-line 1)))))) |
ccf2939fc5ec
(gnus-data-compute-positions): Move down after
Andreas Schwab <schwab@suse.de>
parents:
24357
diff
changeset
|
2505 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2506 (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
|
2507 "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
|
2508 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2509 (let (config) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2510 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2511 (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
|
2512 (push (1- (point)) config)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2513 config))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2514 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2515 (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
|
2516 "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
|
2517 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2518 (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
|
2519 (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
|
2520 (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
|
2521 (goto-char point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2522 (eq (char-after) ?\n)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2523 (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
|
2524 |
17493 | 2525 ;; Various summary mode internalish functions. |
2526 | |
2527 (defun gnus-mouse-pick-article (e) | |
2528 (interactive "e") | |
2529 (mouse-set-point e) | |
2530 (gnus-summary-next-page nil t)) | |
2531 | |
2532 (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
|
2533 "Change the display table. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2534 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
|
2535 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
|
2536 display only a single character." |
17493 | 2537 |
2538 ;; We start from the standard display table, if any. | |
2539 (let ((table (or (copy-sequence standard-display-table) | |
2540 (make-display-table))) | |
2541 (i 32)) | |
2542 ;; Nix out all the control chars... | |
2543 (while (>= (setq i (1- i)) 0) | |
2544 (aset table i [??])) | |
2545 ;; ... but not newline and cr, of course. (cr is necessary for the | |
2546 ;; selective display). | |
2547 (aset table ?\n nil) | |
2548 (aset table ?\r nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2549 ;; We keep TAB as well. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2550 (aset table ?\t nil) |
17493 | 2551 ;; We nix out any glyphs over 126 that are not set already. |
2552 (let ((i 256)) | |
2553 (while (>= (setq i (1- i)) 127) | |
2554 ;; Only modify if the entry is nil. | |
2555 (unless (aref table i) | |
2556 (aset table i [??])))) | |
2557 (setq buffer-display-table table))) | |
2558 | |
2559 (defun gnus-summary-setup-buffer (group) | |
2560 "Initialize summary buffer." | |
2561 (let ((buffer (concat "*Summary " group "*"))) | |
2562 (if (get-buffer buffer) | |
2563 (progn | |
2564 (set-buffer buffer) | |
2565 (setq gnus-summary-buffer (current-buffer)) | |
2566 (not gnus-newsgroup-prepared)) | |
2567 ;; 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
|
2568 (setq gnus-summary-buffer (set-buffer (gnus-get-buffer-create buffer))) |
17493 | 2569 (gnus-summary-mode group) |
2570 (when gnus-carpal | |
2571 (gnus-carpal-setup-buffer 'summary)) | |
2572 (unless gnus-single-article-buffer | |
2573 (make-local-variable 'gnus-article-buffer) | |
2574 (make-local-variable 'gnus-article-current) | |
2575 (make-local-variable 'gnus-original-article-buffer)) | |
2576 (setq gnus-newsgroup-name group) | |
2577 t))) | |
2578 | |
2579 (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
|
2580 "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
|
2581 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
|
2582 buffer that was in action when the last article was fetched." |
17493 | 2583 (when (eq major-mode 'gnus-summary-mode) |
2584 (setq gnus-summary-buffer (current-buffer)) | |
2585 (let ((name gnus-newsgroup-name) | |
2586 (marked gnus-newsgroup-marked) | |
2587 (unread gnus-newsgroup-unreads) | |
2588 (headers gnus-current-headers) | |
2589 (data gnus-newsgroup-data) | |
2590 (summary gnus-summary-buffer) | |
2591 (article-buffer gnus-article-buffer) | |
2592 (original gnus-original-article-buffer) | |
2593 (gac gnus-article-current) | |
2594 (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
|
2595 (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
|
2596 (default-charset gnus-newsgroup-charset)) |
17493 | 2597 (save-excursion |
2598 (set-buffer gnus-group-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2599 (setq gnus-newsgroup-name name |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2600 gnus-newsgroup-marked marked |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2601 gnus-newsgroup-unreads unread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2602 gnus-current-headers headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2603 gnus-newsgroup-data data |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2604 gnus-article-current gac |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2605 gnus-summary-buffer summary |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2606 gnus-article-buffer article-buffer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2607 gnus-original-article-buffer original |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2608 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
|
2609 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
|
2610 gnus-newsgroup-charset default-charset) |
17493 | 2611 ;; The article buffer also has local variables. |
2612 (when (gnus-buffer-live-p gnus-article-buffer) | |
2613 (set-buffer gnus-article-buffer) | |
2614 (setq gnus-summary-buffer summary)))))) | |
2615 | |
2616 (defun gnus-summary-article-unread-p (article) | |
2617 "Say whether ARTICLE is unread or not." | |
2618 (memq article gnus-newsgroup-unreads)) | |
2619 | |
2620 (defun gnus-summary-first-article-p (&optional article) | |
2621 "Return whether ARTICLE is the first article in the buffer." | |
2622 (if (not (setq article (or article (gnus-summary-article-number)))) | |
2623 nil | |
2624 (eq article (caar gnus-newsgroup-data)))) | |
2625 | |
2626 (defun gnus-summary-last-article-p (&optional article) | |
2627 "Return whether ARTICLE is the last article in the buffer." | |
2628 (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
|
2629 ;; 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
|
2630 t |
17493 | 2631 (not (cdr (gnus-data-find-list article))))) |
2632 | |
2633 (defun gnus-make-thread-indent-array () | |
2634 (let ((n 200)) | |
2635 (unless (and gnus-thread-indent-array | |
2636 (= gnus-thread-indent-level gnus-thread-indent-array-level)) | |
2637 (setq gnus-thread-indent-array (make-vector 201 "") | |
2638 gnus-thread-indent-array-level gnus-thread-indent-level) | |
2639 (while (>= n 0) | |
2640 (aset gnus-thread-indent-array n | |
2641 (make-string (* n gnus-thread-indent-level) ? )) | |
2642 (setq n (1- n)))))) | |
2643 | |
2644 (defun gnus-update-summary-mark-positions () | |
2645 "Compute where the summary marks are to go." | |
2646 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2647 (when (gnus-buffer-exists-p gnus-summary-buffer) |
17493 | 2648 (set-buffer gnus-summary-buffer)) |
2649 (let ((gnus-replied-mark 129) | |
2650 (gnus-score-below-mark 130) | |
2651 (gnus-score-over-mark 130) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2652 (gnus-download-mark 131) |
17493 | 2653 (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
|
2654 gnus-visual pos) |
17493 | 2655 (save-excursion |
2656 (gnus-set-work-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2657 (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
|
2658 (gnus-newsgroup-downloadable '((0 . t)))) |
17493 | 2659 (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
|
2660 [0 "" "" "" "" "" 0 0 "" nil] 0 nil 128 t nil "" nil 1) |
17493 | 2661 (goto-char (point-min)) |
2662 (setq pos (list (cons 'unread (and (search-forward "\200" nil t) | |
2663 (- (point) 2))))) | |
2664 (goto-char (point-min)) | |
2665 (push (cons 'replied (and (search-forward "\201" nil t) | |
2666 (- (point) 2))) | |
2667 pos) | |
2668 (goto-char (point-min)) | |
2669 (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
|
2670 pos) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2671 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2672 (push (cons 'download |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2673 (and (search-forward "\203" nil t) (- (point) 2))) |
17493 | 2674 pos))) |
2675 (setq gnus-summary-mark-positions pos)))) | |
2676 | |
2677 (defun gnus-summary-insert-dummy-line (gnus-tmp-subject gnus-tmp-number) | |
2678 "Insert a dummy root in the summary buffer." | |
2679 (beginning-of-line) | |
2680 (gnus-add-text-properties | |
2681 (point) (progn (eval gnus-summary-dummy-line-format-spec) (point)) | |
2682 (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number))) | |
2683 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2684 (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
|
2685 (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
|
2686 (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
|
2687 (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
|
2688 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2689 (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
|
2690 gnus-newsgroup-ignored-charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2691 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2692 ((and to |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2693 gnus-ignored-from-addresses |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2694 (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
|
2695 (mail-header-from header))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2696 (concat "-> " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2697 (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
|
2698 (funcall |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2699 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
|
2700 (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
|
2701 ((and newsgroups |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2702 gnus-ignored-from-addresses |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2703 (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
|
2704 (mail-header-from header))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2705 (concat "=> " newsgroups)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2706 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2707 (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
|
2708 (mail-header-from header))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2709 (mail-header-from header)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
2710 |
17493 | 2711 (defun gnus-summary-insert-line (gnus-tmp-header |
2712 gnus-tmp-level gnus-tmp-current | |
2713 gnus-tmp-unread gnus-tmp-replied | |
2714 gnus-tmp-expirable gnus-tmp-subject-or-nil | |
2715 &optional gnus-tmp-dummy gnus-tmp-score | |
2716 gnus-tmp-process) | |
2717 (let* ((gnus-tmp-indentation (aref gnus-thread-indent-array gnus-tmp-level)) | |
2718 (gnus-tmp-lines (mail-header-lines gnus-tmp-header)) | |
2719 (gnus-tmp-score (or gnus-tmp-score gnus-summary-default-score 0)) | |
2720 (gnus-tmp-score-char | |
2721 (if (or (null gnus-summary-default-score) | |
2722 (<= (abs (- gnus-tmp-score gnus-summary-default-score)) | |
2723 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
|
2724 ? ;Whitespace |
17493 | 2725 (if (< gnus-tmp-score gnus-summary-default-score) |
2726 gnus-score-below-mark gnus-score-over-mark))) | |
2727 (gnus-tmp-replied | |
2728 (cond (gnus-tmp-process gnus-process-mark) | |
2729 ((memq gnus-tmp-current gnus-newsgroup-cached) | |
2730 gnus-cached-mark) | |
2731 (gnus-tmp-replied gnus-replied-mark) | |
2732 ((memq gnus-tmp-current gnus-newsgroup-saved) | |
2733 gnus-saved-mark) | |
2734 (t gnus-unread-mark))) | |
2735 (gnus-tmp-from (mail-header-from gnus-tmp-header)) | |
2736 (gnus-tmp-name | |
2737 (cond | |
2738 ((string-match "<[^>]+> *$" gnus-tmp-from) | |
2739 (let ((beg (match-beginning 0))) | |
2740 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from) | |
2741 (substring gnus-tmp-from (1+ (match-beginning 0)) | |
2742 (1- (match-end 0)))) | |
2743 (substring gnus-tmp-from 0 beg)))) | |
2744 ((string-match "(.+)" gnus-tmp-from) | |
2745 (substring gnus-tmp-from | |
2746 (1+ (match-beginning 0)) (1- (match-end 0)))) | |
2747 (t gnus-tmp-from))) | |
2748 (gnus-tmp-subject (mail-header-subject gnus-tmp-header)) | |
2749 (gnus-tmp-number (mail-header-number gnus-tmp-header)) | |
2750 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[)) | |
2751 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\])) | |
2752 (buffer-read-only nil)) | |
2753 (when (string= gnus-tmp-name "") | |
2754 (setq gnus-tmp-name gnus-tmp-from)) | |
2755 (unless (numberp gnus-tmp-lines) | |
2756 (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
|
2757 (gnus-put-text-property |
17493 | 2758 (point) |
2759 (progn (eval gnus-summary-line-format-spec) (point)) | |
2760 'gnus-number gnus-tmp-number) | |
2761 (when (gnus-visual-p 'summary-highlight 'highlight) | |
2762 (forward-line -1) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2763 (gnus-run-hooks 'gnus-summary-update-hook) |
17493 | 2764 (forward-line 1)))) |
2765 | |
2766 (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
|
2767 "Update summary line after change." |
17493 | 2768 (when (and gnus-summary-default-score |
2769 (not gnus-summary-inhibit-highlight)) | |
2770 (let* ((gnus-summary-inhibit-highlight t) ; Prevent recursion. | |
2771 (article (gnus-summary-article-number)) | |
2772 (score (gnus-summary-article-score article))) | |
2773 (unless dont-update | |
2774 (if (and gnus-summary-mark-below | |
2775 (< (gnus-summary-article-score) | |
2776 gnus-summary-mark-below)) | |
2777 ;; This article has a low score, so we mark it as read. | |
2778 (when (memq article gnus-newsgroup-unreads) | |
2779 (gnus-summary-mark-article-as-read gnus-low-score-mark)) | |
2780 (when (eq (gnus-summary-article-mark) gnus-low-score-mark) | |
2781 ;; This article was previously marked as read on account | |
2782 ;; of a low score, but now it has risen, so we mark it as | |
2783 ;; unread. | |
2784 (gnus-summary-mark-article-as-unread gnus-unread-mark))) | |
2785 (gnus-summary-update-mark | |
2786 (if (or (null gnus-summary-default-score) | |
2787 (<= (abs (- score gnus-summary-default-score)) | |
2788 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
|
2789 ? ;Whitespace |
17493 | 2790 (if (< score gnus-summary-default-score) |
2791 gnus-score-below-mark gnus-score-over-mark)) | |
2792 'score)) | |
2793 ;; Do visual highlighting. | |
2794 (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
|
2795 (gnus-run-hooks 'gnus-summary-update-hook))))) |
17493 | 2796 |
2797 (defvar gnus-tmp-new-adopts nil) | |
2798 | |
2799 (defun gnus-summary-number-of-articles-in-thread (thread &optional level char) | |
2800 "Return the number of articles in THREAD. | |
2801 This may be 0 in some cases -- if none of the articles in | |
2802 the thread are to be displayed." | |
2803 (let* ((number | |
2804 ;; Fix by Luc Van Eycken <Luc.VanEycken@esat.kuleuven.ac.be>. | |
2805 (cond | |
2806 ((not (listp thread)) | |
2807 1) | |
2808 ((and (consp thread) (cdr thread)) | |
2809 (apply | |
2810 '+ 1 (mapcar | |
2811 'gnus-summary-number-of-articles-in-thread (cdr thread)))) | |
2812 ((null thread) | |
2813 1) | |
2814 ((memq (mail-header-number (car thread)) gnus-newsgroup-limit) | |
2815 1) | |
2816 (t 0)))) | |
2817 (when (and level (zerop level) gnus-tmp-new-adopts) | |
2818 (incf number | |
2819 (apply '+ (mapcar | |
2820 'gnus-summary-number-of-articles-in-thread | |
2821 gnus-tmp-new-adopts)))) | |
2822 (if char | |
2823 (if (> number 1) gnus-not-empty-thread-mark | |
2824 gnus-empty-thread-mark) | |
2825 number))) | |
2826 | |
2827 (defun gnus-summary-set-local-parameters (group) | |
2828 "Go through the local params of GROUP and set all variable specs in that list." | |
2829 (let ((params (gnus-group-find-parameter group)) | |
2830 elem) | |
2831 (while params | |
2832 (setq elem (car params) | |
2833 params (cdr params)) | |
2834 (and (consp elem) ; Has to be a cons. | |
2835 (consp (cdr elem)) ; The cdr has to be a list. | |
2836 (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
|
2837 (not (memq (car elem) '(quit-config))) ; Ignore quit-config. |
17493 | 2838 (ignore-errors ; So we set it. |
2839 (make-local-variable (car elem)) | |
2840 (set (car elem) (eval (nth 1 elem)))))))) | |
2841 | |
2842 (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
|
2843 kill-buffer no-display backward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2844 select-articles) |
17493 | 2845 "Start reading news in newsgroup GROUP. |
2846 If SHOW-ALL is non-nil, already read articles are also listed. | |
2847 If NO-ARTICLE is non-nil, no article is selected initially. | |
2848 If NO-DISPLAY, don't generate a summary buffer." | |
2849 (let (result) | |
2850 (while (and group | |
2851 (null (setq result | |
2852 (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
|
2853 (or (gnus-summary-read-group-1 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2854 group show-all no-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2855 kill-buffer no-display |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2856 select-articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2857 (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
|
2858 select-articles nil))))) |
17493 | 2859 (eq gnus-auto-select-next 'quietly)) |
2860 (set-buffer gnus-group-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2861 ;; 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
|
2862 ;; 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
|
2863 ;; 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
|
2864 (when backward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2865 (gnus-group-prev-unread-group 2)) |
17493 | 2866 (if (not (equal group (gnus-group-group-name))) |
2867 (setq group (gnus-group-group-name)) | |
2868 (setq group nil))) | |
2869 result)) | |
2870 | |
2871 (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
|
2872 kill-buffer no-display |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2873 &optional select-articles) |
17493 | 2874 ;; Killed foreign groups can't be entered. |
2875 (when (and (not (gnus-group-native-p group)) | |
2876 (not (gnus-gethash group gnus-newsrc-hashtb))) | |
2877 (error "Dead non-native groups can't be entered")) | |
2878 (gnus-message 5 "Retrieving newsgroup: %s..." group) | |
2879 (let* ((new-group (gnus-summary-setup-buffer group)) | |
2880 (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
|
2881 (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
|
2882 group show-all select-articles)))) |
17493 | 2883 (cond |
2884 ;; This summary buffer exists already, so we just select it. | |
2885 ((not new-group) | |
2886 (gnus-set-global-variables) | |
2887 (when kill-buffer | |
2888 (gnus-kill-or-deaden-summary kill-buffer)) | |
2889 (gnus-configure-windows 'summary 'force) | |
2890 (gnus-set-mode-line 'summary) | |
2891 (gnus-summary-position-point) | |
2892 (message "") | |
2893 t) | |
2894 ;; We couldn't select this group. | |
2895 ((null did-select) | |
2896 (when (and (eq major-mode 'gnus-summary-mode) | |
2897 (not (equal (current-buffer) kill-buffer))) | |
2898 (kill-buffer (current-buffer)) | |
2899 (if (not quit-config) | |
2900 (progn | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2901 ;; 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
|
2902 ;; for instance. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2903 (gnus-summary-update-info) |
17493 | 2904 (set-buffer gnus-group-buffer) |
2905 (gnus-group-jump-to-group group) | |
2906 (gnus-group-next-unread-group 1)) | |
2907 (gnus-handle-ephemeral-exit quit-config))) | |
2908 (gnus-message 3 "Can't select group") | |
2909 nil) | |
2910 ;; The user did a `C-g' while prompting for number of articles, | |
2911 ;; so we exit this group. | |
2912 ((eq did-select 'quit) | |
2913 (and (eq major-mode 'gnus-summary-mode) | |
2914 (not (equal (current-buffer) kill-buffer)) | |
2915 (kill-buffer (current-buffer))) | |
2916 (when kill-buffer | |
2917 (gnus-kill-or-deaden-summary kill-buffer)) | |
2918 (if (not quit-config) | |
2919 (progn | |
2920 (set-buffer gnus-group-buffer) | |
2921 (gnus-group-jump-to-group group) | |
2922 (gnus-group-next-unread-group 1) | |
2923 (gnus-configure-windows 'group 'force)) | |
2924 (gnus-handle-ephemeral-exit quit-config)) | |
2925 ;; Finally signal the quit. | |
2926 (signal 'quit nil)) | |
2927 ;; The group was successfully selected. | |
2928 (t | |
2929 (gnus-set-global-variables) | |
2930 ;; Save the active value in effect when the group was entered. | |
2931 (setq gnus-newsgroup-active | |
2932 (gnus-copy-sequence | |
2933 (gnus-active gnus-newsgroup-name))) | |
2934 ;; 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
|
2935 (gnus-run-hooks 'gnus-select-group-hook) |
17493 | 2936 ;; Set any local variables in the group parameters. |
2937 (gnus-summary-set-local-parameters gnus-newsgroup-name) | |
2938 (gnus-update-format-specifications | |
2939 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
|
2940 (gnus-update-summary-mark-positions) |
17493 | 2941 ;; Do score processing. |
2942 (when gnus-use-scoring | |
2943 (gnus-possibly-score-headers)) | |
2944 ;; Check whether to fill in the gaps in the threads. | |
2945 (when gnus-build-sparse-threads | |
2946 (gnus-build-sparse-threads)) | |
2947 ;; Find the initial limit. | |
2948 (if gnus-show-threads | |
2949 (if show-all | |
2950 (let ((gnus-newsgroup-dormant nil)) | |
2951 (gnus-summary-initial-limit show-all)) | |
2952 (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
|
2953 ;; When untreaded, all articles are always shown. |
17493 | 2954 (setq gnus-newsgroup-limit |
2955 (mapcar | |
2956 (lambda (header) (mail-header-number header)) | |
2957 gnus-newsgroup-headers))) | |
2958 ;; Generate the summary buffer. | |
2959 (unless no-display | |
2960 (gnus-summary-prepare)) | |
2961 (when gnus-use-trees | |
2962 (gnus-tree-open group) | |
2963 (setq gnus-summary-highlight-line-function | |
2964 'gnus-tree-highlight-article)) | |
2965 ;; If the summary buffer is empty, but there are some low-scored | |
2966 ;; articles or some excluded dormants, we include these in the | |
2967 ;; buffer. | |
2968 (when (and (zerop (buffer-size)) | |
2969 (not no-display)) | |
2970 (cond (gnus-newsgroup-dormant | |
2971 (gnus-summary-limit-include-dormant)) | |
2972 ((and gnus-newsgroup-scored show-all) | |
2973 (gnus-summary-limit-include-expunged t)))) | |
2974 ;; 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
|
2975 (gnus-run-hooks 'gnus-apply-kill-hook) |
17493 | 2976 (if (and (zerop (buffer-size)) |
2977 (not no-display)) | |
2978 (progn | |
2979 ;; This newsgroup is empty. | |
2980 (gnus-summary-catchup-and-exit nil t) | |
2981 (gnus-message 6 "No unread news") | |
2982 (when kill-buffer | |
2983 (gnus-kill-or-deaden-summary kill-buffer)) | |
2984 ;; Return nil from this function. | |
2985 nil) | |
2986 ;; Hide conversation thread subtrees. We cannot do this in | |
2987 ;; gnus-summary-prepare-hook since kill processing may not | |
2988 ;; work with hidden articles. | |
2989 (and gnus-show-threads | |
2990 gnus-thread-hide-subtree | |
2991 (gnus-summary-hide-all-threads)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2992 (when kill-buffer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
2993 (gnus-kill-or-deaden-summary kill-buffer)) |
17493 | 2994 ;; Show first unread article if requested. |
2995 (if (and (not no-article) | |
2996 (not no-display) | |
2997 gnus-newsgroup-unreads | |
2998 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
|
2999 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3000 (gnus-configure-windows 'summary) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3001 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3002 ((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
|
3003 (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
|
3004 ((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
|
3005 (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
|
3006 ((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
|
3007 (funcall gnus-auto-select-first)))) |
17493 | 3008 ;; Don't select any articles, just move point to the first |
3009 ;; article in the group. | |
3010 (goto-char (point-min)) | |
3011 (gnus-summary-position-point) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3012 (gnus-configure-windows 'summary 'force) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3013 (gnus-set-mode-line 'summary)) |
17493 | 3014 (when (get-buffer-window gnus-group-buffer t) |
3015 ;; Gotta use windows, because recenter does weird stuff if | |
3016 ;; the current buffer ain't the displayed window. | |
3017 (let ((owin (selected-window))) | |
3018 (select-window (get-buffer-window gnus-group-buffer t)) | |
3019 (when (gnus-group-goto-group group) | |
3020 (recenter)) | |
3021 (select-window owin))) | |
3022 ;; Mark this buffer as "prepared". | |
3023 (setq gnus-newsgroup-prepared t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3024 (gnus-run-hooks 'gnus-summary-prepared-hook) |
17493 | 3025 t))))) |
3026 | |
3027 (defun gnus-summary-prepare () | |
3028 "Generate the summary buffer." | |
3029 (interactive) | |
3030 (let ((buffer-read-only nil)) | |
3031 (erase-buffer) | |
3032 (setq gnus-newsgroup-data nil | |
3033 gnus-newsgroup-data-reverse nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3034 (gnus-run-hooks 'gnus-summary-generate-hook) |
17493 | 3035 ;; Generate the buffer, either with threads or without. |
3036 (when gnus-newsgroup-headers | |
3037 (gnus-summary-prepare-threads | |
3038 (if gnus-show-threads | |
3039 (gnus-sort-gathered-threads | |
3040 (funcall gnus-summary-thread-gathering-function | |
3041 (gnus-sort-threads | |
3042 (gnus-cut-threads (gnus-make-threads))))) | |
3043 ;; Unthreaded display. | |
3044 (gnus-sort-articles gnus-newsgroup-headers)))) | |
3045 (setq gnus-newsgroup-data (nreverse gnus-newsgroup-data)) | |
3046 ;; Call hooks for modifying summary buffer. | |
3047 (goto-char (point-min)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3048 (gnus-run-hooks 'gnus-summary-prepare-hook))) |
17493 | 3049 |
3050 (defsubst gnus-general-simplify-subject (subject) | |
3051 "Simply subject by the same rules as gnus-gather-threads-by-subject." | |
3052 (setq subject | |
3053 (cond | |
3054 ;; Truncate the subject. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3055 (gnus-simplify-subject-functions |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3056 (gnus-map-function gnus-simplify-subject-functions subject)) |
17493 | 3057 ((numberp gnus-summary-gather-subject-limit) |
3058 (setq subject (gnus-simplify-subject-re subject)) | |
3059 (if (> (length subject) gnus-summary-gather-subject-limit) | |
3060 (substring subject 0 gnus-summary-gather-subject-limit) | |
3061 subject)) | |
3062 ;; Fuzzily simplify it. | |
3063 ((eq 'fuzzy gnus-summary-gather-subject-limit) | |
3064 (gnus-simplify-subject-fuzzy subject)) | |
3065 ;; Just remove the leading "Re:". | |
3066 (t | |
3067 (gnus-simplify-subject-re subject)))) | |
3068 | |
3069 (if (and gnus-summary-gather-exclude-subject | |
3070 (string-match gnus-summary-gather-exclude-subject subject)) | |
3071 nil ; This article shouldn't be gathered | |
3072 subject)) | |
3073 | |
3074 (defun gnus-summary-simplify-subject-query () | |
3075 "Query where the respool algorithm would put this article." | |
3076 (interactive) | |
3077 (gnus-summary-select-article) | |
3078 (message (gnus-general-simplify-subject (gnus-summary-article-subject)))) | |
3079 | |
3080 (defun gnus-gather-threads-by-subject (threads) | |
3081 "Gather threads by looking at Subject headers." | |
3082 (if (not gnus-summary-make-false-root) | |
3083 threads | |
3084 (let ((hashtb (gnus-make-hashtable 1024)) | |
3085 (prev threads) | |
3086 (result threads) | |
3087 subject hthread whole-subject) | |
3088 (while threads | |
3089 (setq subject (gnus-general-simplify-subject | |
3090 (setq whole-subject (mail-header-subject | |
3091 (caar threads))))) | |
3092 (when subject | |
3093 (if (setq hthread (gnus-gethash subject hashtb)) | |
3094 (progn | |
3095 ;; We enter a dummy root into the thread, if we | |
3096 ;; haven't done that already. | |
3097 (unless (stringp (caar hthread)) | |
3098 (setcar hthread (list whole-subject (car hthread)))) | |
3099 ;; We add this new gathered thread to this gathered | |
3100 ;; thread. | |
3101 (setcdr (car hthread) | |
3102 (nconc (cdar hthread) (list (car threads)))) | |
3103 ;; Remove it from the list of threads. | |
3104 (setcdr prev (cdr threads)) | |
3105 (setq threads prev)) | |
3106 ;; Enter this thread into the hash table. | |
3107 (gnus-sethash subject threads hashtb))) | |
3108 (setq prev threads) | |
3109 (setq threads (cdr threads))) | |
3110 result))) | |
3111 | |
3112 (defun gnus-gather-threads-by-references (threads) | |
3113 "Gather threads by looking at References headers." | |
3114 (let ((idhashtb (gnus-make-hashtable 1024)) | |
3115 (thhashtb (gnus-make-hashtable 1024)) | |
3116 (prev threads) | |
3117 (result threads) | |
3118 ids references id gthread gid entered ref) | |
3119 (while threads | |
3120 (when (setq references (mail-header-references (caar threads))) | |
3121 (setq id (mail-header-id (caar threads)) | |
3122 ids (gnus-split-references references) | |
3123 entered nil) | |
3124 (while (setq ref (pop ids)) | |
3125 (setq ids (delete ref ids)) | |
3126 (if (not (setq gid (gnus-gethash ref idhashtb))) | |
3127 (progn | |
3128 (gnus-sethash ref id idhashtb) | |
3129 (gnus-sethash id threads thhashtb)) | |
3130 (setq gthread (gnus-gethash gid thhashtb)) | |
3131 (unless entered | |
3132 ;; We enter a dummy root into the thread, if we | |
3133 ;; haven't done that already. | |
3134 (unless (stringp (caar gthread)) | |
3135 (setcar gthread (list (mail-header-subject (caar gthread)) | |
3136 (car gthread)))) | |
3137 ;; We add this new gathered thread to this gathered | |
3138 ;; thread. | |
3139 (setcdr (car gthread) | |
3140 (nconc (cdar gthread) (list (car threads))))) | |
3141 ;; Add it into the thread hash table. | |
3142 (gnus-sethash id gthread thhashtb) | |
3143 (setq entered t) | |
3144 ;; Remove it from the list of threads. | |
3145 (setcdr prev (cdr threads)) | |
3146 (setq threads prev)))) | |
3147 (setq prev threads) | |
3148 (setq threads (cdr threads))) | |
3149 result)) | |
3150 | |
3151 (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
|
3152 "Sort subtreads inside each gathered thread by `gnus-sort-gathered-threads-function'." |
17493 | 3153 (let ((result threads)) |
3154 (while threads | |
3155 (when (stringp (caar threads)) | |
3156 (setcdr (car threads) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3157 (sort (cdar threads) gnus-sort-gathered-threads-function))) |
17493 | 3158 (setq threads (cdr threads))) |
3159 result)) | |
3160 | |
3161 (defun gnus-thread-loop-p (root thread) | |
3162 "Say whether ROOT is in THREAD." | |
3163 (let ((stack (list thread)) | |
3164 (infloop 0) | |
3165 th) | |
3166 (while (setq thread (pop stack)) | |
3167 (setq th (cdr thread)) | |
3168 (while (and th | |
3169 (not (eq (caar th) root))) | |
3170 (pop th)) | |
3171 (if th | |
3172 ;; We have found a loop. | |
3173 (let (ref-dep) | |
3174 (setcdr thread (delq (car th) (cdr thread))) | |
3175 (if (boundp (setq ref-dep (intern "none" | |
3176 gnus-newsgroup-dependencies))) | |
3177 (setcdr (symbol-value ref-dep) | |
3178 (nconc (cdr (symbol-value ref-dep)) | |
3179 (list (car th)))) | |
3180 (set ref-dep (list nil (car th)))) | |
3181 (setq infloop 1 | |
3182 stack nil)) | |
3183 ;; Push all the subthreads onto the stack. | |
3184 (push (cdr thread) stack))) | |
3185 infloop)) | |
3186 | |
3187 (defun gnus-make-threads () | |
3188 "Go through the dependency hashtb and find the roots. Return all threads." | |
3189 (let (threads) | |
3190 (while (catch 'infloop | |
3191 (mapatoms | |
3192 (lambda (refs) | |
3193 ;; Deal with self-referencing References loops. | |
3194 (when (and (car (symbol-value refs)) | |
3195 (not (zerop | |
3196 (apply | |
3197 '+ | |
3198 (mapcar | |
3199 (lambda (thread) | |
3200 (gnus-thread-loop-p | |
3201 (car (symbol-value refs)) thread)) | |
3202 (cdr (symbol-value refs))))))) | |
3203 (setq threads nil) | |
3204 (throw 'infloop t)) | |
3205 (unless (car (symbol-value refs)) | |
3206 ;; These threads do not refer back to any other articles, | |
3207 ;; so they're roots. | |
3208 (setq threads (append (cdr (symbol-value refs)) threads)))) | |
3209 gnus-newsgroup-dependencies))) | |
3210 threads)) | |
3211 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3212 ;; 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
|
3213 (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
|
3214 "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
|
3215 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3216 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
|
3217 if it was already present. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3218 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3219 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
|
3220 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
|
3221 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
|
3222 being entered. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3223 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3224 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
|
3225 (let* ((id (mail-header-id header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3226 (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
|
3227 ref ref-dep ref-header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3228 ;; 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
|
3229 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3230 ((not id-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3231 (setq header nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3232 ;; 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
|
3233 ;; in the `dependencies' table. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3234 ((not (boundp id-dep)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3235 (set id-dep (list header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3236 ((null (car (symbol-value id-dep))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3237 (setcar (symbol-value id-dep) header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3238 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3239 ;; 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
|
3240 ;; `dependencies' table. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3241 (force-new |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3242 ;; Overrides an existing entry; |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3243 ;; 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
|
3244 (setcar (symbol-value id-dep) header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3245 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3246 ;; 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
|
3247 ((not gnus-summary-ignore-duplicates) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3248 ;; 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
|
3249 ;; We rename the Message-ID. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3250 (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
|
3251 (list header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3252 (mail-header-set-id header id)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3253 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3254 ;; 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
|
3255 ;; 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
|
3256 ;; servers. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3257 ;; 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
|
3258 ;; table was *not* modified. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3259 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3260 (mail-header-set-xref |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3261 (car (symbol-value id-dep)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3262 (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
|
3263 "") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3264 (or (mail-header-xref header) ""))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3265 (setq header nil))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3266 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3267 (when header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3268 ;; 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
|
3269 (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
|
3270 (while (and ref |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3271 (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
|
3272 (boundp ref-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3273 (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
|
3274 (if (string= id ref) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3275 ;; 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
|
3276 ;; root article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3277 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3278 (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
|
3279 (setq ref nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3280 (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
|
3281 (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
|
3282 (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
|
3283 (if (boundp ref-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3284 (setcdr (symbol-value ref-dep) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3285 (nconc (cdr (symbol-value ref-dep)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3286 (list (symbol-value id-dep)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3287 (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
|
3288 header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3289 |
17493 | 3290 (defun gnus-build-sparse-threads () |
3291 (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
|
3292 (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
|
3293 (gnus-summary-ignore-duplicates t) |
17493 | 3294 header references generation relations |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3295 subject child end new-child date) |
17493 | 3296 ;; First we create an alist of generations/relations, where |
3297 ;; generations is how much we trust the relation, and the relation | |
3298 ;; is parent/child. | |
3299 (gnus-message 7 "Making sparse threads...") | |
3300 (save-excursion | |
3301 (nnheader-set-temp-buffer " *gnus sparse threads*") | |
3302 (while (setq header (pop headers)) | |
3303 (when (and (setq references (mail-header-references header)) | |
3304 (not (string= references ""))) | |
3305 (insert references) | |
3306 (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
|
3307 subject (mail-header-subject header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3308 date (mail-header-date header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3309 generation 0) |
17493 | 3310 (while (search-backward ">" nil t) |
3311 (setq end (1+ (point))) | |
3312 (when (search-backward "<" nil t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3313 (setq new-child (buffer-substring (point) end)) |
17493 | 3314 (push (list (incf generation) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3315 child (setq child new-child) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3316 subject date) |
17493 | 3317 relations))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3318 (when child |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3319 (push (list (1+ generation) child nil subject) relations)) |
17493 | 3320 (erase-buffer))) |
3321 (kill-buffer (current-buffer))) | |
3322 ;; Sort over trustworthiness. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3323 (mapcar |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3324 (lambda (relation) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3325 (when (gnus-dependencies-add-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3326 (make-full-mail-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3327 gnus-reffed-article-number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3328 (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
|
3329 (nth 1 relation) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3330 (or (nth 2 relation) "") 0 0 "") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3331 gnus-newsgroup-dependencies nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3332 (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
|
3333 (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
|
3334 (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
|
3335 gnus-newsgroup-reads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3336 (decf gnus-reffed-article-number))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3337 (sort relations 'car-less-than-car)) |
17493 | 3338 (gnus-message 7 "Making sparse threads...done"))) |
3339 | |
3340 (defun gnus-build-old-threads () | |
3341 ;; Look at all the articles that refer back to old articles, and | |
3342 ;; fetch the headers for the articles that aren't there. This will | |
3343 ;; build complete threads - if the roots haven't been expired by the | |
3344 ;; server, that is. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3345 (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
|
3346 id heads) |
17493 | 3347 (mapatoms |
3348 (lambda (refs) | |
3349 (when (not (car (symbol-value refs))) | |
3350 (setq heads (cdr (symbol-value refs))) | |
3351 (while heads | |
3352 (if (memq (mail-header-number (caar heads)) | |
3353 gnus-newsgroup-dormant) | |
3354 (setq heads (cdr heads)) | |
3355 (setq id (symbol-name refs)) | |
3356 (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
|
3357 (not (car (gnus-id-to-thread id))))) |
17493 | 3358 (setq heads nil))))) |
3359 gnus-newsgroup-dependencies))) | |
3360 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3361 ;; 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
|
3362 ;; on the beginning of the line. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3363 (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
|
3364 (let ((eol (gnus-point-at-eol)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3365 (buffer (current-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3366 header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3367 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3368 ;; 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
|
3369 (unwind-protect |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3370 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3371 (narrow-to-region (point) eol) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3372 (unless (eobp) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3373 (forward-char)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3374 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3375 (setq header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3376 (make-full-mail-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3377 number ; number |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3378 (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
|
3379 (nnheader-nov-field)) ; subject |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3380 (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
|
3381 (nnheader-nov-field)) ; from |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3382 (nnheader-nov-field) ; date |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3383 (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
|
3384 (nnheader-nov-field) ; refs |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3385 (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
|
3386 (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
|
3387 (unless (eobp) |
31785 | 3388 (if (looking-at "Xref: ") |
3389 (goto-char (match-end 0))) | |
3390 (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
|
3391 (nnheader-nov-parse-extra)))) ; extra |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3392 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3393 (widen)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3394 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3395 (when gnus-alter-header-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3396 (funcall gnus-alter-header-function header)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3397 (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
|
3398 |
17493 | 3399 (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
|
3400 "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
|
3401 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
|
3402 the id of the parent article (if any)." |
17493 | 3403 (let ((deps gnus-newsgroup-dependencies) |
3404 found header) | |
3405 (prog1 | |
3406 (save-excursion | |
3407 (set-buffer nntp-server-buffer) | |
3408 (let ((case-fold-search nil)) | |
3409 (goto-char (point-min)) | |
3410 (while (and (not found) | |
3411 (search-forward id nil t)) | |
3412 (beginning-of-line) | |
3413 (setq found (looking-at | |
3414 (format "^[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t%s" | |
3415 (regexp-quote id)))) | |
3416 (or found (beginning-of-line 2))) | |
3417 (when found | |
3418 (beginning-of-line) | |
3419 (and | |
3420 (setq header (gnus-nov-parse-line | |
3421 (read (current-buffer)) deps)) | |
3422 (gnus-parent-id (mail-header-references header)))))) | |
3423 (when header | |
3424 (let ((number (mail-header-number header))) | |
3425 (push number gnus-newsgroup-limit) | |
3426 (push header gnus-newsgroup-headers) | |
3427 (if (memq number gnus-newsgroup-unselected) | |
3428 (progn | |
3429 (push number gnus-newsgroup-unreads) | |
3430 (setq gnus-newsgroup-unselected | |
3431 (delq number gnus-newsgroup-unselected))) | |
3432 (push number gnus-newsgroup-ancient))))))) | |
3433 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3434 (defun gnus-build-all-threads () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3435 "Read all the headers." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3436 (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
|
3437 (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
|
3438 (dependencies gnus-newsgroup-dependencies) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3439 header article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3440 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3441 (set-buffer nntp-server-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3442 (let ((case-fold-search nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3443 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3444 (while (not (eobp)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3445 (ignore-errors |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3446 (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
|
3447 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
|
3448 (when header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3449 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3450 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3451 (push header gnus-newsgroup-headers) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3452 (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
|
3453 gnus-newsgroup-unselected) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3454 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3455 (push article gnus-newsgroup-unreads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3456 (setq gnus-newsgroup-unselected |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3457 (delq article gnus-newsgroup-unselected))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3458 (push article gnus-newsgroup-ancient))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3459 (forward-line 1))))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3460 |
17493 | 3461 (defun gnus-summary-update-article-line (article header) |
3462 "Update the line for ARTICLE using HEADERS." | |
3463 (let* ((id (mail-header-id header)) | |
3464 (thread (gnus-id-to-thread id))) | |
3465 (unless thread | |
3466 (error "Article in no thread")) | |
3467 ;; Update the thread. | |
3468 (setcar thread header) | |
3469 (gnus-summary-goto-subject article) | |
3470 (let* ((datal (gnus-data-find-list article)) | |
3471 (data (car datal)) | |
3472 (length (when (cdr datal) | |
3473 (- (gnus-data-pos data) | |
3474 (gnus-data-pos (cadr datal))))) | |
3475 (buffer-read-only nil) | |
3476 (level (gnus-summary-thread-level))) | |
3477 (gnus-delete-line) | |
3478 (gnus-summary-insert-line | |
3479 header level nil (gnus-article-mark article) | |
3480 (memq article gnus-newsgroup-replied) | |
3481 (memq article gnus-newsgroup-expirable) | |
3482 ;; Only insert the Subject string when it's different | |
3483 ;; 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
|
3484 (if (and |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3485 gnus-show-threads |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3486 (gnus-subject-equal |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3487 (condition-case () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3488 (mail-header-subject |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3489 (gnus-data-header |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3490 (cadr |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3491 (gnus-data-find-list |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3492 article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3493 (gnus-data-list t))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3494 ;; 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
|
3495 (error "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3496 (mail-header-subject header))) |
17493 | 3497 "" |
3498 (mail-header-subject header)) | |
3499 nil (cdr (assq article gnus-newsgroup-scored)) | |
3500 (memq article gnus-newsgroup-processable)) | |
3501 (when length | |
3502 (gnus-data-update-list | |
3503 (cdr datal) (- length (- (gnus-data-pos data) (point)))))))) | |
3504 | |
3505 (defun gnus-summary-update-article (article &optional iheader) | |
3506 "Update ARTICLE in the summary buffer." | |
3507 (set-buffer gnus-summary-buffer) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3508 (let* ((header (gnus-summary-article-header article)) |
17493 | 3509 (id (mail-header-id header)) |
3510 (data (gnus-data-find article)) | |
3511 (thread (gnus-id-to-thread id)) | |
3512 (references (mail-header-references header)) | |
3513 (parent | |
3514 (gnus-id-to-thread | |
3515 (or (gnus-parent-id | |
3516 (when (and references | |
3517 (not (equal "" references))) | |
3518 references)) | |
3519 "none"))) | |
3520 (buffer-read-only nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3521 (old (car thread))) |
17493 | 3522 (when thread |
3523 (unless iheader | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3524 (setcar thread nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3525 (when parent |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3526 (delq thread parent))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3527 (if (gnus-summary-insert-subject id header) |
17493 | 3528 ;; Set the (possibly) new article number in the data structure. |
3529 (gnus-data-set-number data (gnus-id-to-article id)) | |
3530 (setcar thread old) | |
3531 nil)))) | |
3532 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3533 (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
|
3534 "Rebuild the thread containing ID. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3535 If LINE, insert the rebuilt thread starting on line LINE." |
17493 | 3536 (let ((buffer-read-only nil) |
3537 old-pos current thread data) | |
3538 (if (not gnus-show-threads) | |
3539 (setq thread (list (car (gnus-id-to-thread id)))) | |
3540 ;; Get the thread this article is part of. | |
3541 (setq thread (gnus-remove-thread id))) | |
3542 (setq old-pos (gnus-point-at-bol)) | |
3543 (setq current (save-excursion | |
3544 (and (zerop (forward-line -1)) | |
3545 (gnus-summary-article-number)))) | |
3546 ;; If this is a gathered thread, we have to go some re-gathering. | |
3547 (when (stringp (car thread)) | |
3548 (let ((subject (car thread)) | |
3549 roots thr) | |
3550 (setq thread (cdr thread)) | |
3551 (while thread | |
3552 (unless (memq (setq thr (gnus-id-to-thread | |
3553 (gnus-root-id | |
3554 (mail-header-id (caar thread))))) | |
3555 roots) | |
3556 (push thr roots)) | |
3557 (setq thread (cdr thread))) | |
3558 ;; We now have all (unique) roots. | |
3559 (if (= (length roots) 1) | |
3560 ;; All the loose roots are now one solid root. | |
3561 (setq thread (car roots)) | |
3562 (setq thread (cons subject (gnus-sort-threads roots)))))) | |
3563 (let (threads) | |
3564 ;; 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
|
3565 (when line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3566 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3567 (forward-line (1- line))) |
17493 | 3568 (let (gnus-newsgroup-data gnus-newsgroup-threads) |
3569 (if gnus-show-threads | |
3570 (gnus-summary-prepare-threads (gnus-cut-threads (list thread))) | |
3571 (gnus-summary-prepare-unthreaded thread)) | |
3572 (setq data (nreverse gnus-newsgroup-data)) | |
3573 (setq threads gnus-newsgroup-threads)) | |
3574 ;; 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
|
3575 ;;!!! 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
|
3576 ;;!!! 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
|
3577 ;;!!! 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
|
3578 ;;!!! change in the future. Perhaps. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3579 (gnus-data-enter-list |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3580 (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
|
3581 (setq gnus-newsgroup-threads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3582 (nconc threads gnus-newsgroup-threads)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3583 (gnus-data-compute-positions)))) |
17493 | 3584 |
3585 (defun gnus-number-to-header (number) | |
3586 "Return the header for article NUMBER." | |
3587 (let ((headers gnus-newsgroup-headers)) | |
3588 (while (and headers | |
3589 (not (= number (mail-header-number (car headers))))) | |
3590 (pop headers)) | |
3591 (when headers | |
3592 (car headers)))) | |
3593 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3594 (defun gnus-parent-headers (in-headers &optional generation) |
17493 | 3595 "Return the headers of the GENERATIONeth parent of HEADERS." |
3596 (unless generation | |
3597 (setq generation 1)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
3598 (let ((parent t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3599 (headers in-headers) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
3600 references) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3601 (while (and parent |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3602 (not (zerop generation)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3603 (setq references (mail-header-references headers))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3604 (setq headers (if (and references |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3605 (setq parent (gnus-parent-id references))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3606 (car (gnus-id-to-thread parent)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3607 nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3608 (decf generation)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3609 (and (not (eq headers in-headers)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3610 headers))) |
17493 | 3611 |
3612 (defun gnus-id-to-thread (id) | |
3613 "Return the (sub-)thread where ID appears." | |
3614 (gnus-gethash id gnus-newsgroup-dependencies)) | |
3615 | |
3616 (defun gnus-id-to-article (id) | |
3617 "Return the article number of ID." | |
3618 (let ((thread (gnus-id-to-thread id))) | |
3619 (when (and thread | |
3620 (car thread)) | |
3621 (mail-header-number (car thread))))) | |
3622 | |
3623 (defun gnus-id-to-header (id) | |
3624 "Return the article headers of ID." | |
3625 (car (gnus-id-to-thread id))) | |
3626 | |
3627 (defun gnus-article-displayed-root-p (article) | |
3628 "Say whether ARTICLE is a root(ish) article." | |
3629 (let ((level (gnus-summary-thread-level article)) | |
3630 (refs (mail-header-references (gnus-summary-article-header article))) | |
3631 particle) | |
3632 (cond | |
3633 ((null level) nil) | |
3634 ((zerop level) t) | |
3635 ((null refs) t) | |
3636 ((null (gnus-parent-id refs)) t) | |
3637 ((and (= 1 level) | |
3638 (null (setq particle (gnus-id-to-article | |
3639 (gnus-parent-id refs)))) | |
3640 (null (gnus-summary-thread-level particle))))))) | |
3641 | |
3642 (defun gnus-root-id (id) | |
3643 "Return the id of the root of the thread where ID appears." | |
3644 (let (last-id prev) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3645 (while (and id (setq prev (car (gnus-id-to-thread id)))) |
17493 | 3646 (setq last-id id |
3647 id (gnus-parent-id (mail-header-references prev)))) | |
3648 last-id)) | |
3649 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3650 (defun gnus-articles-in-thread (thread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3651 "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
|
3652 (cons (mail-header-number (car thread)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3653 (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
|
3654 |
17493 | 3655 (defun gnus-remove-thread (id &optional dont-remove) |
3656 "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
|
3657 (let (headers thread last-id) |
17493 | 3658 ;; 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
|
3659 (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
|
3660 headers (message-flatten-list (gnus-id-to-thread last-id))) |
17493 | 3661 ;; We have now found the real root of this thread. It might have |
3662 ;; been gathered into some loose thread, so we have to search | |
3663 ;; through the threads to find the thread we wanted. | |
3664 (let ((threads gnus-newsgroup-threads) | |
3665 sub) | |
3666 (while threads | |
3667 (setq sub (car threads)) | |
3668 (if (stringp (car sub)) | |
3669 ;; This is a gathered thread, so we look at the roots | |
3670 ;; below it to find whether this article is in this | |
3671 ;; gathered root. | |
3672 (progn | |
3673 (setq sub (cdr sub)) | |
3674 (while sub | |
3675 (when (member (caar sub) headers) | |
3676 (setq thread (car threads) | |
3677 threads nil | |
3678 sub nil)) | |
3679 (setq sub (cdr sub)))) | |
3680 ;; It's an ordinary thread, so we check it. | |
3681 (when (eq (car sub) (car headers)) | |
3682 (setq thread sub | |
3683 threads nil))) | |
3684 (setq threads (cdr threads))) | |
3685 ;; If this article is in no thread, then it's a root. | |
3686 (if thread | |
3687 (unless dont-remove | |
3688 (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
|
3689 (setq thread (gnus-id-to-thread last-id))) |
17493 | 3690 (when thread |
3691 (prog1 | |
3692 thread ; We return this thread. | |
3693 (unless dont-remove | |
3694 (if (stringp (car thread)) | |
3695 (progn | |
3696 ;; If we use dummy roots, then we have to remove the | |
3697 ;; dummy root as well. | |
3698 (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
|
3699 ;; 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
|
3700 ;; 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
|
3701 (gnus-summary-goto-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3702 (mail-header-number (caadr thread))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3703 (forward-line -1) |
17493 | 3704 (gnus-delete-line) |
3705 (gnus-data-compute-positions)) | |
3706 (setq thread (cdr thread)) | |
3707 (while thread | |
3708 (gnus-remove-thread-1 (car thread)) | |
3709 (setq thread (cdr thread)))) | |
3710 (gnus-remove-thread-1 thread)))))))) | |
3711 | |
3712 (defun gnus-remove-thread-1 (thread) | |
3713 "Remove the thread THREAD recursively." | |
3714 (let ((number (mail-header-number (pop thread))) | |
3715 d) | |
3716 (setq thread (reverse thread)) | |
3717 (while thread | |
3718 (gnus-remove-thread-1 (pop thread))) | |
3719 (when (setq d (gnus-data-find number)) | |
3720 (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
|
3721 (gnus-summary-show-thread) |
17493 | 3722 (gnus-data-remove |
3723 number | |
3724 (- (gnus-point-at-bol) | |
3725 (prog1 | |
3726 (1+ (gnus-point-at-eol)) | |
3727 (gnus-delete-line))))))) | |
3728 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3729 (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
|
3730 (sort (mapcar (lambda (thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3731 (cons (car thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3732 (and (cdr thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3733 (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
|
3734 threads) func)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3735 |
17493 | 3736 (defun gnus-sort-threads (threads) |
3737 "Sort THREADS." | |
3738 (if (not gnus-thread-sort-functions) | |
3739 threads | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3740 (gnus-message 8 "Sorting threads...") |
17493 | 3741 (prog1 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3742 (gnus-sort-threads-1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3743 threads |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3744 (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
|
3745 (gnus-message 8 "Sorting threads...done")))) |
17493 | 3746 |
3747 (defun gnus-sort-articles (articles) | |
3748 "Sort ARTICLES." | |
3749 (when gnus-article-sort-functions | |
3750 (gnus-message 7 "Sorting articles...") | |
3751 (prog1 | |
3752 (setq gnus-newsgroup-headers | |
3753 (sort articles (gnus-make-sort-function | |
3754 gnus-article-sort-functions))) | |
3755 (gnus-message 7 "Sorting articles...done")))) | |
3756 | |
3757 ;; Written by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>. | |
3758 (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
|
3759 "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
|
3760 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
|
3761 using some other form will lead to serious barfage." |
17493 | 3762 (or (symbolp thread) (signal 'wrong-type-argument '(symbolp thread))) |
3763 ;; (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
|
3764 (list 'byte-code "\10\211:\203\17\0\211@;\203\16\0A@@\207" |
17493 | 3765 (vector thread) 2)) |
3766 | |
3767 (defsubst gnus-article-sort-by-number (h1 h2) | |
3768 "Sort articles by article number." | |
3769 (< (mail-header-number h1) | |
3770 (mail-header-number h2))) | |
3771 | |
3772 (defun gnus-thread-sort-by-number (h1 h2) | |
3773 "Sort threads by root article number." | |
3774 (gnus-article-sort-by-number | |
3775 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3776 | |
3777 (defsubst gnus-article-sort-by-lines (h1 h2) | |
3778 "Sort articles by article Lines header." | |
3779 (< (mail-header-lines h1) | |
3780 (mail-header-lines h2))) | |
3781 | |
3782 (defun gnus-thread-sort-by-lines (h1 h2) | |
3783 "Sort threads by root article Lines header." | |
3784 (gnus-article-sort-by-lines | |
3785 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3786 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3787 (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
|
3788 "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
|
3789 (< (mail-header-chars h1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3790 (mail-header-chars h2))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3791 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3792 (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
|
3793 "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
|
3794 (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
|
3795 (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
|
3796 |
17493 | 3797 (defsubst gnus-article-sort-by-author (h1 h2) |
3798 "Sort articles by root author." | |
3799 (string-lessp | |
3800 (let ((extract (funcall | |
3801 gnus-extract-address-components | |
3802 (mail-header-from h1)))) | |
3803 (or (car extract) (cadr extract) "")) | |
3804 (let ((extract (funcall | |
3805 gnus-extract-address-components | |
3806 (mail-header-from h2)))) | |
3807 (or (car extract) (cadr extract) "")))) | |
3808 | |
3809 (defun gnus-thread-sort-by-author (h1 h2) | |
3810 "Sort threads by root author." | |
3811 (gnus-article-sort-by-author | |
3812 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3813 | |
3814 (defsubst gnus-article-sort-by-subject (h1 h2) | |
3815 "Sort articles by root subject." | |
3816 (string-lessp | |
3817 (downcase (gnus-simplify-subject-re (mail-header-subject h1))) | |
3818 (downcase (gnus-simplify-subject-re (mail-header-subject h2))))) | |
3819 | |
3820 (defun gnus-thread-sort-by-subject (h1 h2) | |
3821 "Sort threads by root subject." | |
3822 (gnus-article-sort-by-subject | |
3823 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3824 | |
3825 (defsubst gnus-article-sort-by-date (h1 h2) | |
3826 "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
|
3827 (time-less-p |
17493 | 3828 (gnus-date-get-time (mail-header-date h1)) |
3829 (gnus-date-get-time (mail-header-date h2)))) | |
3830 | |
3831 (defun gnus-thread-sort-by-date (h1 h2) | |
3832 "Sort threads by root article date." | |
3833 (gnus-article-sort-by-date | |
3834 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3835 | |
3836 (defsubst gnus-article-sort-by-score (h1 h2) | |
3837 "Sort articles by root article score. | |
3838 Unscored articles will be counted as having a score of zero." | |
3839 (> (or (cdr (assq (mail-header-number h1) | |
3840 gnus-newsgroup-scored)) | |
3841 gnus-summary-default-score 0) | |
3842 (or (cdr (assq (mail-header-number h2) | |
3843 gnus-newsgroup-scored)) | |
3844 gnus-summary-default-score 0))) | |
3845 | |
3846 (defun gnus-thread-sort-by-score (h1 h2) | |
3847 "Sort threads by root article score." | |
3848 (gnus-article-sort-by-score | |
3849 (gnus-thread-header h1) (gnus-thread-header h2))) | |
3850 | |
3851 (defun gnus-thread-sort-by-total-score (h1 h2) | |
3852 "Sort threads by the sum of all scores in the thread. | |
3853 Unscored articles will be counted as having a score of zero." | |
3854 (> (gnus-thread-total-score h1) (gnus-thread-total-score h2))) | |
3855 | |
3856 (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
|
3857 ;; This function find the total score of THREAD. |
17493 | 3858 (cond ((null thread) |
3859 0) | |
3860 ((consp thread) | |
3861 (if (stringp (car thread)) | |
3862 (apply gnus-thread-score-function 0 | |
3863 (mapcar 'gnus-thread-total-score-1 (cdr thread))) | |
3864 (gnus-thread-total-score-1 thread))) | |
3865 (t | |
3866 (gnus-thread-total-score-1 (list thread))))) | |
3867 | |
3868 (defun gnus-thread-total-score-1 (root) | |
3869 ;; This function find the total score of the thread below ROOT. | |
3870 (setq root (car root)) | |
3871 (apply gnus-thread-score-function | |
3872 (or (append | |
3873 (mapcar 'gnus-thread-total-score | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
3874 (cdr (gnus-id-to-thread (mail-header-id root)))) |
17493 | 3875 (when (> (mail-header-number root) 0) |
3876 (list (or (cdr (assq (mail-header-number root) | |
3877 gnus-newsgroup-scored)) | |
3878 gnus-summary-default-score 0)))) | |
3879 (list gnus-summary-default-score) | |
3880 '(0)))) | |
3881 | |
3882 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>. | |
3883 (defvar gnus-tmp-prev-subject nil) | |
3884 (defvar gnus-tmp-false-parent nil) | |
3885 (defvar gnus-tmp-root-expunged nil) | |
3886 (defvar gnus-tmp-dummy-line nil) | |
3887 | |
33313
8a606f4c8066
Put some defvars in eval-when-compile.
Dave Love <fx@gnu.org>
parents:
33126
diff
changeset
|
3888 (eval-when-compile (defvar gnus-tmp-header)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3889 (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
|
3890 "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
|
3891 (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
|
3892 "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
3893 |
17493 | 3894 (defun gnus-summary-prepare-threads (threads) |
3895 "Prepare summary buffer from THREADS and indentation LEVEL. | |
3896 THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])' | |
3897 or a straight list of headers." | |
3898 (gnus-message 7 "Generating summary...") | |
3899 | |
3900 (setq gnus-newsgroup-threads threads) | |
3901 (beginning-of-line) | |
3902 | |
3903 (let ((gnus-tmp-level 0) | |
3904 (default-score (or gnus-summary-default-score 0)) | |
3905 (gnus-visual-p (gnus-visual-p 'summary-highlight 'highlight)) | |
3906 thread number subject stack state gnus-tmp-gathered beg-match | |
3907 new-roots gnus-tmp-new-adopts thread-end | |
3908 gnus-tmp-header gnus-tmp-unread | |
3909 gnus-tmp-replied gnus-tmp-subject-or-nil | |
3910 gnus-tmp-dummy gnus-tmp-indentation gnus-tmp-lines gnus-tmp-score | |
3911 gnus-tmp-score-char gnus-tmp-from gnus-tmp-name | |
3912 gnus-tmp-number gnus-tmp-opening-bracket gnus-tmp-closing-bracket) | |
3913 | |
3914 (setq gnus-tmp-prev-subject nil) | |
3915 | |
3916 (if (vectorp (car threads)) | |
3917 ;; If this is a straight (sic) list of headers, then a | |
3918 ;; threaded summary display isn't required, so we just create | |
3919 ;; an unthreaded one. | |
3920 (gnus-summary-prepare-unthreaded threads) | |
3921 | |
3922 ;; Do the threaded display. | |
3923 | |
3924 (while (or threads stack gnus-tmp-new-adopts new-roots) | |
3925 | |
3926 (if (and (= gnus-tmp-level 0) | |
3927 (or (not stack) | |
3928 (= (caar stack) 0)) | |
3929 (not gnus-tmp-false-parent) | |
3930 (or gnus-tmp-new-adopts new-roots)) | |
3931 (if gnus-tmp-new-adopts | |
3932 (setq gnus-tmp-level (if gnus-tmp-root-expunged 0 1) | |
3933 thread (list (car gnus-tmp-new-adopts)) | |
3934 gnus-tmp-header (caar thread) | |
3935 gnus-tmp-new-adopts (cdr gnus-tmp-new-adopts)) | |
3936 (when new-roots | |
3937 (setq thread (list (car new-roots)) | |
3938 gnus-tmp-header (caar thread) | |
3939 new-roots (cdr new-roots)))) | |
3940 | |
3941 (if threads | |
3942 ;; If there are some threads, we do them before the | |
3943 ;; threads on the stack. | |
3944 (setq thread threads | |
3945 gnus-tmp-header (caar thread)) | |
3946 ;; There were no current threads, so we pop something off | |
3947 ;; the stack. | |
3948 (setq state (car stack) | |
3949 gnus-tmp-level (car state) | |
3950 thread (cdr state) | |
3951 stack (cdr stack) | |
3952 gnus-tmp-header (caar thread)))) | |
3953 | |
3954 (setq gnus-tmp-false-parent nil) | |
3955 (setq gnus-tmp-root-expunged nil) | |
3956 (setq thread-end nil) | |
3957 | |
3958 (if (stringp gnus-tmp-header) | |
3959 ;; The header is a dummy root. | |
3960 (cond | |
3961 ((eq gnus-summary-make-false-root 'adopt) | |
3962 ;; We let the first article adopt the rest. | |
3963 (setq gnus-tmp-new-adopts (nconc gnus-tmp-new-adopts | |
3964 (cddar thread))) | |
3965 (setq gnus-tmp-gathered | |
3966 (nconc (mapcar | |
3967 (lambda (h) (mail-header-number (car h))) | |
3968 (cddar thread)) | |
3969 gnus-tmp-gathered)) | |
3970 (setq thread (cons (list (caar thread) | |
3971 (cadar thread)) | |
3972 (cdr thread))) | |
3973 (setq gnus-tmp-level -1 | |
3974 gnus-tmp-false-parent t)) | |
3975 ((eq gnus-summary-make-false-root 'empty) | |
3976 ;; We print adopted articles with empty subject fields. | |
3977 (setq gnus-tmp-gathered | |
3978 (nconc (mapcar | |
3979 (lambda (h) (mail-header-number (car h))) | |
3980 (cddar thread)) | |
3981 gnus-tmp-gathered)) | |
3982 (setq gnus-tmp-level -1)) | |
3983 ((eq gnus-summary-make-false-root 'dummy) | |
3984 ;; We remember that we probably want to output a dummy | |
3985 ;; root. | |
3986 (setq gnus-tmp-dummy-line gnus-tmp-header) | |
3987 (setq gnus-tmp-prev-subject gnus-tmp-header)) | |
3988 (t | |
3989 ;; We do not make a root for the gathered | |
3990 ;; sub-threads at all. | |
3991 (setq gnus-tmp-level -1))) | |
3992 | |
3993 (setq number (mail-header-number gnus-tmp-header) | |
3994 subject (mail-header-subject gnus-tmp-header)) | |
3995 | |
3996 (cond | |
3997 ;; If the thread has changed subject, we might want to make | |
3998 ;; this subthread into a root. | |
3999 ((and (null gnus-thread-ignore-subject) | |
4000 (not (zerop gnus-tmp-level)) | |
4001 gnus-tmp-prev-subject | |
4002 (not (inline | |
4003 (gnus-subject-equal gnus-tmp-prev-subject subject)))) | |
4004 (setq new-roots (nconc new-roots (list (car thread))) | |
4005 thread-end t | |
4006 gnus-tmp-header nil)) | |
4007 ;; If the article lies outside the current limit, | |
4008 ;; then we do not display it. | |
4009 ((not (memq number gnus-newsgroup-limit)) | |
4010 (setq gnus-tmp-gathered | |
4011 (nconc (mapcar | |
4012 (lambda (h) (mail-header-number (car h))) | |
4013 (cdar thread)) | |
4014 gnus-tmp-gathered)) | |
4015 (setq gnus-tmp-new-adopts (if (cdar thread) | |
4016 (append gnus-tmp-new-adopts | |
4017 (cdar thread)) | |
4018 gnus-tmp-new-adopts) | |
4019 thread-end t | |
4020 gnus-tmp-header nil) | |
4021 (when (zerop gnus-tmp-level) | |
4022 (setq gnus-tmp-root-expunged t))) | |
4023 ;; Perhaps this article is to be marked as read? | |
4024 ((and gnus-summary-mark-below | |
4025 (< (or (cdr (assq number gnus-newsgroup-scored)) | |
4026 default-score) | |
4027 gnus-summary-mark-below) | |
4028 ;; Don't touch sparse articles. | |
4029 (not (gnus-summary-article-sparse-p number)) | |
4030 (not (gnus-summary-article-ancient-p number))) | |
4031 (setq gnus-newsgroup-unreads | |
4032 (delq number gnus-newsgroup-unreads)) | |
4033 (if gnus-newsgroup-auto-expire | |
4034 (push number gnus-newsgroup-expirable) | |
4035 (push (cons number gnus-low-score-mark) | |
4036 gnus-newsgroup-reads)))) | |
4037 | |
4038 (when gnus-tmp-header | |
4039 ;; We may have an old dummy line to output before this | |
4040 ;; article. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4041 (when (and gnus-tmp-dummy-line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4042 (gnus-subject-equal |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4043 gnus-tmp-dummy-line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4044 (mail-header-subject gnus-tmp-header))) |
17493 | 4045 (gnus-summary-insert-dummy-line |
4046 gnus-tmp-dummy-line (mail-header-number gnus-tmp-header)) | |
4047 (setq gnus-tmp-dummy-line nil)) | |
4048 | |
4049 ;; Compute the mark. | |
4050 (setq gnus-tmp-unread (gnus-article-mark number)) | |
4051 | |
4052 (push (gnus-data-make number gnus-tmp-unread (1+ (point)) | |
4053 gnus-tmp-header gnus-tmp-level) | |
4054 gnus-newsgroup-data) | |
4055 | |
4056 ;; Actually insert the line. | |
4057 (setq | |
4058 gnus-tmp-subject-or-nil | |
4059 (cond | |
4060 ((and gnus-thread-ignore-subject | |
4061 gnus-tmp-prev-subject | |
4062 (not (inline (gnus-subject-equal | |
4063 gnus-tmp-prev-subject subject)))) | |
4064 subject) | |
4065 ((zerop gnus-tmp-level) | |
4066 (if (and (eq gnus-summary-make-false-root 'empty) | |
4067 (memq number gnus-tmp-gathered) | |
4068 gnus-tmp-prev-subject | |
4069 (inline (gnus-subject-equal | |
4070 gnus-tmp-prev-subject subject))) | |
4071 gnus-summary-same-subject | |
4072 subject)) | |
4073 (t gnus-summary-same-subject))) | |
4074 (if (and (eq gnus-summary-make-false-root 'adopt) | |
4075 (= gnus-tmp-level 1) | |
4076 (memq number gnus-tmp-gathered)) | |
4077 (setq gnus-tmp-opening-bracket ?\< | |
4078 gnus-tmp-closing-bracket ?\>) | |
4079 (setq gnus-tmp-opening-bracket ?\[ | |
4080 gnus-tmp-closing-bracket ?\])) | |
4081 (setq | |
4082 gnus-tmp-indentation | |
4083 (aref gnus-thread-indent-array gnus-tmp-level) | |
4084 gnus-tmp-lines (mail-header-lines gnus-tmp-header) | |
4085 gnus-tmp-score (or (cdr (assq number gnus-newsgroup-scored)) | |
4086 gnus-summary-default-score 0) | |
4087 gnus-tmp-score-char | |
4088 (if (or (null gnus-summary-default-score) | |
4089 (<= (abs (- gnus-tmp-score gnus-summary-default-score)) | |
4090 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
|
4091 ? ;Whitespace |
17493 | 4092 (if (< gnus-tmp-score gnus-summary-default-score) |
4093 gnus-score-below-mark gnus-score-over-mark)) | |
4094 gnus-tmp-replied | |
4095 (cond ((memq number gnus-newsgroup-processable) | |
4096 gnus-process-mark) | |
4097 ((memq number gnus-newsgroup-cached) | |
4098 gnus-cached-mark) | |
4099 ((memq number gnus-newsgroup-replied) | |
4100 gnus-replied-mark) | |
4101 ((memq number gnus-newsgroup-saved) | |
4102 gnus-saved-mark) | |
4103 (t gnus-unread-mark)) | |
4104 gnus-tmp-from (mail-header-from gnus-tmp-header) | |
4105 gnus-tmp-name | |
4106 (cond | |
4107 ((string-match "<[^>]+> *$" gnus-tmp-from) | |
4108 (setq beg-match (match-beginning 0)) | |
4109 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from) | |
4110 (substring gnus-tmp-from (1+ (match-beginning 0)) | |
4111 (1- (match-end 0)))) | |
4112 (substring gnus-tmp-from 0 beg-match))) | |
4113 ((string-match "(.+)" gnus-tmp-from) | |
4114 (substring gnus-tmp-from | |
4115 (1+ (match-beginning 0)) (1- (match-end 0)))) | |
4116 (t gnus-tmp-from))) | |
4117 (when (string= gnus-tmp-name "") | |
4118 (setq gnus-tmp-name gnus-tmp-from)) | |
4119 (unless (numberp gnus-tmp-lines) | |
4120 (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
|
4121 (gnus-put-text-property |
17493 | 4122 (point) |
4123 (progn (eval gnus-summary-line-format-spec) (point)) | |
4124 'gnus-number number) | |
4125 (when gnus-visual-p | |
4126 (forward-line -1) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4127 (gnus-run-hooks 'gnus-summary-update-hook) |
17493 | 4128 (forward-line 1)) |
4129 | |
4130 (setq gnus-tmp-prev-subject subject))) | |
4131 | |
4132 (when (nth 1 thread) | |
4133 (push (cons (max 0 gnus-tmp-level) (nthcdr 1 thread)) stack)) | |
4134 (incf gnus-tmp-level) | |
4135 (setq threads (if thread-end nil (cdar thread))) | |
4136 (unless threads | |
4137 (setq gnus-tmp-level 0))))) | |
4138 (gnus-message 7 "Generating summary...done")) | |
4139 | |
4140 (defun gnus-summary-prepare-unthreaded (headers) | |
4141 "Generate an unthreaded summary buffer based on HEADERS." | |
4142 (let (header number mark) | |
4143 | |
4144 (beginning-of-line) | |
4145 | |
4146 (while headers | |
4147 ;; We may have to root out some bad articles... | |
4148 (when (memq (setq number (mail-header-number | |
4149 (setq header (pop headers)))) | |
4150 gnus-newsgroup-limit) | |
4151 ;; Mark article as read when it has a low score. | |
4152 (when (and gnus-summary-mark-below | |
4153 (< (or (cdr (assq number gnus-newsgroup-scored)) | |
4154 gnus-summary-default-score 0) | |
4155 gnus-summary-mark-below) | |
4156 (not (gnus-summary-article-ancient-p number))) | |
4157 (setq gnus-newsgroup-unreads | |
4158 (delq number gnus-newsgroup-unreads)) | |
4159 (if gnus-newsgroup-auto-expire | |
4160 (push number gnus-newsgroup-expirable) | |
4161 (push (cons number gnus-low-score-mark) | |
4162 gnus-newsgroup-reads))) | |
4163 | |
4164 (setq mark (gnus-article-mark number)) | |
4165 (push (gnus-data-make number mark (1+ (point)) header 0) | |
4166 gnus-newsgroup-data) | |
4167 (gnus-summary-insert-line | |
4168 header 0 number | |
4169 mark (memq number gnus-newsgroup-replied) | |
4170 (memq number gnus-newsgroup-expirable) | |
4171 (mail-header-subject header) nil | |
4172 (cdr (assq number gnus-newsgroup-scored)) | |
4173 (memq number gnus-newsgroup-processable)))))) | |
4174 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4175 (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
|
4176 "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
|
4177 (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
|
4178 gnus-list-identifiers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4179 (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
|
4180 (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
|
4181 (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
|
4182 " *\\)\\)+\\(Re: +\\)?\\)") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4183 (mail-header-subject header)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4184 (mail-header-set-subject |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4185 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
|
4186 0 (match-beginning 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4187 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4188 (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
|
4189 (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
|
4190 (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
|
4191 (match-end 1)))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4192 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4193 (defun gnus-select-newsgroup (group &optional read-all select-articles) |
17493 | 4194 "Select newsgroup GROUP. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4195 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
|
4196 If SELECT-ARTICLES, only select those articles from GROUP." |
17493 | 4197 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb)) |
4198 ;;!!! Dirty hack; should be removed. | |
4199 (gnus-summary-ignore-duplicates | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4200 (if (eq (car (gnus-find-method-for-group group)) 'nnvirtual) |
17493 | 4201 t |
4202 gnus-summary-ignore-duplicates)) | |
4203 (info (nth 2 entry)) | |
4204 articles fetched-articles cached) | |
4205 | |
4206 (unless (gnus-check-server | |
4207 (setq gnus-current-select-method | |
4208 (gnus-find-method-for-group group))) | |
4209 (error "Couldn't open server")) | |
4210 | |
4211 (or (and entry (not (eq (car entry) t))) ; Either it's active... | |
4212 (gnus-activate-group group) ; Or we can activate it... | |
4213 (progn ; Or we bug out. | |
4214 (when (equal major-mode 'gnus-summary-mode) | |
4215 (kill-buffer (current-buffer))) | |
4216 (error "Couldn't request group %s: %s" | |
4217 group (gnus-status-message group)))) | |
4218 | |
4219 (unless (gnus-request-group group t) | |
4220 (when (equal major-mode 'gnus-summary-mode) | |
4221 (kill-buffer (current-buffer))) | |
4222 (error "Couldn't request group %s: %s" | |
4223 group (gnus-status-message group))) | |
4224 | |
4225 (setq gnus-newsgroup-name group) | |
4226 (setq gnus-newsgroup-unselected nil) | |
4227 (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
|
4228 (gnus-summary-setup-default-charset) |
17493 | 4229 |
4230 ;; Adjust and set lists of article marks. | |
4231 (when info | |
4232 (gnus-adjust-marked-articles info)) | |
4233 | |
4234 ;; Kludge to avoid having cached articles nixed out in virtual groups. | |
4235 (when (gnus-virtual-group-p group) | |
4236 (setq cached gnus-newsgroup-cached)) | |
4237 | |
4238 (setq gnus-newsgroup-unreads | |
4239 (gnus-set-difference | |
4240 (gnus-set-difference gnus-newsgroup-unreads gnus-newsgroup-marked) | |
4241 gnus-newsgroup-dormant)) | |
4242 | |
4243 (setq gnus-newsgroup-processable nil) | |
4244 | |
4245 (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
|
4246 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4247 (if (setq articles select-articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4248 (setq gnus-newsgroup-unselected |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4249 (gnus-sorted-intersection |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4250 gnus-newsgroup-unreads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4251 (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
|
4252 (setq articles (gnus-articles-to-read group read-all))) |
17493 | 4253 |
4254 (cond | |
4255 ((null articles) | |
4256 ;;(gnus-message 3 "Couldn't select newsgroup -- no articles to display") | |
4257 'quit) | |
4258 ((eq articles 0) nil) | |
4259 (t | |
4260 ;; Init the dependencies hash table. | |
4261 (setq gnus-newsgroup-dependencies | |
4262 (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
|
4263 (gnus-set-global-variables) |
17493 | 4264 ;; Retrieve the headers and read them in. |
4265 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name) | |
4266 (setq gnus-newsgroup-headers | |
4267 (if (eq 'nov | |
4268 (setq gnus-headers-retrieved-by | |
4269 (gnus-retrieve-headers | |
4270 articles gnus-newsgroup-name | |
4271 ;; We might want to fetch old headers, but | |
4272 ;; 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
|
4273 (and (or (and |
17493 | 4274 (not (eq gnus-fetch-old-headers 'some)) |
4275 (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
|
4276 (> (length articles) 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4277 gnus-fetch-old-headers)))) |
17493 | 4278 (gnus-get-newsgroup-headers-xover |
4279 articles nil nil gnus-newsgroup-name t) | |
4280 (gnus-get-newsgroup-headers))) | |
4281 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name) | |
4282 | |
4283 ;; Kludge to avoid having cached articles nixed out in virtual groups. | |
4284 (when cached | |
4285 (setq gnus-newsgroup-cached cached)) | |
4286 | |
4287 ;; Suppress duplicates? | |
4288 (when gnus-suppress-duplicates | |
4289 (gnus-dup-suppress-articles)) | |
4290 | |
4291 ;; Set the initial limit. | |
4292 (setq gnus-newsgroup-limit (copy-sequence articles)) | |
4293 ;; Remove canceled articles from the list of unread articles. | |
4294 (setq gnus-newsgroup-unreads | |
4295 (gnus-set-sorted-intersection | |
4296 gnus-newsgroup-unreads | |
4297 (setq fetched-articles | |
4298 (mapcar (lambda (headers) (mail-header-number headers)) | |
4299 gnus-newsgroup-headers)))) | |
4300 ;; Removed marked articles that do not exist. | |
4301 (gnus-update-missing-marks | |
4302 (gnus-sorted-complement fetched-articles articles)) | |
4303 ;; 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
|
4304 (when (and gnus-fetch-old-headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4305 (eq gnus-headers-retrieved-by 'nov)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4306 (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
|
4307 (gnus-build-all-threads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4308 (gnus-build-old-threads))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4309 ;; 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
|
4310 (when gnus-agent |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4311 (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
|
4312 ;; 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
|
4313 (when gnus-list-identifiers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4314 (gnus-summary-remove-list-identifiers)) |
17493 | 4315 ;; Check whether auto-expire is to be done in this group. |
4316 (setq gnus-newsgroup-auto-expire | |
4317 (gnus-group-auto-expirable-p group)) | |
4318 ;; Set up the article buffer now, if necessary. | |
4319 (unless gnus-single-article-buffer | |
4320 (gnus-article-setup-buffer)) | |
4321 ;; First and last article in this newsgroup. | |
4322 (when gnus-newsgroup-headers | |
4323 (setq gnus-newsgroup-begin | |
4324 (mail-header-number (car gnus-newsgroup-headers)) | |
4325 gnus-newsgroup-end | |
4326 (mail-header-number | |
4327 (gnus-last-element gnus-newsgroup-headers)))) | |
4328 ;; GROUP is successfully selected. | |
4329 (or gnus-newsgroup-headers t))))) | |
4330 | |
4331 (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
|
4332 "Find out what articles the user wants to read." |
17493 | 4333 (let* ((articles |
4334 ;; Select all articles if `read-all' is non-nil, or if there | |
4335 ;; are no unread articles. | |
4336 (if (or read-all | |
4337 (and (zerop (length gnus-newsgroup-marked)) | |
4338 (zerop (length gnus-newsgroup-unreads))) | |
4339 (eq (gnus-group-find-parameter group 'display) | |
4340 'all)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4341 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4342 (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
|
4343 (gnus-cache-articles-in-group group)) |
17493 | 4344 (sort (append gnus-newsgroup-dormant gnus-newsgroup-marked |
4345 (copy-sequence gnus-newsgroup-unreads)) | |
4346 '<))) | |
4347 (scored-list (gnus-killed-articles gnus-newsgroup-killed articles)) | |
4348 (scored (length scored-list)) | |
4349 (number (length articles)) | |
4350 (marked (+ (length gnus-newsgroup-marked) | |
4351 (length gnus-newsgroup-dormant))) | |
4352 (select | |
4353 (cond | |
4354 ((numberp read-all) | |
4355 read-all) | |
4356 (t | |
4357 (condition-case () | |
4358 (cond | |
4359 ((and (or (<= scored marked) (= scored number)) | |
4360 (numberp gnus-large-newsgroup) | |
4361 (> number gnus-large-newsgroup)) | |
4362 (let ((input | |
4363 (read-string | |
4364 (format | |
4365 "How many articles from %s (default %d): " | |
4366 (gnus-limit-string gnus-newsgroup-name 35) | |
4367 number)))) | |
4368 (if (string-match "^[ \t]*$" input) number input))) | |
4369 ((and (> scored marked) (< scored number) | |
4370 (> (- scored number) 20)) | |
4371 (let ((input | |
4372 (read-string | |
4373 (format "%s %s (%d scored, %d total): " | |
4374 "How many articles from" | |
4375 group scored number)))) | |
4376 (if (string-match "^[ \t]*$" input) | |
4377 number input))) | |
4378 (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
|
4379 (quit |
5155c0078eb9
2000-10-27 Kai Gro?ohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
Dave Love <fx@gnu.org>
parents:
31785
diff
changeset
|
4380 (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
|
4381 nil)))))) |
17493 | 4382 (setq select (if (stringp select) (string-to-number select) select)) |
4383 (if (or (null select) (zerop select)) | |
4384 select | |
4385 (if (and (not (zerop scored)) (<= (abs select) scored)) | |
4386 (progn | |
4387 (setq articles (sort scored-list '<)) | |
4388 (setq number (length articles))) | |
4389 (setq articles (copy-sequence articles))) | |
4390 | |
4391 (when (< (abs select) number) | |
4392 (if (< select 0) | |
4393 ;; Select the N oldest articles. | |
4394 (setcdr (nthcdr (1- (abs select)) articles) nil) | |
4395 ;; Select the N most recent articles. | |
4396 (setq articles (nthcdr (- number select) articles)))) | |
4397 (setq gnus-newsgroup-unselected | |
4398 (gnus-sorted-intersection | |
4399 gnus-newsgroup-unreads | |
4400 (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
|
4401 (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
|
4402 (setq gnus-newsgroup-unreads |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4403 (sort |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4404 (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
|
4405 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
|
4406 '<))) |
17493 | 4407 articles))) |
4408 | |
4409 (defun gnus-killed-articles (killed articles) | |
4410 (let (out) | |
4411 (while articles | |
4412 (when (inline (gnus-member-of-range (car articles) killed)) | |
4413 (push (car articles) out)) | |
4414 (setq articles (cdr articles))) | |
4415 out)) | |
4416 | |
4417 (defun gnus-uncompress-marks (marks) | |
4418 "Uncompress the mark ranges in MARKS." | |
4419 (let ((uncompressed '(score bookmark)) | |
4420 out) | |
4421 (while marks | |
4422 (if (memq (caar marks) uncompressed) | |
4423 (push (car marks) out) | |
4424 (push (cons (caar marks) (gnus-uncompress-range (cdar marks))) out)) | |
4425 (setq marks (cdr marks))) | |
4426 out)) | |
4427 | |
4428 (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
|
4429 "Set all article lists and remove all marks that are no longer valid." |
17493 | 4430 (let* ((marked-lists (gnus-info-marks info)) |
4431 (active (gnus-active (gnus-info-group info))) | |
4432 (min (car active)) | |
4433 (max (cdr active)) | |
4434 (types gnus-article-mark-lists) | |
4435 (uncompressed '(score bookmark killed)) | |
4436 marks var articles article mark) | |
4437 | |
4438 (while marked-lists | |
4439 (setq marks (pop marked-lists)) | |
4440 (set (setq var (intern (format "gnus-newsgroup-%s" | |
4441 (car (rassq (setq mark (car marks)) | |
4442 types))))) | |
4443 (if (memq (car marks) uncompressed) (cdr marks) | |
4444 (gnus-uncompress-range (cdr marks)))) | |
4445 | |
4446 (setq articles (symbol-value var)) | |
4447 | |
4448 ;; All articles have to be subsets of the active articles. | |
4449 (cond | |
4450 ;; Adjust "simple" lists. | |
4451 ((memq mark '(tick dormant expire reply save)) | |
4452 (while articles | |
4453 (when (or (< (setq article (pop articles)) min) (> article max)) | |
4454 (set var (delq article (symbol-value var)))))) | |
4455 ;; Adjust assocs. | |
4456 ((memq mark uncompressed) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4457 (when (not (listp (cdr (symbol-value var)))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4458 (set var (list (symbol-value var)))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4459 (when (not (listp (cdr articles))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4460 (setq articles (list articles))) |
17493 | 4461 (while articles |
4462 (when (or (not (consp (setq article (pop articles)))) | |
4463 (< (car article) min) | |
4464 (> (car article) max)) | |
4465 (set var (delq article (symbol-value var)))))))))) | |
4466 | |
4467 (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
|
4468 "Go through the list of MISSING articles and remove them from the mark lists." |
17493 | 4469 (when missing |
4470 (let ((types gnus-article-mark-lists) | |
4471 var m) | |
4472 ;; Go through all types. | |
4473 (while types | |
4474 (setq var (intern (format "gnus-newsgroup-%s" (car (pop types))))) | |
4475 (when (symbol-value var) | |
4476 ;; This list has articles. So we delete all missing articles | |
4477 ;; from it. | |
4478 (setq m missing) | |
4479 (while m | |
4480 (set var (delq (pop m) (symbol-value var))))))))) | |
4481 | |
4482 (defun gnus-update-marks () | |
4483 "Enter the various lists of marked articles into the newsgroup info list." | |
4484 (let ((types gnus-article-mark-lists) | |
4485 (info (gnus-get-info gnus-newsgroup-name)) | |
4486 (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
|
4487 type list newmarked symbol delta-marks) |
17493 | 4488 (when info |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4489 ;; Add all marks lists to the list of marks lists. |
17493 | 4490 (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
|
4491 (setq list (symbol-value |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4492 (setq symbol |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4493 (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
|
4494 (car type)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4495 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4496 (when list |
17493 | 4497 ;; Get rid of the entries of the articles that have the |
4498 ;; default score. | |
4499 (when (and (eq (cdr type) 'score) | |
4500 gnus-save-score | |
4501 list) | |
4502 (let* ((arts list) | |
4503 (prev (cons nil list)) | |
4504 (all prev)) | |
4505 (while arts | |
4506 (if (or (not (consp (car arts))) | |
4507 (= (cdar arts) gnus-summary-default-score)) | |
4508 (setcdr prev (cdr arts)) | |
4509 (setq prev arts)) | |
4510 (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
|
4511 (setq list (cdr all))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4512 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4513 (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
|
4514 (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
|
4515 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4516 (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
|
4517 '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
|
4518 ;; 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
|
4519 ;; 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
|
4520 ;; 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
|
4521 ;; 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
|
4522 ;; 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
|
4523 ;; 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
|
4524 (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
|
4525 uncompressed)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4526 (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
|
4527 (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
|
4528 (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
|
4529 (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
|
4530 (when add |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4531 (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
|
4532 (when del |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4533 (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
|
4534 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4535 (when list |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4536 (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
|
4537 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4538 (when delta-marks |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4539 (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
|
4540 (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
|
4541 (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
|
4542 |
17493 | 4543 ;; Enter these new marks into the info of the group. |
4544 (if (nthcdr 3 info) | |
4545 (setcar (nthcdr 3 info) newmarked) | |
4546 ;; Add the marks lists to the end of the info. | |
4547 (when newmarked | |
4548 (setcdr (nthcdr 2 info) (list newmarked)))) | |
4549 | |
4550 ;; Cut off the end of the info if there's nothing else there. | |
4551 (let ((i 5)) | |
4552 (while (and (> i 2) | |
4553 (not (nth i info))) | |
4554 (when (nthcdr (decf i) info) | |
4555 (setcdr (nthcdr i info) nil))))))) | |
4556 | |
4557 (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
|
4558 "Set the mode line of the article or summary buffers. |
17493 | 4559 If WHERE is `summary', the summary mode line format will be used." |
4560 ;; 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
|
4561 (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
|
4562 (symbol-value |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4563 (intern (format "gnus-%s-mode-line-format-spec" where)))) |
17493 | 4564 (let (mode-string) |
4565 (save-excursion | |
4566 ;; We evaluate this in the summary buffer since these | |
4567 ;; variables are buffer-local to that buffer. | |
4568 (set-buffer gnus-summary-buffer) | |
4569 ;; We bind all these variables that are used in the `eval' form | |
4570 ;; below. | |
4571 (let* ((mformat (symbol-value | |
4572 (intern | |
4573 (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
|
4574 (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
|
4575 gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4576 (gnus-group-name-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4577 nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4578 gnus-newsgroup-name))) |
17493 | 4579 (gnus-tmp-article-number (or gnus-current-article 0)) |
4580 (gnus-tmp-unread gnus-newsgroup-unreads) | |
4581 (gnus-tmp-unread-and-unticked (length gnus-newsgroup-unreads)) | |
4582 (gnus-tmp-unselected (length gnus-newsgroup-unselected)) | |
4583 (gnus-tmp-unread-and-unselected | |
4584 (cond ((and (zerop gnus-tmp-unread-and-unticked) | |
4585 (zerop gnus-tmp-unselected)) | |
4586 "") | |
4587 ((zerop gnus-tmp-unselected) | |
4588 (format "{%d more}" gnus-tmp-unread-and-unticked)) | |
4589 (t (format "{%d(+%d) more}" | |
4590 gnus-tmp-unread-and-unticked | |
4591 gnus-tmp-unselected)))) | |
4592 (gnus-tmp-subject | |
4593 (if (and gnus-current-headers | |
4594 (vectorp gnus-current-headers)) | |
4595 (gnus-mode-string-quote | |
4596 (mail-header-subject gnus-current-headers)) | |
4597 "")) | |
4598 bufname-length max-len | |
4599 gnus-tmp-header);; passed as argument to any user-format-funcs | |
4600 (setq mode-string (eval mformat)) | |
4601 (setq bufname-length (if (string-match "%b" mode-string) | |
4602 (- (length | |
4603 (buffer-name | |
4604 (if (eq where 'summary) | |
4605 nil | |
4606 (get-buffer gnus-article-buffer)))) | |
4607 2) | |
4608 0)) | |
4609 (setq max-len (max 4 (if gnus-mode-non-string-length | |
4610 (- (window-width) | |
4611 gnus-mode-non-string-length | |
4612 bufname-length) | |
4613 (length mode-string)))) | |
4614 ;; We might have to chop a bit of the string off... | |
4615 (when (> (length mode-string) max-len) | |
4616 (setq mode-string | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4617 (concat (truncate-string-to-width mode-string (- max-len 3)) |
17493 | 4618 "..."))) |
4619 ;; Pad the mode string a bit. | |
4620 (setq mode-string (format (format "%%-%ds" max-len) mode-string)))) | |
4621 ;; Update the mode line. | |
4622 (setq mode-line-buffer-identification | |
4623 (gnus-mode-line-buffer-identification (list mode-string))) | |
4624 (set-buffer-modified-p t)))) | |
4625 | |
4626 (defun gnus-create-xref-hashtb (from-newsgroup headers unreads) | |
4627 "Go through the HEADERS list and add all Xrefs to a hash table. | |
4628 The resulting hash table is returned, or nil if no Xrefs were found." | |
4629 (let* ((virtual (gnus-virtual-group-p from-newsgroup)) | |
4630 (prefix (if virtual "" (gnus-group-real-prefix from-newsgroup))) | |
4631 (xref-hashtb (gnus-make-hashtable)) | |
4632 start group entry number xrefs header) | |
4633 (while headers | |
4634 (setq header (pop headers)) | |
4635 (when (and (setq xrefs (mail-header-xref header)) | |
4636 (not (memq (setq number (mail-header-number header)) | |
4637 unreads))) | |
4638 (setq start 0) | |
4639 (while (string-match "\\([^ ]+\\)[:/]\\([0-9]+\\)" xrefs start) | |
4640 (setq start (match-end 0)) | |
4641 (setq group (if prefix | |
4642 (concat prefix (substring xrefs (match-beginning 1) | |
4643 (match-end 1))) | |
4644 (substring xrefs (match-beginning 1) (match-end 1)))) | |
4645 (setq number | |
4646 (string-to-int (substring xrefs (match-beginning 2) | |
4647 (match-end 2)))) | |
4648 (if (setq entry (gnus-gethash group xref-hashtb)) | |
4649 (setcdr entry (cons number (cdr entry))) | |
4650 (gnus-sethash group (cons number nil) xref-hashtb))))) | |
4651 (and start xref-hashtb))) | |
4652 | |
4653 (defun gnus-mark-xrefs-as-read (from-newsgroup headers unreads) | |
4654 "Look through all the headers and mark the Xrefs as read." | |
4655 (let ((virtual (gnus-virtual-group-p from-newsgroup)) | |
4656 name entry info xref-hashtb idlist method nth4) | |
4657 (save-excursion | |
4658 (set-buffer gnus-group-buffer) | |
4659 (when (setq xref-hashtb | |
4660 (gnus-create-xref-hashtb from-newsgroup headers unreads)) | |
4661 (mapatoms | |
4662 (lambda (group) | |
4663 (unless (string= from-newsgroup (setq name (symbol-name group))) | |
4664 (setq idlist (symbol-value group)) | |
4665 ;; Dead groups are not updated. | |
4666 (and (prog1 | |
4667 (setq entry (gnus-gethash name gnus-newsrc-hashtb) | |
4668 info (nth 2 entry)) | |
4669 (when (stringp (setq nth4 (gnus-info-method info))) | |
4670 (setq nth4 (gnus-server-to-method nth4)))) | |
4671 ;; Only do the xrefs if the group has the same | |
4672 ;; select method as the group we have just read. | |
4673 (or (gnus-methods-equal-p | |
4674 nth4 (gnus-find-method-for-group from-newsgroup)) | |
4675 virtual | |
4676 (equal nth4 (setq method (gnus-find-method-for-group | |
4677 from-newsgroup))) | |
4678 (and (equal (car nth4) (car method)) | |
4679 (equal (nth 1 nth4) (nth 1 method)))) | |
4680 gnus-use-cross-reference | |
4681 (or (not (eq gnus-use-cross-reference t)) | |
4682 virtual | |
4683 ;; Only do cross-references on subscribed | |
4684 ;; groups, if that is what is wanted. | |
4685 (<= (gnus-info-level info) gnus-level-subscribed)) | |
4686 (gnus-group-make-articles-read name idlist)))) | |
4687 xref-hashtb))))) | |
4688 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4689 (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
|
4690 (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
|
4691 (info (nth 2 entry)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4692 (active (gnus-active group)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4693 ninfo) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4694 (when entry |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4695 ;; 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
|
4696 (when active |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4697 (let ((ids articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4698 id first) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4699 (while (setq id (pop ids)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4700 (when (and first (> id (cdr active))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4701 ;; 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
|
4702 ;; 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
|
4703 ;; 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
|
4704 ;; 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
|
4705 ;; 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
|
4706 ;; 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
|
4707 ;; 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
|
4708 ;; crossposting thingy will *increase* the number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4709 ;; 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
|
4710 (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
|
4711 (when (or (> id (cdr active)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4712 (< id (car active))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4713 (setq articles (delq id articles)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4714 ;; 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
|
4715 (if (and active |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4716 (null (gnus-info-read info)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4717 (> (car active) 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4718 (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
|
4719 (setq ninfo (gnus-info-read info))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4720 ;; 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
|
4721 (gnus-add-to-range |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4722 ninfo (setq articles (sort articles '<)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4723 |
17493 | 4724 (defun gnus-group-make-articles-read (group articles) |
4725 "Update the info of GROUP to say that ARTICLES are read." | |
4726 (let* ((num 0) | |
4727 (entry (gnus-gethash group gnus-newsrc-hashtb)) | |
4728 (info (nth 2 entry)) | |
4729 (active (gnus-active group)) | |
4730 range) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4731 (when entry |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4732 (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
|
4733 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4734 (set-buffer gnus-group-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4735 (gnus-undo-register |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4736 `(progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4737 (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
|
4738 (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
|
4739 (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
|
4740 (gnus-group-update-group ,group t)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4741 ;; 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
|
4742 (gnus-info-set-read info range) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4743 ;; 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
|
4744 ;; articles there are in this group. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4745 (when active |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4746 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4747 ((not range) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4748 (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
|
4749 ((not (listp (cdr range))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4750 (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
|
4751 (car range))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4752 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4753 (while range |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4754 (if (numberp (car range)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4755 (setq num (1+ num)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4756 (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
|
4757 (setq range (cdr range))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4758 (setq num (- (cdr active) num)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4759 ;; Update the number of unread articles. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4760 (setcar entry num) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4761 ;; Update the group buffer. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4762 (gnus-group-update-group group t))))) |
17493 | 4763 |
4764 (defvar gnus-newsgroup-none-id 0) | |
4765 | |
4766 (defun gnus-get-newsgroup-headers (&optional dependencies force-new) | |
4767 (let ((cur nntp-server-buffer) | |
4768 (dependencies | |
4769 (or dependencies | |
4770 (save-excursion (set-buffer gnus-summary-buffer) | |
4771 gnus-newsgroup-dependencies))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4772 headers id end ref |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4773 (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
|
4774 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4775 (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
|
4776 (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
|
4777 (error)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4778 gnus-newsgroup-ignored-charsets))) |
17493 | 4779 (save-excursion |
4780 (set-buffer nntp-server-buffer) | |
4781 ;; Translate all TAB characters into SPACE characters. | |
4782 (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
|
4783 (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
|
4784 (gnus-run-hooks 'gnus-parse-headers-hook) |
17493 | 4785 (let ((case-fold-search t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4786 in-reply-to header p lines chars) |
17493 | 4787 (goto-char (point-min)) |
4788 ;; Search to the beginning of the next header. Error messages | |
4789 ;; do not begin with 2 or 3. | |
4790 (while (re-search-forward "^[23][0-9]+ " nil t) | |
4791 (setq id nil | |
4792 ref nil) | |
4793 ;; This implementation of this function, with nine | |
4794 ;; search-forwards instead of the one re-search-forward and | |
4795 ;; a case (which basically was the old function) is actually | |
4796 ;; about twice as fast, even though it looks messier. You | |
4797 ;; can't have everything, I guess. Speed and elegance | |
4798 ;; doesn't always go hand in hand. | |
4799 (setq | |
4800 header | |
4801 (vector | |
4802 ;; Number. | |
4803 (prog1 | |
4804 (read cur) | |
4805 (end-of-line) | |
4806 (setq p (point)) | |
4807 (narrow-to-region (point) | |
4808 (or (and (search-forward "\n.\n" nil t) | |
4809 (- (point) 2)) | |
4810 (point)))) | |
4811 ;; Subject. | |
4812 (progn | |
4813 (goto-char p) | |
4814 (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
|
4815 (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
|
4816 (nnheader-header-value)) |
19594
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
4817 "(none)")) |
17493 | 4818 ;; From. |
4819 (progn | |
4820 (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
|
4821 (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
|
4822 (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
|
4823 (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
|
4824 (nnheader-header-value)) |
19594
abfa7b46c7bd
(gnus-structured-field-decoder): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19521
diff
changeset
|
4825 "(nobody)")) |
17493 | 4826 ;; Date. |
4827 (progn | |
4828 (goto-char p) | |
4829 (if (search-forward "\ndate: " nil t) | |
4830 (nnheader-header-value) "")) | |
4831 ;; Message-ID. | |
4832 (progn | |
4833 (goto-char p) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4834 (setq id (if (re-search-forward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4835 "^message-id: *\\(<[^\n\t> ]+>\\)" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4836 ;; 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
|
4837 ;; is (somewhat) syntactically valid. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4838 (buffer-substring (match-beginning 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4839 (match-end 1)) |
17493 | 4840 ;; If there was no message-id, we just fake one |
4841 ;; to make subsequent routines simpler. | |
4842 (nnheader-generate-fake-message-id)))) | |
4843 ;; References. | |
4844 (progn | |
4845 (goto-char p) | |
4846 (if (search-forward "\nreferences: " nil t) | |
4847 (progn | |
4848 (setq end (point)) | |
4849 (prog1 | |
4850 (nnheader-header-value) | |
4851 (setq ref | |
4852 (buffer-substring | |
4853 (progn | |
4854 (end-of-line) | |
4855 (search-backward ">" end t) | |
4856 (1+ (point))) | |
4857 (progn | |
4858 (search-backward "<" end t) | |
4859 (point)))))) | |
4860 ;; Get the references from the in-reply-to header if there | |
4861 ;; were no references and the in-reply-to header looks | |
4862 ;; promising. | |
4863 (if (and (search-forward "\nin-reply-to: " nil t) | |
4864 (setq in-reply-to (nnheader-header-value)) | |
4865 (string-match "<[^>]+>" in-reply-to)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4866 (let (ref2) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4867 (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
|
4868 (match-end 0))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4869 (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
|
4870 (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
|
4871 (match-end 0))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4872 (when (> (length ref2) (length ref)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4873 (setq ref ref2))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4874 ref) |
17493 | 4875 (setq ref nil)))) |
4876 ;; Chars. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4877 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4878 (goto-char p) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4879 (if (search-forward "\nchars: " nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4880 (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
|
4881 chars 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4882 0)) |
17493 | 4883 ;; Lines. |
4884 (progn | |
4885 (goto-char p) | |
4886 (if (search-forward "\nlines: " nil t) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
4887 (if (numberp (setq lines (ignore-errors (read cur)))) |
17493 | 4888 lines 0) |
4889 0)) | |
4890 ;; Xref. | |
4891 (progn | |
4892 (goto-char p) | |
4893 (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
|
4894 (nnheader-header-value))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4895 ;; Extra. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4896 (when gnus-extra-headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4897 (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
|
4898 out) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4899 (while extra |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4900 (goto-char p) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4901 (when (search-forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4902 (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
|
4903 (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
|
4904 out)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4905 (pop extra)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
4906 out)))) |
17493 | 4907 (when (equal id ref) |
4908 (setq ref nil)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4909 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4910 (when gnus-alter-header-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4911 (funcall gnus-alter-header-function header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4912 (setq id (mail-header-id header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4913 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
|
4914 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4915 (when (setq header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4916 (gnus-dependencies-add-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
4917 header dependencies force-new)) |
17493 | 4918 (push header headers)) |
4919 (goto-char (point-max)) | |
4920 (widen)) | |
4921 (nreverse headers))))) | |
4922 | |
4923 ;; Goes through the xover lines and returns a list of vectors | |
4924 (defun gnus-get-newsgroup-headers-xover (sequence &optional | |
4925 force-new dependencies | |
4926 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
|
4927 "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
|
4928 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
|
4929 `nntp-retrieve-headers')." |
17493 | 4930 ;; Get the Xref when the users reads the articles since most/some |
4931 ;; NNTP servers do not include Xrefs when using XOVER. | |
4932 (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
|
4933 (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
|
4934 (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
|
4935 (cur nntp-server-buffer) |
17493 | 4936 (dependencies (or dependencies gnus-newsgroup-dependencies)) |
4937 number headers header) | |
4938 (save-excursion | |
4939 (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
|
4940 (subst-char-in-region (point-min) (point-max) ?\r ? t) |
17493 | 4941 ;; 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
|
4942 (gnus-run-hooks 'gnus-parse-headers-hook) |
17493 | 4943 (goto-char (point-min)) |
4944 (while (not (eobp)) | |
4945 (condition-case () | |
4946 (while (and sequence (not (eobp))) | |
4947 (setq number (read cur)) | |
4948 (while (and sequence | |
4949 (< (car sequence) number)) | |
4950 (setq sequence (cdr sequence))) | |
4951 (and sequence | |
4952 (eq number (car sequence)) | |
4953 (progn | |
4954 (setq sequence (cdr sequence)) | |
4955 (setq header (inline | |
4956 (gnus-nov-parse-line | |
4957 number dependencies force-new)))) | |
4958 (push header headers)) | |
4959 (forward-line 1)) | |
4960 (error | |
4961 (gnus-error 4 "Strange nov line (%d)" | |
4962 (count-lines (point-min) (point))))) | |
4963 (forward-line 1)) | |
4964 ;; A common bug in inn is that if you have posted an article and | |
4965 ;; then retrieves the active file, it will answer correctly -- | |
4966 ;; the new article is included. However, a NOV entry for the | |
4967 ;; article may not have been generated yet, so this may fail. | |
4968 ;; We work around this problem by retrieving the last few | |
4969 ;; headers using HEAD. | |
4970 (if (or (not also-fetch-heads) | |
4971 (not sequence)) | |
4972 ;; We (probably) got all the headers. | |
4973 (nreverse headers) | |
4974 (let ((gnus-nov-is-evil t)) | |
4975 (nconc | |
4976 (nreverse headers) | |
4977 (when (gnus-retrieve-headers sequence group) | |
4978 (gnus-get-newsgroup-headers)))))))) | |
4979 | |
4980 (defun gnus-article-get-xrefs () | |
4981 "Fill in the Xref value in `gnus-current-headers', if necessary. | |
4982 This is meant to be called in `gnus-article-internal-prepare-hook'." | |
4983 (let ((headers (save-excursion (set-buffer gnus-summary-buffer) | |
4984 gnus-current-headers))) | |
4985 (or (not gnus-use-cross-reference) | |
4986 (not headers) | |
4987 (and (mail-header-xref headers) | |
4988 (not (string= (mail-header-xref headers) ""))) | |
4989 (let ((case-fold-search t) | |
4990 xref) | |
4991 (save-restriction | |
4992 (nnheader-narrow-to-headers) | |
4993 (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
|
4994 (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
|
4995 (eq (downcase (char-after)) ?x) |
17493 | 4996 (looking-at "Xref:")) |
4997 (search-forward "\nXref:" nil t)) | |
4998 (goto-char (1+ (match-end 0))) | |
4999 (setq xref (buffer-substring (point) | |
5000 (progn (end-of-line) (point)))) | |
5001 (mail-header-set-xref headers xref))))))) | |
5002 | |
5003 (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
|
5004 "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
|
5005 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
|
5006 the subject line on." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5007 (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
|
5008 (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
|
5009 (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
|
5010 old-header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5011 ((and (numberp id) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5012 (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
|
5013 (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
|
5014 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5015 (gnus-read-header id)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5016 (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
|
5017 d) |
17493 | 5018 (when header |
5019 ;; Rebuild the thread that this article is part of and go to the | |
5020 ;; article we have fetched. | |
5021 (when (and (not gnus-show-threads) | |
5022 old-header) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5023 (when (and number |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5024 (setq d (gnus-data-find (mail-header-number old-header)))) |
17493 | 5025 (goto-char (gnus-data-pos d)) |
5026 (gnus-data-remove | |
5027 number | |
5028 (- (gnus-point-at-bol) | |
5029 (prog1 | |
5030 (1+ (gnus-point-at-eol)) | |
5031 (gnus-delete-line)))))) | |
5032 (when old-header | |
5033 (mail-header-set-number header (mail-header-number old-header))) | |
5034 (setq gnus-newsgroup-sparse | |
5035 (delq (setq number (mail-header-number header)) | |
5036 gnus-newsgroup-sparse)) | |
5037 (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
|
5038 (push number gnus-newsgroup-limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5039 (gnus-rebuild-thread (mail-header-id header) line) |
17493 | 5040 (gnus-summary-goto-subject number nil t)) |
5041 (when (and (numberp number) | |
5042 (> number 0)) | |
5043 ;; We have to update the boundaries even if we can't fetch the | |
5044 ;; article if ID is a number -- so that the next `P' or `N' | |
5045 ;; command will fetch the previous (or next) article even | |
5046 ;; if the one we tried to fetch this time has been canceled. | |
5047 (when (> number gnus-newsgroup-end) | |
5048 (setq gnus-newsgroup-end number)) | |
5049 (when (< number gnus-newsgroup-begin) | |
5050 (setq gnus-newsgroup-begin number)) | |
5051 (setq gnus-newsgroup-unselected | |
5052 (delq number gnus-newsgroup-unselected))) | |
5053 ;; Report back a success? | |
5054 (and header (mail-header-number header)))) | |
5055 | |
5056 ;;; Process/prefix in the summary buffer | |
5057 | |
5058 (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
|
5059 "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
|
5060 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
|
5061 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
|
5062 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5063 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5064 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5065 (n |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5066 ;; A numerical prefix has been given. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5067 (setq n (prefix-numeric-value n)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5068 (let ((backward (< n 0)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5069 (n (abs (prefix-numeric-value n))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5070 articles article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5071 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5072 (while |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5073 (and (> n 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5074 (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
|
5075 articles) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5076 (if backward |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5077 (gnus-summary-find-prev nil article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5078 (gnus-summary-find-next nil article))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5079 (decf n))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5080 (nreverse articles))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5081 ((and (gnus-region-active-p) (mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5082 (message "region active") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5083 ;; 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
|
5084 (let ((max (max (point) (mark))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5085 articles article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5086 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5087 (goto-char (min (min (point) (mark)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5088 (while |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5089 (and |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5090 (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
|
5091 (gnus-summary-find-next nil article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5092 (< (point) max))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5093 (nreverse articles)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5094 (gnus-newsgroup-processable |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5095 ;; There are process-marked articles present. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5096 ;; Save current state. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5097 (gnus-summary-save-process-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5098 ;; Return the list. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5099 (reverse gnus-newsgroup-processable)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5100 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5101 ;; Just return the current article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5102 (list (gnus-summary-article-number)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5103 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5104 (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
|
5105 "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
|
5106 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
|
5107 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
|
5108 (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
|
5109 `(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
|
5110 (while ,articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5111 (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
|
5112 ,@forms |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5113 (pop ,articles))))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5114 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5115 (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
|
5116 (put 'gnus-summary-iterate 'edebug-form-spec '(form body)) |
17493 | 5117 |
5118 (defun gnus-summary-save-process-mark () | |
5119 "Push the current set of process marked articles on the stack." | |
5120 (interactive) | |
5121 (push (copy-sequence gnus-newsgroup-processable) | |
5122 gnus-newsgroup-process-stack)) | |
5123 | |
5124 (defun gnus-summary-kill-process-mark () | |
5125 "Push the current set of process marked articles on the stack and unmark." | |
5126 (interactive) | |
5127 (gnus-summary-save-process-mark) | |
5128 (gnus-summary-unmark-all-processable)) | |
5129 | |
5130 (defun gnus-summary-yank-process-mark () | |
5131 "Pop the last process mark state off the stack and restore it." | |
5132 (interactive) | |
5133 (unless gnus-newsgroup-process-stack | |
5134 (error "Empty mark stack")) | |
5135 (gnus-summary-process-mark-set (pop gnus-newsgroup-process-stack))) | |
5136 | |
5137 (defun gnus-summary-process-mark-set (set) | |
5138 "Make SET into the current process marked articles." | |
5139 (gnus-summary-unmark-all-processable) | |
5140 (while set | |
5141 (gnus-summary-set-process-mark (pop set)))) | |
5142 | |
5143 ;;; Searching and stuff | |
5144 | |
5145 (defun gnus-summary-search-group (&optional backward use-level) | |
5146 "Search for next unread newsgroup. | |
5147 If optional argument BACKWARD is non-nil, search backward instead." | |
5148 (save-excursion | |
5149 (set-buffer gnus-group-buffer) | |
5150 (when (gnus-group-search-forward | |
5151 backward nil (if use-level (gnus-group-group-level) nil)) | |
5152 (gnus-group-group-name)))) | |
5153 | |
5154 (defun gnus-summary-best-group (&optional exclude-group) | |
5155 "Find the name of the best unread group. | |
5156 If EXCLUDE-GROUP, do not go to this group." | |
5157 (save-excursion | |
5158 (set-buffer gnus-group-buffer) | |
5159 (save-excursion | |
5160 (gnus-group-best-unread-group exclude-group)))) | |
5161 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5162 (defun gnus-summary-find-next (&optional unread article backward undownloaded) |
17493 | 5163 (if backward (gnus-summary-find-prev) |
5164 (let* ((dummy (gnus-summary-article-intangible-p)) | |
5165 (article (or article (gnus-summary-article-number))) | |
5166 (arts (gnus-data-find-list article)) | |
5167 result) | |
5168 (when (and (not dummy) | |
5169 (or (not gnus-summary-check-current) | |
5170 (not unread) | |
5171 (not (gnus-data-unread-p (car arts))))) | |
5172 (setq arts (cdr arts))) | |
5173 (when (setq result | |
5174 (if unread | |
5175 (progn | |
5176 (while arts | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5177 (when (or (and undownloaded |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5178 (eq gnus-undownloaded-mark |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5179 (gnus-data-mark (car arts)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5180 (gnus-data-unread-p (car arts))) |
17493 | 5181 (setq result (car arts) |
5182 arts nil)) | |
5183 (setq arts (cdr arts))) | |
5184 result) | |
5185 (car arts))) | |
5186 (goto-char (gnus-data-pos result)) | |
5187 (gnus-data-number result))))) | |
5188 | |
5189 (defun gnus-summary-find-prev (&optional unread article) | |
5190 (let* ((eobp (eobp)) | |
5191 (article (or article (gnus-summary-article-number))) | |
5192 (arts (gnus-data-find-list article (gnus-data-list 'rev))) | |
5193 result) | |
5194 (when (and (not eobp) | |
5195 (or (not gnus-summary-check-current) | |
5196 (not unread) | |
5197 (not (gnus-data-unread-p (car arts))))) | |
5198 (setq arts (cdr arts))) | |
5199 (when (setq result | |
5200 (if unread | |
5201 (progn | |
5202 (while arts | |
5203 (when (gnus-data-unread-p (car arts)) | |
5204 (setq result (car arts) | |
5205 arts nil)) | |
5206 (setq arts (cdr arts))) | |
5207 result) | |
5208 (car arts))) | |
5209 (goto-char (gnus-data-pos result)) | |
5210 (gnus-data-number result)))) | |
5211 | |
5212 (defun gnus-summary-find-subject (subject &optional unread backward article) | |
5213 (let* ((simp-subject (gnus-simplify-subject-fully subject)) | |
5214 (article (or article (gnus-summary-article-number))) | |
5215 (articles (gnus-data-list backward)) | |
5216 (arts (gnus-data-find-list article articles)) | |
5217 result) | |
5218 (when (or (not gnus-summary-check-current) | |
5219 (not unread) | |
5220 (not (gnus-data-unread-p (car arts)))) | |
5221 (setq arts (cdr arts))) | |
5222 (while arts | |
5223 (and (or (not unread) | |
5224 (gnus-data-unread-p (car arts))) | |
5225 (vectorp (gnus-data-header (car arts))) | |
5226 (gnus-subject-equal | |
5227 simp-subject (mail-header-subject (gnus-data-header (car arts))) t) | |
5228 (setq result (car arts) | |
5229 arts nil)) | |
5230 (setq arts (cdr arts))) | |
5231 (and result | |
5232 (goto-char (gnus-data-pos result)) | |
5233 (gnus-data-number result)))) | |
5234 | |
5235 (defun gnus-summary-search-forward (&optional unread subject backward) | |
5236 "Search forward for an article. | |
5237 If UNREAD, look for unread articles. If SUBJECT, look for | |
5238 articles with that subject. If BACKWARD, search backward instead." | |
5239 (cond (subject (gnus-summary-find-subject subject unread backward)) | |
5240 (backward (gnus-summary-find-prev unread)) | |
5241 (t (gnus-summary-find-next unread)))) | |
5242 | |
5243 (defun gnus-recenter (&optional n) | |
5244 "Center point in window and redisplay frame. | |
5245 Also do horizontal recentering." | |
5246 (interactive "P") | |
5247 (when (and gnus-auto-center-summary | |
5248 (not (eq gnus-auto-center-summary 'vertical))) | |
5249 (gnus-horizontal-recenter)) | |
5250 (recenter n)) | |
5251 | |
5252 (defun gnus-summary-recenter () | |
5253 "Center point in the summary window. | |
5254 If `gnus-auto-center-summary' is nil, or the article buffer isn't | |
5255 displayed, no centering will be performed." | |
5256 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle). | |
5257 ;; 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
|
5258 (interactive) |
17493 | 5259 (let* ((top (cond ((< (window-height) 4) 0) |
5260 ((< (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
|
5261 (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
|
5262 gnus-auto-center-summary |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5263 2)))) |
17493 | 5264 (height (1- (window-height))) |
5265 (bottom (save-excursion (goto-char (point-max)) | |
5266 (forward-line (- height)) | |
5267 (point))) | |
5268 (window (get-buffer-window (current-buffer)))) | |
5269 ;; The user has to want it. | |
5270 (when gnus-auto-center-summary | |
5271 (when (get-buffer-window gnus-article-buffer) | |
5272 ;; Only do recentering when the article buffer is displayed, | |
5273 ;; Set the window start to either `bottom', which is the biggest | |
5274 ;; possible valid number, or the second line from the top, | |
5275 ;; whichever is the least. | |
5276 (set-window-start | |
5277 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
|
5278 (forward-line (- top)) (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5279 t)) |
17493 | 5280 ;; Do horizontal recentering while we're at it. |
5281 (when (and (get-buffer-window (current-buffer) t) | |
5282 (not (eq gnus-auto-center-summary 'vertical))) | |
5283 (let ((selected (selected-window))) | |
5284 (select-window (get-buffer-window (current-buffer) t)) | |
5285 (gnus-summary-position-point) | |
5286 (gnus-horizontal-recenter) | |
5287 (select-window selected)))))) | |
5288 | |
5289 (defun gnus-summary-jump-to-group (newsgroup) | |
5290 "Move point to NEWSGROUP in group mode buffer." | |
5291 ;; Keep update point of group mode buffer if visible. | |
5292 (if (eq (current-buffer) (get-buffer gnus-group-buffer)) | |
5293 (save-window-excursion | |
5294 ;; Take care of tree window mode. | |
5295 (when (get-buffer-window gnus-group-buffer) | |
5296 (pop-to-buffer gnus-group-buffer)) | |
5297 (gnus-group-jump-to-group newsgroup)) | |
5298 (save-excursion | |
5299 ;; Take care of tree window mode. | |
5300 (if (get-buffer-window gnus-group-buffer) | |
5301 (pop-to-buffer gnus-group-buffer) | |
5302 (set-buffer gnus-group-buffer)) | |
5303 (gnus-group-jump-to-group newsgroup)))) | |
5304 | |
5305 ;; This function returns a list of article numbers based on the | |
5306 ;; difference between the ranges of read articles in this group and | |
5307 ;; the range of active articles. | |
5308 (defun gnus-list-of-unread-articles (group) | |
5309 (let* ((read (gnus-info-read (gnus-get-info group))) | |
5310 (active (or (gnus-active group) (gnus-activate-group group))) | |
5311 (last (cdr active)) | |
5312 first nlast unread) | |
5313 ;; If none are read, then all are unread. | |
5314 (if (not read) | |
5315 (setq first (car active)) | |
5316 ;; If the range of read articles is a single range, then the | |
5317 ;; first unread article is the article after the last read | |
5318 ;; 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
|
5319 (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
|
5320 (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
|
5321 (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
|
5322 nil))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5323 (setq first (max (car active) (1+ (cdr read)))) |
17493 | 5324 ;; `read' is a list of ranges. |
5325 (when (/= (setq nlast (or (and (numberp (car read)) (car read)) | |
5326 (caar read))) | |
5327 1) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5328 (setq first (car active))) |
17493 | 5329 (while read |
5330 (when first | |
5331 (while (< first nlast) | |
5332 (push first unread) | |
5333 (setq first (1+ first)))) | |
5334 (setq first (1+ (if (atom (car read)) (car read) (cdar read)))) | |
5335 (setq nlast (if (atom (cadr read)) (cadr read) (caadr read))) | |
5336 (setq read (cdr read))))) | |
5337 ;; And add the last unread articles. | |
5338 (while (<= first last) | |
5339 (push first unread) | |
5340 (setq first (1+ first))) | |
5341 ;; 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
|
5342 (delq 0 (nreverse unread)))) |
17493 | 5343 |
5344 (defun gnus-list-of-read-articles (group) | |
5345 "Return a list of unread, unticked and non-dormant articles." | |
5346 (let* ((info (gnus-get-info group)) | |
5347 (marked (gnus-info-marks info)) | |
5348 (active (gnus-active group))) | |
5349 (and info active | |
5350 (gnus-set-difference | |
5351 (gnus-sorted-complement | |
5352 (gnus-uncompress-range active) | |
5353 (gnus-list-of-unread-articles group)) | |
5354 (append | |
5355 (gnus-uncompress-range (cdr (assq 'dormant marked))) | |
5356 (gnus-uncompress-range (cdr (assq 'tick marked)))))))) | |
5357 | |
5358 ;; Various summary commands | |
5359 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5360 (defun gnus-summary-select-article-buffer () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5361 "Reconfigure windows to show article buffer." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5362 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5363 (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
|
5364 (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
|
5365 (gnus-configure-windows 'article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5366 (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
|
5367 |
17493 | 5368 (defun gnus-summary-universal-argument (arg) |
5369 "Perform any operation on all articles that are process/prefixed." | |
5370 (interactive "P") | |
5371 (let ((articles (gnus-summary-work-articles arg)) | |
5372 func article) | |
5373 (if (eq | |
5374 (setq | |
5375 func | |
5376 (key-binding | |
5377 (read-key-sequence | |
5378 (substitute-command-keys | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5379 "\\<gnus-summary-mode-map>\\[gnus-summary-universal-argument]")))) |
17493 | 5380 'undefined) |
5381 (gnus-error 1 "Undefined key") | |
5382 (save-excursion | |
5383 (while articles | |
5384 (gnus-summary-goto-subject (setq article (pop articles))) | |
5385 (let (gnus-newsgroup-processable) | |
5386 (command-execute func)) | |
5387 (gnus-summary-remove-process-mark article))))) | |
5388 (gnus-summary-position-point)) | |
5389 | |
5390 (defun gnus-summary-toggle-truncation (&optional arg) | |
5391 "Toggle truncation of summary lines. | |
5392 With arg, turn line truncation on iff arg is positive." | |
5393 (interactive "P") | |
5394 (setq truncate-lines | |
5395 (if (null arg) (not truncate-lines) | |
5396 (> (prefix-numeric-value arg) 0))) | |
5397 (redraw-display)) | |
5398 | |
5399 (defun gnus-summary-reselect-current-group (&optional all rescan) | |
5400 "Exit and then reselect the current newsgroup. | |
5401 The prefix argument ALL means to select all articles." | |
5402 (interactive "P") | |
5403 (when (gnus-ephemeral-group-p gnus-newsgroup-name) | |
5404 (error "Ephemeral groups can't be reselected")) | |
5405 (let ((current-subject (gnus-summary-article-number)) | |
5406 (group gnus-newsgroup-name)) | |
5407 (setq gnus-newsgroup-begin nil) | |
5408 (gnus-summary-exit) | |
5409 ;; We have to adjust the point of group mode buffer because | |
5410 ;; point was moved to the next unread newsgroup by exiting. | |
5411 (gnus-summary-jump-to-group group) | |
5412 (when rescan | |
5413 (save-excursion | |
5414 (gnus-group-get-new-news-this-group 1))) | |
5415 (gnus-group-read-group all t) | |
5416 (gnus-summary-goto-subject current-subject nil t))) | |
5417 | |
5418 (defun gnus-summary-rescan-group (&optional all) | |
5419 "Exit the newsgroup, ask for new articles, and select the newsgroup." | |
5420 (interactive "P") | |
5421 (gnus-summary-reselect-current-group all t)) | |
5422 | |
5423 (defun gnus-summary-update-info (&optional non-destructive) | |
5424 (save-excursion | |
5425 (let ((group gnus-newsgroup-name)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5426 (when group |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5427 (when gnus-newsgroup-kill-headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5428 (setq gnus-newsgroup-killed |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5429 (gnus-compress-sequence |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5430 (nconc |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5431 (gnus-set-sorted-intersection |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5432 (gnus-uncompress-range gnus-newsgroup-killed) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5433 (setq gnus-newsgroup-unselected |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5434 (sort gnus-newsgroup-unselected '<))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5435 (setq gnus-newsgroup-unreads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5436 (sort gnus-newsgroup-unreads '<))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5437 t))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5438 (unless (listp (cdr gnus-newsgroup-killed)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5439 (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
|
5440 (let ((headers gnus-newsgroup-headers)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5441 ;; 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
|
5442 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5443 (set-buffer gnus-group-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5444 (gnus-undo-force-boundary)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5445 (gnus-update-read-articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5446 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
|
5447 ;; Set the current article marks. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5448 (let ((gnus-newsgroup-scored |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5449 (if (and (not gnus-save-score) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5450 (not non-destructive)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5451 nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5452 gnus-newsgroup-scored))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5453 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5454 (gnus-update-marks))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5455 ;; Do the cross-ref thing. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5456 (when gnus-use-cross-reference |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5457 (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
|
5458 ;; 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
|
5459 (set-buffer gnus-group-buffer) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5460 (unless (gnus-ephemeral-group-p group) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5461 (gnus-group-update-group group))))))) |
17493 | 5462 |
5463 (defun gnus-summary-save-newsrc (&optional force) | |
5464 "Save the current number of read/marked articles in the dribble buffer. | |
5465 The dribble buffer will then be saved. | |
5466 If FORCE (the prefix), also save the .newsrc file(s)." | |
5467 (interactive "P") | |
5468 (gnus-summary-update-info t) | |
5469 (if force | |
5470 (gnus-save-newsrc-file) | |
5471 (gnus-dribble-save))) | |
5472 | |
5473 (defun gnus-summary-exit (&optional temporary) | |
5474 "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
|
5475 `gnus-exit-group-hook' is called with no arguments if that value is non-nil." |
17493 | 5476 (interactive) |
5477 (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
|
5478 (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
|
5479 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5480 (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
|
5481 (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
|
5482 ;; 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
|
5483 (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
|
5484 (setq gnus-article-mime-handles nil))) |
17493 | 5485 (gnus-kill-save-kill-buffer) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5486 (gnus-async-halt-prefetch) |
17493 | 5487 (let* ((group gnus-newsgroup-name) |
5488 (quit-config (gnus-group-quit-config gnus-newsgroup-name)) | |
5489 (mode major-mode) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5490 (group-point nil) |
17493 | 5491 (buf (current-buffer))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5492 (unless quit-config |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5493 ;; 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
|
5494 (when gnus-newsgroup-adaptive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5495 (gnus-score-adaptive)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5496 (when gnus-use-scoring |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5497 (gnus-score-save))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5498 (gnus-run-hooks 'gnus-summary-prepare-exit-hook) |
17493 | 5499 ;; If we have several article buffers, we kill them at exit. |
5500 (unless gnus-single-article-buffer | |
5501 (gnus-kill-buffer gnus-original-article-buffer) | |
5502 (setq gnus-article-current nil)) | |
5503 (when gnus-use-cache | |
5504 (gnus-cache-possibly-remove-articles) | |
5505 (gnus-cache-save-buffers)) | |
5506 (gnus-async-prefetch-remove-group group) | |
5507 (when gnus-suppress-duplicates | |
5508 (gnus-dup-enter-articles)) | |
5509 (when gnus-use-trees | |
5510 (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
|
5511 (when gnus-use-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5512 (gnus-cache-write-active)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5513 ;; Remove entries for this group. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5514 (nnmail-purge-split-history (gnus-group-real-name group)) |
17493 | 5515 ;; Make all changes in this group permanent. |
5516 (unless quit-config | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5517 (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
|
5518 (gnus-summary-update-info)) |
17493 | 5519 (gnus-close-group group) |
5520 ;; Make sure where we were, and go to next newsgroup. | |
5521 (set-buffer gnus-group-buffer) | |
5522 (unless quit-config | |
5523 (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
|
5524 (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
|
5525 (unless (or quit-config |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5526 ;; 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
|
5527 ;; buffer, don't skip forwards. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5528 (not (string= group (gnus-group-group-name)))) |
17493 | 5529 (gnus-group-next-unread-group 1)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5530 (setq group-point (point)) |
17493 | 5531 (if temporary |
5532 nil ;Nothing to do. | |
5533 ;; If we have several article buffers, we kill them at exit. | |
5534 (unless gnus-single-article-buffer | |
5535 (gnus-kill-buffer gnus-article-buffer) | |
5536 (gnus-kill-buffer gnus-original-article-buffer) | |
5537 (setq gnus-article-current nil)) | |
5538 (set-buffer buf) | |
5539 (if (not gnus-kill-summary-on-exit) | |
5540 (gnus-deaden-summary) | |
5541 ;; We set all buffer-local variables to nil. It is unclear why | |
5542 ;; this is needed, but if we don't, buffer-local variables are | |
5543 ;; not garbage-collected, it seems. This would the lead to en | |
5544 ;; ever-growing Emacs. | |
5545 (gnus-summary-clear-local-variables) | |
5546 (when (get-buffer gnus-article-buffer) | |
5547 (bury-buffer gnus-article-buffer)) | |
5548 ;; We clear the global counterparts of the buffer-local | |
5549 ;; variables as well, just to be on the safe side. | |
5550 (set-buffer gnus-group-buffer) | |
5551 (gnus-summary-clear-local-variables) | |
5552 ;; Return to group mode buffer. | |
5553 (when (eq mode 'gnus-summary-mode) | |
5554 (gnus-kill-buffer buf))) | |
5555 (setq gnus-current-select-method gnus-select-method) | |
5556 (pop-to-buffer gnus-group-buffer) | |
5557 (if (not quit-config) | |
5558 (progn | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5559 (goto-char group-point) |
17493 | 5560 (gnus-configure-windows 'group 'force)) |
5561 (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
|
5562 ;; Clear the current group name. |
17493 | 5563 (unless quit-config |
5564 (setq gnus-newsgroup-name nil))))) | |
5565 | |
5566 (defalias 'gnus-summary-quit 'gnus-summary-exit-no-update) | |
5567 (defun gnus-summary-exit-no-update (&optional no-questions) | |
5568 "Quit reading current newsgroup without updating read article info." | |
5569 (interactive) | |
5570 (let* ((group gnus-newsgroup-name) | |
5571 (quit-config (gnus-group-quit-config group))) | |
5572 (when (or no-questions | |
5573 gnus-expert-user | |
5574 (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
|
5575 (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
|
5576 (mapcar 'funcall |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5577 (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
|
5578 (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
|
5579 (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
|
5580 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5581 (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
|
5582 (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
|
5583 ;; 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
|
5584 (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
|
5585 (setq gnus-article-mime-handles nil))) |
17493 | 5586 ;; If we have several article buffers, we kill them at exit. |
5587 (unless gnus-single-article-buffer | |
5588 (gnus-kill-buffer gnus-article-buffer) | |
5589 (gnus-kill-buffer gnus-original-article-buffer) | |
5590 (setq gnus-article-current nil)) | |
5591 (if (not gnus-kill-summary-on-exit) | |
5592 (gnus-deaden-summary) | |
5593 (gnus-close-group group) | |
5594 (gnus-summary-clear-local-variables) | |
5595 (set-buffer gnus-group-buffer) | |
5596 (gnus-summary-clear-local-variables) | |
5597 (when (get-buffer gnus-summary-buffer) | |
5598 (kill-buffer gnus-summary-buffer))) | |
5599 (unless gnus-single-article-buffer | |
5600 (setq gnus-article-current nil)) | |
5601 (when gnus-use-trees | |
5602 (gnus-tree-close group)) | |
5603 (gnus-async-prefetch-remove-group group) | |
5604 (when (get-buffer gnus-article-buffer) | |
5605 (bury-buffer gnus-article-buffer)) | |
5606 ;; Return to the group buffer. | |
5607 (gnus-configure-windows 'group 'force) | |
5608 ;; Clear the current group name. | |
5609 (setq gnus-newsgroup-name nil) | |
5610 (when (equal (gnus-group-group-name) group) | |
5611 (gnus-group-next-unread-group 1)) | |
5612 (when quit-config | |
5613 (gnus-handle-ephemeral-exit quit-config))))) | |
5614 | |
5615 (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
|
5616 "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
|
5617 The state which existed when entering the ephemeral is reset." |
17493 | 5618 (if (not (buffer-name (car quit-config))) |
5619 (gnus-configure-windows 'group 'force) | |
5620 (set-buffer (car quit-config)) | |
5621 (cond ((eq major-mode 'gnus-summary-mode) | |
5622 (gnus-set-global-variables)) | |
5623 ((eq major-mode 'gnus-article-mode) | |
5624 (save-excursion | |
5625 ;; The `gnus-summary-buffer' variable may point | |
5626 ;; to the old summary buffer when using a single | |
5627 ;; article buffer. | |
5628 (unless (gnus-buffer-live-p gnus-summary-buffer) | |
5629 (set-buffer gnus-group-buffer)) | |
5630 (set-buffer gnus-summary-buffer) | |
5631 (gnus-set-global-variables)))) | |
5632 (if (or (eq (cdr quit-config) 'article) | |
5633 (eq (cdr quit-config) 'pick)) | |
5634 (progn | |
5635 ;; The current article may be from the ephemeral group | |
5636 ;; thus it is best that we reload this article | |
5637 (gnus-summary-show-article) | |
5638 (if (and (boundp 'gnus-pick-mode) (symbol-value 'gnus-pick-mode)) | |
5639 (gnus-configure-windows 'pick 'force) | |
5640 (gnus-configure-windows (cdr quit-config) 'force))) | |
5641 (gnus-configure-windows (cdr quit-config) 'force)) | |
5642 (when (eq major-mode 'gnus-summary-mode) | |
5643 (gnus-summary-next-subject 1 nil t) | |
5644 (gnus-summary-recenter) | |
5645 (gnus-summary-position-point)))) | |
5646 | |
5647 ;;; Dead summaries. | |
5648 | |
5649 (defvar gnus-dead-summary-mode-map nil) | |
5650 | |
5651 (unless gnus-dead-summary-mode-map | |
5652 (setq gnus-dead-summary-mode-map (make-keymap)) | |
5653 (suppress-keymap gnus-dead-summary-mode-map) | |
5654 (substitute-key-definition | |
5655 '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
|
5656 (let ((keys '("\C-d" "\r" "\177" [delete]))) |
17493 | 5657 (while keys |
5658 (define-key gnus-dead-summary-mode-map | |
5659 (pop keys) 'gnus-summary-wake-up-the-dead)))) | |
5660 | |
5661 (defvar gnus-dead-summary-mode nil | |
5662 "Minor mode for Gnus summary buffers.") | |
5663 | |
5664 (defun gnus-dead-summary-mode (&optional arg) | |
5665 "Minor mode for Gnus summary buffers." | |
5666 (interactive "P") | |
5667 (when (eq major-mode 'gnus-summary-mode) | |
5668 (make-local-variable 'gnus-dead-summary-mode) | |
5669 (setq gnus-dead-summary-mode | |
5670 (if (null arg) (not gnus-dead-summary-mode) | |
5671 (> (prefix-numeric-value arg) 0))) | |
5672 (when gnus-dead-summary-mode | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5673 (gnus-add-minor-mode |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5674 'gnus-dead-summary-mode " Dead" gnus-dead-summary-mode-map)))) |
17493 | 5675 |
5676 (defun gnus-deaden-summary () | |
5677 "Make the current summary buffer into a dead summary buffer." | |
5678 ;; Kill any previous dead summary buffer. | |
5679 (when (and gnus-dead-summary | |
5680 (buffer-name gnus-dead-summary)) | |
5681 (save-excursion | |
5682 (set-buffer gnus-dead-summary) | |
5683 (when gnus-dead-summary-mode | |
5684 (kill-buffer (current-buffer))))) | |
5685 ;; Make this the current dead summary. | |
5686 (setq gnus-dead-summary (current-buffer)) | |
5687 (gnus-dead-summary-mode 1) | |
5688 (let ((name (buffer-name))) | |
5689 (when (string-match "Summary" name) | |
5690 (rename-buffer | |
5691 (concat (substring name 0 (match-beginning 0)) "Dead " | |
5692 (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
|
5693 t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5694 (bury-buffer)))) |
17493 | 5695 |
5696 (defun gnus-kill-or-deaden-summary (buffer) | |
5697 "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
|
5698 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5699 (when (and (buffer-name buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5700 (not gnus-single-article-buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5701 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5702 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5703 (gnus-kill-buffer gnus-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5704 (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
|
5705 (cond (gnus-kill-summary-on-exit |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5706 (when (and gnus-use-trees |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5707 (gnus-buffer-exists-p buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5708 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5709 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5710 (gnus-tree-close gnus-newsgroup-name))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5711 (gnus-kill-buffer buffer)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5712 ((gnus-buffer-exists-p buffer) |
17493 | 5713 (save-excursion |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5714 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5715 (gnus-deaden-summary)))))) |
17493 | 5716 |
5717 (defun gnus-summary-wake-up-the-dead (&rest args) | |
5718 "Wake up the dead summary buffer." | |
5719 (interactive) | |
5720 (gnus-dead-summary-mode -1) | |
5721 (let ((name (buffer-name))) | |
5722 (when (string-match "Dead " name) | |
5723 (rename-buffer | |
5724 (concat (substring name 0 (match-beginning 0)) | |
5725 (substring name (match-end 0))) | |
5726 t))) | |
5727 (gnus-message 3 "This dead summary is now alive again")) | |
5728 | |
5729 ;; Suggested by Andrew Eskilsson <pi92ae@pt.hk-r.se>. | |
5730 (defun gnus-summary-fetch-faq (&optional faq-dir) | |
5731 "Fetch the FAQ for the current group. | |
5732 If FAQ-DIR (the prefix), prompt for a directory to search for the faq | |
5733 in." | |
5734 (interactive | |
5735 (list | |
5736 (when current-prefix-arg | |
5737 (completing-read | |
5738 "Faq dir: " (and (listp gnus-group-faq-directory) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5739 (mapcar (lambda (file) (list file)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5740 gnus-group-faq-directory)))))) |
17493 | 5741 (let (gnus-faq-buffer) |
5742 (when (setq gnus-faq-buffer | |
5743 (gnus-group-fetch-faq gnus-newsgroup-name faq-dir)) | |
5744 (gnus-configure-windows 'summary-faq)))) | |
5745 | |
5746 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>. | |
5747 (defun gnus-summary-describe-group (&optional force) | |
5748 "Describe the current newsgroup." | |
5749 (interactive "P") | |
5750 (gnus-group-describe-group force gnus-newsgroup-name)) | |
5751 | |
5752 (defun gnus-summary-describe-briefly () | |
5753 "Describe summary mode commands briefly." | |
5754 (interactive) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5755 (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 | 5756 |
5757 ;; Walking around group mode buffer from summary mode. | |
5758 | |
5759 (defun gnus-summary-next-group (&optional no-article target-group backward) | |
5760 "Exit current newsgroup and then select next unread newsgroup. | |
5761 If prefix argument NO-ARTICLE is non-nil, no article is selected | |
5762 initially. If NEXT-GROUP, go to this group. If BACKWARD, go to | |
5763 previous group instead." | |
5764 (interactive "P") | |
5765 ;; Stop pre-fetching. | |
5766 (gnus-async-halt-prefetch) | |
5767 (let ((current-group gnus-newsgroup-name) | |
5768 (current-buffer (current-buffer)) | |
5769 entered) | |
5770 ;; First we semi-exit this group to update Xrefs and all variables. | |
5771 ;; We can't do a real exit, because the window conf must remain | |
5772 ;; the same in case the user is prompted for info, and we don't | |
5773 ;; want the window conf to change before that... | |
5774 (gnus-summary-exit t) | |
5775 (while (not entered) | |
5776 ;; Then we find what group we are supposed to enter. | |
5777 (set-buffer gnus-group-buffer) | |
5778 (gnus-group-jump-to-group current-group) | |
5779 (setq target-group | |
5780 (or target-group | |
5781 (if (eq gnus-keep-same-level 'best) | |
5782 (gnus-summary-best-group gnus-newsgroup-name) | |
5783 (gnus-summary-search-group backward gnus-keep-same-level)))) | |
5784 (if (not target-group) | |
5785 ;; There are no further groups, so we return to the group | |
5786 ;; buffer. | |
5787 (progn | |
5788 (gnus-message 5 "Returning to the group buffer") | |
5789 (setq entered t) | |
5790 (when (gnus-buffer-live-p current-buffer) | |
5791 (set-buffer current-buffer) | |
5792 (gnus-summary-exit)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5793 (gnus-run-hooks 'gnus-group-no-more-groups-hook)) |
17493 | 5794 ;; We try to enter the target group. |
5795 (gnus-group-jump-to-group target-group) | |
5796 (let ((unreads (gnus-group-group-unread))) | |
5797 (if (and (or (eq t unreads) | |
5798 (and unreads (not (zerop unreads)))) | |
5799 (gnus-summary-read-group | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5800 target-group nil no-article |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5801 (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
|
5802 nil backward)) |
17493 | 5803 (setq entered t) |
5804 (setq current-group target-group | |
5805 target-group nil))))))) | |
5806 | |
5807 (defun gnus-summary-prev-group (&optional no-article) | |
5808 "Exit current newsgroup and then select previous unread newsgroup. | |
5809 If prefix argument NO-ARTICLE is non-nil, no article is selected initially." | |
5810 (interactive "P") | |
5811 (gnus-summary-next-group no-article nil t)) | |
5812 | |
5813 ;; Walking around summary lines. | |
5814 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5815 (defun gnus-summary-first-subject (&optional unread undownloaded) |
17493 | 5816 "Go to the first unread subject. |
5817 If UNREAD is non-nil, go to the first unread article. | |
5818 Returns the article selected or nil if there are no unread articles." | |
5819 (interactive "P") | |
5820 (prog1 | |
5821 (cond | |
5822 ;; Empty summary. | |
5823 ((null gnus-newsgroup-data) | |
5824 (gnus-message 3 "No articles in the group") | |
5825 nil) | |
5826 ;; Pick the first article. | |
5827 ((not unread) | |
5828 (goto-char (gnus-data-pos (car gnus-newsgroup-data))) | |
5829 (gnus-data-number (car gnus-newsgroup-data))) | |
5830 ;; No unread articles. | |
5831 ((null gnus-newsgroup-unreads) | |
5832 (gnus-message 3 "No more unread articles") | |
5833 nil) | |
5834 ;; Find the first unread article. | |
5835 (t | |
5836 (let ((data gnus-newsgroup-data)) | |
5837 (while (and data | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5838 (and (not (and undownloaded |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5839 (eq gnus-undownloaded-mark |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5840 (gnus-data-mark (car data))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5841 (not (gnus-data-unread-p (car data))))) |
17493 | 5842 (setq data (cdr data))) |
5843 (when data | |
5844 (goto-char (gnus-data-pos (car data))) | |
5845 (gnus-data-number (car data)))))) | |
5846 (gnus-summary-position-point))) | |
5847 | |
5848 (defun gnus-summary-next-subject (n &optional unread dont-display) | |
5849 "Go to next N'th summary line. | |
5850 If N is negative, go to the previous N'th subject line. | |
5851 If UNREAD is non-nil, only unread articles are selected. | |
5852 The difference between N and the actual number of steps taken is | |
5853 returned." | |
5854 (interactive "p") | |
5855 (let ((backward (< n 0)) | |
5856 (n (abs n))) | |
5857 (while (and (> n 0) | |
5858 (if backward | |
5859 (gnus-summary-find-prev unread) | |
5860 (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
|
5861 (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
|
5862 (gnus-summary-show-thread))) |
17493 | 5863 (when (/= 0 n) |
5864 (gnus-message 7 "No more%s articles" | |
5865 (if unread " unread" ""))) | |
5866 (unless dont-display | |
5867 (gnus-summary-recenter) | |
5868 (gnus-summary-position-point)) | |
5869 n)) | |
5870 | |
5871 (defun gnus-summary-next-unread-subject (n) | |
5872 "Go to next N'th unread summary line." | |
5873 (interactive "p") | |
5874 (gnus-summary-next-subject n t)) | |
5875 | |
5876 (defun gnus-summary-prev-subject (n &optional unread) | |
5877 "Go to previous N'th summary line. | |
5878 If optional argument UNREAD is non-nil, only unread article is selected." | |
5879 (interactive "p") | |
5880 (gnus-summary-next-subject (- n) unread)) | |
5881 | |
5882 (defun gnus-summary-prev-unread-subject (n) | |
5883 "Go to previous N'th unread summary line." | |
5884 (interactive "p") | |
5885 (gnus-summary-next-subject (- n) t)) | |
5886 | |
5887 (defun gnus-summary-goto-subject (article &optional force silent) | |
5888 "Go the subject line of ARTICLE. | |
5889 If FORCE, also allow jumping to articles not currently shown." | |
5890 (interactive "nArticle number: ") | |
5891 (let ((b (point)) | |
5892 (data (gnus-data-find article))) | |
5893 ;; We read in the article if we have to. | |
5894 (and (not data) | |
5895 force | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5896 (gnus-summary-insert-subject |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5897 article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
5898 (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
|
5899 t) |
17493 | 5900 (setq data (gnus-data-find article))) |
5901 (goto-char b) | |
5902 (if (not data) | |
5903 (progn | |
5904 (unless silent | |
5905 (gnus-message 3 "Can't find article %d" article)) | |
5906 nil) | |
5907 (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
|
5908 (gnus-summary-position-point) |
17493 | 5909 article))) |
5910 | |
5911 ;; Walking around summary lines with displaying articles. | |
5912 | |
5913 (defun gnus-summary-expand-window (&optional arg) | |
5914 "Make the summary buffer take up the entire Emacs frame. | |
5915 Given a prefix, will force an `article' buffer configuration." | |
5916 (interactive "P") | |
5917 (if arg | |
5918 (gnus-configure-windows 'article 'force) | |
5919 (gnus-configure-windows 'summary 'force))) | |
5920 | |
5921 (defun gnus-summary-display-article (article &optional all-header) | |
5922 "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
|
5923 (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
|
5924 (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
|
5925 (mm-enable-multibyte-mule4))) |
17493 | 5926 (gnus-set-global-variables) |
5927 (if (null article) | |
5928 nil | |
5929 (prog1 | |
5930 (if gnus-summary-display-article-function | |
5931 (funcall gnus-summary-display-article-function article all-header) | |
5932 (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
|
5933 (gnus-run-hooks 'gnus-select-article-hook) |
17493 | 5934 (when (and gnus-current-article |
5935 (not (zerop gnus-current-article))) | |
5936 (gnus-summary-goto-subject gnus-current-article)) | |
5937 (gnus-summary-recenter) | |
5938 (when (and gnus-use-trees gnus-show-threads) | |
5939 (gnus-possibly-generate-tree article) | |
5940 (gnus-highlight-selected-tree article)) | |
5941 ;; Successfully display article. | |
5942 (gnus-article-set-window-start | |
5943 (cdr (assq article gnus-newsgroup-bookmarks)))))) | |
5944 | |
5945 (defun gnus-summary-select-article (&optional all-headers force pseudo article) | |
5946 "Select the current article. | |
5947 If ALL-HEADERS is non-nil, show all header fields. If FORCE is | |
5948 non-nil, the article will be re-fetched even if it already present in | |
5949 the article buffer. If PSEUDO is non-nil, pseudo-articles will also | |
5950 be displayed." | |
5951 ;; Make sure we are in the summary buffer to work around bbdb bug. | |
5952 (unless (eq major-mode 'gnus-summary-mode) | |
5953 (set-buffer gnus-summary-buffer)) | |
5954 (let ((article (or article (gnus-summary-article-number))) | |
5955 (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
|
5956 gnus-summary-display-article-function) |
17493 | 5957 (and (not pseudo) |
5958 (gnus-summary-article-pseudo-p article) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
5959 (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
|
5960 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5961 (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
|
5962 (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
|
5963 (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
|
5964 (null gnus-article-current) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5965 (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
|
5966 (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
|
5967 (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
|
5968 gnus-newsgroup-name)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5969 (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
|
5970 (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
|
5971 (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
|
5972 force) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5973 ;; 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
|
5974 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5975 (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
|
5976 (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
|
5977 (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
|
5978 (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
|
5979 (mm-disable-multibyte-mule4)))) |
17493 | 5980 (when (or all-headers gnus-show-all-headers) |
5981 (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
|
5982 (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
|
5983 (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
|
5984 article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
5985 (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
|
5986 (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
|
5987 'old)))) |
17493 | 5988 |
5989 (defun gnus-summary-set-current-mark (&optional current-mark) | |
5990 "Obsolete function." | |
5991 nil) | |
5992 | |
5993 (defun gnus-summary-next-article (&optional unread subject backward push) | |
5994 "Select the next article. | |
5995 If UNREAD, only unread articles are selected. | |
5996 If SUBJECT, only articles with SUBJECT are selected. | |
5997 If BACKWARD, the previous article is selected instead of the next." | |
5998 (interactive "P") | |
5999 (cond | |
6000 ;; Is there such an article? | |
6001 ((and (gnus-summary-search-forward unread subject backward) | |
6002 (or (gnus-summary-display-article (gnus-summary-article-number)) | |
6003 (eq (gnus-summary-article-mark) gnus-canceled-mark))) | |
6004 (gnus-summary-position-point)) | |
6005 ;; If not, we try the first unread, if that is wanted. | |
6006 ((and subject | |
6007 gnus-auto-select-same | |
6008 (gnus-summary-first-unread-article)) | |
6009 (gnus-summary-position-point) | |
6010 (gnus-message 6 "Wrapped")) | |
6011 ;; Try to get next/previous article not displayed in this group. | |
6012 ((and gnus-auto-extend-newsgroup | |
6013 (not unread) (not subject)) | |
6014 (gnus-summary-goto-article | |
6015 (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
|
6016 nil (count-lines (point-min) (point)))) |
17493 | 6017 ;; Go to next/previous group. |
6018 (t | |
6019 (unless (gnus-ephemeral-group-p gnus-newsgroup-name) | |
6020 (gnus-summary-jump-to-group gnus-newsgroup-name)) | |
6021 (let ((cmd last-command-char) | |
6022 (point | |
6023 (save-excursion | |
6024 (set-buffer gnus-group-buffer) | |
6025 (point))) | |
6026 (group | |
6027 (if (eq gnus-keep-same-level 'best) | |
6028 (gnus-summary-best-group gnus-newsgroup-name) | |
6029 (gnus-summary-search-group backward gnus-keep-same-level)))) | |
6030 ;; For some reason, the group window gets selected. We change | |
6031 ;; it back. | |
6032 (select-window (get-buffer-window (current-buffer))) | |
6033 ;; Select next unread newsgroup automagically. | |
6034 (cond | |
6035 ((or (not gnus-auto-select-next) | |
6036 (not cmd)) | |
6037 (gnus-message 7 "No more%s articles" (if unread " unread" ""))) | |
6038 ((or (eq gnus-auto-select-next 'quietly) | |
6039 (and (eq gnus-auto-select-next 'slightly-quietly) | |
6040 push) | |
6041 (and (eq gnus-auto-select-next 'almost-quietly) | |
6042 (gnus-summary-last-article-p))) | |
6043 ;; Select quietly. | |
6044 (if (gnus-ephemeral-group-p gnus-newsgroup-name) | |
6045 (gnus-summary-exit) | |
6046 (gnus-message 7 "No more%s articles (%s)..." | |
6047 (if unread " unread" "") | |
6048 (if group (concat "selecting " group) | |
6049 "exiting")) | |
6050 (gnus-summary-next-group nil group backward))) | |
6051 (t | |
6052 (when (gnus-key-press-event-p last-input-event) | |
6053 (gnus-summary-walk-group-buffer | |
6054 gnus-newsgroup-name cmd unread backward point)))))))) | |
6055 | |
6056 (defun gnus-summary-walk-group-buffer (from-group cmd unread backward start) | |
6057 (let ((keystrokes '((?\C-n (gnus-group-next-unread-group 1)) | |
6058 (?\C-p (gnus-group-prev-unread-group 1)))) | |
6059 (cursor-in-echo-area t) | |
6060 keve key group ended) | |
6061 (save-excursion | |
6062 (set-buffer gnus-group-buffer) | |
6063 (goto-char start) | |
6064 (setq group | |
6065 (if (eq gnus-keep-same-level 'best) | |
6066 (gnus-summary-best-group gnus-newsgroup-name) | |
6067 (gnus-summary-search-group backward gnus-keep-same-level)))) | |
6068 (while (not ended) | |
6069 (gnus-message | |
6070 5 "No more%s articles%s" (if unread " unread" "") | |
6071 (if (and group | |
6072 (not (gnus-ephemeral-group-p gnus-newsgroup-name))) | |
6073 (format " (Type %s for %s [%s])" | |
6074 (single-key-description cmd) group | |
6075 (car (gnus-gethash group gnus-newsrc-hashtb))) | |
6076 (format " (Type %s to exit %s)" | |
6077 (single-key-description cmd) | |
6078 gnus-newsgroup-name))) | |
6079 ;; Confirm auto selection. | |
6080 (setq key (car (setq keve (gnus-read-event-char)))) | |
6081 (setq ended t) | |
6082 (cond | |
6083 ((assq key keystrokes) | |
6084 (let ((obuf (current-buffer))) | |
6085 (switch-to-buffer gnus-group-buffer) | |
6086 (when group | |
6087 (gnus-group-jump-to-group group)) | |
6088 (eval (cadr (assq key keystrokes))) | |
6089 (setq group (gnus-group-group-name)) | |
6090 (switch-to-buffer obuf)) | |
6091 (setq ended nil)) | |
6092 ((equal key cmd) | |
6093 (if (or (not group) | |
6094 (gnus-ephemeral-group-p gnus-newsgroup-name)) | |
6095 (gnus-summary-exit) | |
6096 (gnus-summary-next-group nil group backward))) | |
6097 (t | |
6098 (push (cdr keve) unread-command-events)))))) | |
6099 | |
6100 (defun gnus-summary-next-unread-article () | |
6101 "Select unread article after current one." | |
6102 (interactive) | |
6103 (gnus-summary-next-article | |
6104 (or (not (eq gnus-summary-goto-unread 'never)) | |
6105 (gnus-summary-last-article-p (gnus-summary-article-number))) | |
6106 (and gnus-auto-select-same | |
6107 (gnus-summary-article-subject)))) | |
6108 | |
6109 (defun gnus-summary-prev-article (&optional unread subject) | |
6110 "Select the article after the current one. | |
6111 If UNREAD is non-nil, only unread articles are selected." | |
6112 (interactive "P") | |
6113 (gnus-summary-next-article unread subject t)) | |
6114 | |
6115 (defun gnus-summary-prev-unread-article () | |
6116 "Select unread article before current one." | |
6117 (interactive) | |
6118 (gnus-summary-prev-article | |
6119 (or (not (eq gnus-summary-goto-unread 'never)) | |
6120 (gnus-summary-first-article-p (gnus-summary-article-number))) | |
6121 (and gnus-auto-select-same | |
6122 (gnus-summary-article-subject)))) | |
6123 | |
6124 (defun gnus-summary-next-page (&optional lines circular) | |
6125 "Show next page of the selected article. | |
6126 If at the end of the current article, select the next article. | |
6127 LINES says how many lines should be scrolled up. | |
6128 | |
6129 If CIRCULAR is non-nil, go to the start of the article instead of | |
6130 selecting the next article when reaching the end of the current | |
6131 article." | |
6132 (interactive "P") | |
6133 (setq gnus-summary-buffer (current-buffer)) | |
6134 (gnus-set-global-variables) | |
6135 (let ((article (gnus-summary-article-number)) | |
6136 (article-window (get-buffer-window gnus-article-buffer t)) | |
6137 endp) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6138 ;; 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
|
6139 (unless article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6140 (error "No article to select")) |
17493 | 6141 (gnus-configure-windows 'article) |
6142 (if (eq (cdr (assq article gnus-newsgroup-reads)) gnus-canceled-mark) | |
6143 (if (and (eq gnus-summary-goto-unread 'never) | |
6144 (not (gnus-summary-last-article-p article))) | |
6145 (gnus-summary-next-article) | |
6146 (gnus-summary-next-unread-article)) | |
6147 (if (or (null gnus-current-article) | |
6148 (null gnus-article-current) | |
6149 (/= article (cdr gnus-article-current)) | |
6150 (not (equal (car gnus-article-current) gnus-newsgroup-name))) | |
6151 ;; Selected subject is different from current article's. | |
6152 (gnus-summary-display-article article) | |
6153 (when article-window | |
6154 (gnus-eval-in-buffer-window gnus-article-buffer | |
6155 (setq endp (gnus-article-next-page lines))) | |
6156 (when endp | |
6157 (cond (circular | |
6158 (gnus-summary-beginning-of-article)) | |
6159 (lines | |
6160 (gnus-message 3 "End of message")) | |
6161 ((null lines) | |
6162 (if (and (eq gnus-summary-goto-unread 'never) | |
6163 (not (gnus-summary-last-article-p article))) | |
6164 (gnus-summary-next-article) | |
6165 (gnus-summary-next-unread-article)))))))) | |
6166 (gnus-summary-recenter) | |
6167 (gnus-summary-position-point))) | |
6168 | |
6169 (defun gnus-summary-prev-page (&optional lines move) | |
6170 "Show previous page of selected article. | |
6171 Argument LINES specifies lines to be scrolled down. | |
6172 If MOVE, move to the previous unread article if point is at | |
6173 the beginning of the buffer." | |
6174 (interactive "P") | |
6175 (let ((article (gnus-summary-article-number)) | |
6176 (article-window (get-buffer-window gnus-article-buffer t)) | |
6177 endp) | |
6178 (gnus-configure-windows 'article) | |
6179 (if (or (null gnus-current-article) | |
6180 (null gnus-article-current) | |
6181 (/= article (cdr gnus-article-current)) | |
6182 (not (equal (car gnus-article-current) gnus-newsgroup-name))) | |
6183 ;; Selected subject is different from current article's. | |
6184 (gnus-summary-display-article article) | |
6185 (gnus-summary-recenter) | |
6186 (when article-window | |
6187 (gnus-eval-in-buffer-window gnus-article-buffer | |
6188 (setq endp (gnus-article-prev-page lines))) | |
6189 (when (and move endp) | |
6190 (cond (lines | |
6191 (gnus-message 3 "Beginning of message")) | |
6192 ((null lines) | |
6193 (if (and (eq gnus-summary-goto-unread 'never) | |
6194 (not (gnus-summary-first-article-p article))) | |
6195 (gnus-summary-prev-article) | |
6196 (gnus-summary-prev-unread-article)))))))) | |
6197 (gnus-summary-position-point)) | |
6198 | |
6199 (defun gnus-summary-prev-page-or-article (&optional lines) | |
6200 "Show previous page of selected article. | |
6201 Argument LINES specifies lines to be scrolled down. | |
6202 If at the beginning of the article, go to the next article." | |
6203 (interactive "P") | |
6204 (gnus-summary-prev-page lines t)) | |
6205 | |
6206 (defun gnus-summary-scroll-up (lines) | |
6207 "Scroll up (or down) one line current article. | |
6208 Argument LINES specifies lines to be scrolled up (or down if negative)." | |
6209 (interactive "p") | |
6210 (gnus-configure-windows 'article) | |
6211 (gnus-summary-show-thread) | |
6212 (when (eq (gnus-summary-select-article nil nil 'pseudo) 'old) | |
6213 (gnus-eval-in-buffer-window gnus-article-buffer | |
6214 (cond ((> lines 0) | |
6215 (when (gnus-article-next-page lines) | |
6216 (gnus-message 3 "End of message"))) | |
6217 ((< lines 0) | |
6218 (gnus-article-prev-page (- lines)))))) | |
6219 (gnus-summary-recenter) | |
6220 (gnus-summary-position-point)) | |
6221 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6222 (defun gnus-summary-scroll-down (lines) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6223 "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
|
6224 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
|
6225 (interactive "p") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6226 (gnus-summary-scroll-up (- lines))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6227 |
17493 | 6228 (defun gnus-summary-next-same-subject () |
6229 "Select next article which has the same subject as current one." | |
6230 (interactive) | |
6231 (gnus-summary-next-article nil (gnus-summary-article-subject))) | |
6232 | |
6233 (defun gnus-summary-prev-same-subject () | |
6234 "Select previous article which has the same subject as current one." | |
6235 (interactive) | |
6236 (gnus-summary-prev-article nil (gnus-summary-article-subject))) | |
6237 | |
6238 (defun gnus-summary-next-unread-same-subject () | |
6239 "Select next unread article which has the same subject as current one." | |
6240 (interactive) | |
6241 (gnus-summary-next-article t (gnus-summary-article-subject))) | |
6242 | |
6243 (defun gnus-summary-prev-unread-same-subject () | |
6244 "Select previous unread article which has the same subject as current one." | |
6245 (interactive) | |
6246 (gnus-summary-prev-article t (gnus-summary-article-subject))) | |
6247 | |
6248 (defun gnus-summary-first-unread-article () | |
6249 "Select the first unread article. | |
6250 Return nil if there are no unread articles." | |
6251 (interactive) | |
6252 (prog1 | |
6253 (when (gnus-summary-first-subject t) | |
6254 (gnus-summary-show-thread) | |
6255 (gnus-summary-first-subject t) | |
6256 (gnus-summary-display-article (gnus-summary-article-number))) | |
6257 (gnus-summary-position-point))) | |
6258 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6259 (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
|
6260 "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
|
6261 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
|
6262 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6263 (prog1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6264 (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
|
6265 (gnus-summary-show-thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6266 (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
|
6267 (gnus-summary-position-point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6268 |
17493 | 6269 (defun gnus-summary-first-article () |
6270 "Select the first article. | |
6271 Return nil if there are no articles." | |
6272 (interactive) | |
6273 (prog1 | |
6274 (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
|
6275 (gnus-summary-show-thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6276 (gnus-summary-first-subject) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6277 (gnus-summary-display-article (gnus-summary-article-number))) |
17493 | 6278 (gnus-summary-position-point))) |
6279 | |
6280 (defun gnus-summary-best-unread-article () | |
6281 "Select the unread article with the highest score." | |
6282 (interactive) | |
6283 (let ((best -1000000) | |
6284 (data gnus-newsgroup-data) | |
6285 article score) | |
6286 (while data | |
6287 (and (gnus-data-unread-p (car data)) | |
6288 (> (setq score | |
6289 (gnus-summary-article-score (gnus-data-number (car data)))) | |
6290 best) | |
6291 (setq best score | |
6292 article (gnus-data-number (car data)))) | |
6293 (setq data (cdr data))) | |
6294 (prog1 | |
6295 (if article | |
6296 (gnus-summary-goto-article article) | |
6297 (error "No unread articles")) | |
6298 (gnus-summary-position-point)))) | |
6299 | |
6300 (defun gnus-summary-last-subject () | |
6301 "Go to the last displayed subject line in the group." | |
6302 (let ((article (gnus-data-number (car (gnus-data-list t))))) | |
6303 (when article | |
6304 (gnus-summary-goto-subject article)))) | |
6305 | |
6306 (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
|
6307 "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
|
6308 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
|
6309 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
|
6310 is a number, it is the line the article is to be displayed on." |
17493 | 6311 (interactive |
6312 (list | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6313 (completing-read |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6314 "Article number or Message-ID: " |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6315 (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
|
6316 gnus-newsgroup-limit)) |
17493 | 6317 current-prefix-arg |
6318 t)) | |
6319 (prog1 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6320 (if (and (stringp article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6321 (string-match "@" article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6322 (gnus-summary-refer-article article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6323 (when (stringp article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6324 (setq article (string-to-number article))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6325 (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
|
6326 (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
|
6327 (gnus-message 4 "Couldn't go to article %s" article) nil)) |
17493 | 6328 (gnus-summary-position-point))) |
6329 | |
6330 (defun gnus-summary-goto-last-article () | |
6331 "Go to the previously read article." | |
6332 (interactive) | |
6333 (prog1 | |
6334 (when gnus-last-article | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6335 (gnus-summary-goto-article gnus-last-article nil t)) |
17493 | 6336 (gnus-summary-position-point))) |
6337 | |
6338 (defun gnus-summary-pop-article (number) | |
6339 "Pop one article off the history and go to the previous. | |
6340 NUMBER articles will be popped off." | |
6341 (interactive "p") | |
6342 (let (to) | |
6343 (setq gnus-newsgroup-history | |
6344 (cdr (setq to (nthcdr number gnus-newsgroup-history)))) | |
6345 (if to | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6346 (gnus-summary-goto-article (car to) nil t) |
17493 | 6347 (error "Article history empty"))) |
6348 (gnus-summary-position-point)) | |
6349 | |
6350 ;; Summary commands and functions for limiting the summary buffer. | |
6351 | |
6352 (defun gnus-summary-limit-to-articles (n) | |
6353 "Limit the summary buffer to the next N articles. | |
6354 If not given a prefix, use the process marked articles instead." | |
6355 (interactive "P") | |
6356 (prog1 | |
6357 (let ((articles (gnus-summary-work-articles n))) | |
6358 (setq gnus-newsgroup-processable nil) | |
6359 (gnus-summary-limit articles)) | |
6360 (gnus-summary-position-point))) | |
6361 | |
6362 (defun gnus-summary-pop-limit (&optional total) | |
6363 "Restore the previous limit. | |
6364 If given a prefix, remove all limits." | |
6365 (interactive "P") | |
6366 (when total | |
6367 (setq gnus-newsgroup-limits | |
6368 (list (mapcar (lambda (h) (mail-header-number h)) | |
6369 gnus-newsgroup-headers)))) | |
6370 (unless gnus-newsgroup-limits | |
6371 (error "No limit to pop")) | |
6372 (prog1 | |
6373 (gnus-summary-limit nil 'pop) | |
6374 (gnus-summary-position-point))) | |
6375 | |
6376 (defun gnus-summary-limit-to-subject (subject &optional header) | |
6377 "Limit the summary buffer to articles that have subjects that match a regexp." | |
6378 (interactive "sLimit to subject (regexp): ") | |
6379 (unless header | |
6380 (setq header "subject")) | |
6381 (when (not (equal "" subject)) | |
6382 (prog1 | |
6383 (let ((articles (gnus-summary-find-matching | |
6384 (or header "subject") subject 'all))) | |
6385 (unless articles | |
6386 (error "Found no matches for \"%s\"" subject)) | |
6387 (gnus-summary-limit articles)) | |
6388 (gnus-summary-position-point)))) | |
6389 | |
6390 (defun gnus-summary-limit-to-author (from) | |
6391 "Limit the summary buffer to articles that have authors that match a regexp." | |
6392 (interactive "sLimit to author (regexp): ") | |
6393 (gnus-summary-limit-to-subject from "from")) | |
6394 | |
6395 (defun gnus-summary-limit-to-age (age &optional younger-p) | |
6396 "Limit the summary buffer to articles that are older than (or equal) AGE days. | |
6397 If YOUNGER-P (the prefix) is non-nil, limit the summary buffer to | |
6398 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
|
6399 (interactive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6400 (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
|
6401 (days-got nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6402 days) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6403 (while (not days-got) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6404 (setq days (if younger |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6405 (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
|
6406 (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
|
6407 (when (> (length days) 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6408 (setq days (read days))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6409 (if (numberp days) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6410 (setq days-got t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6411 (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
|
6412 (sleep-for 1))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6413 (list days younger))) |
17493 | 6414 (prog1 |
6415 (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
|
6416 (cutoff (days-to-time age)) |
17493 | 6417 articles d date is-younger) |
6418 (while (setq d (pop data)) | |
6419 (when (and (vectorp (gnus-data-header d)) | |
6420 (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
|
6421 (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
|
6422 (time-since (condition-case () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6423 (date-to-time date) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6424 (error '(0 0)))) |
17493 | 6425 cutoff)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6426 (when (if younger-p |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6427 is-younger |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6428 (not is-younger)) |
17493 | 6429 (push (gnus-data-number d) articles)))) |
6430 (gnus-summary-limit (nreverse articles))) | |
6431 (gnus-summary-position-point))) | |
6432 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6433 (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
|
6434 "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
|
6435 (interactive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6436 (let ((header |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6437 (intern |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6438 (gnus-completing-read |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6439 (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
|
6440 "Limit extra header:" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6441 (mapcar (lambda (x) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6442 (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
|
6443 gnus-extra-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6444 nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6445 t)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6446 (list header |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6447 (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
|
6448 (when (not (equal "" regexp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6449 (prog1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6450 (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
|
6451 (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
|
6452 (unless articles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6453 (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
|
6454 (gnus-summary-limit articles)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6455 (gnus-summary-position-point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6456 |
17493 | 6457 (defalias 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread) |
6458 (make-obsolete | |
6459 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread) | |
6460 | |
6461 (defun gnus-summary-limit-to-unread (&optional all) | |
6462 "Limit the summary buffer to articles that are not marked as read. | |
6463 If ALL is non-nil, limit strictly to unread articles." | |
6464 (interactive "P") | |
6465 (if all | |
6466 (gnus-summary-limit-to-marks (char-to-string gnus-unread-mark)) | |
6467 (gnus-summary-limit-to-marks | |
6468 ;; Concat all the marks that say that an article is read and have | |
6469 ;; those removed. | |
6470 (list gnus-del-mark gnus-read-mark gnus-ancient-mark | |
6471 gnus-killed-mark gnus-kill-file-mark | |
6472 gnus-low-score-mark gnus-expirable-mark | |
6473 gnus-canceled-mark gnus-catchup-mark gnus-sparse-mark | |
6474 gnus-duplicate-mark gnus-souped-mark) | |
6475 'reverse))) | |
6476 | |
6477 (defalias 'gnus-summary-delete-marked-with 'gnus-summary-limit-exclude-marks) | |
6478 (make-obsolete 'gnus-summary-delete-marked-with | |
6479 'gnus-summary-limit-exlude-marks) | |
6480 | |
6481 (defun gnus-summary-limit-exclude-marks (marks &optional reverse) | |
6482 "Exclude articles that are marked with MARKS (e.g. \"DK\"). | |
6483 If REVERSE, limit the summary buffer to articles that are marked | |
6484 with MARKS. MARKS can either be a string of marks or a list of marks. | |
6485 Returns how many articles were removed." | |
6486 (interactive "sMarks: ") | |
6487 (gnus-summary-limit-to-marks marks t)) | |
6488 | |
6489 (defun gnus-summary-limit-to-marks (marks &optional reverse) | |
6490 "Limit the summary buffer to articles that are marked with MARKS (e.g. \"DK\"). | |
6491 If REVERSE (the prefix), limit the summary buffer to articles that are | |
6492 not marked with MARKS. MARKS can either be a string of marks or a | |
6493 list of marks. | |
6494 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
|
6495 (interactive "sMarks: \nP") |
17493 | 6496 (prog1 |
6497 (let ((data gnus-newsgroup-data) | |
6498 (marks (if (listp marks) marks | |
6499 (append marks nil))) ; Transform to list. | |
6500 articles) | |
6501 (while data | |
6502 (when (if reverse (not (memq (gnus-data-mark (car data)) marks)) | |
6503 (memq (gnus-data-mark (car data)) marks)) | |
6504 (push (gnus-data-number (car data)) articles)) | |
6505 (setq data (cdr data))) | |
6506 (gnus-summary-limit articles)) | |
6507 (gnus-summary-position-point))) | |
6508 | |
6509 (defun gnus-summary-limit-to-score (&optional score) | |
6510 "Limit to articles with score at or above SCORE." | |
6511 (interactive "P") | |
6512 (setq score (if score | |
6513 (prefix-numeric-value score) | |
6514 (or gnus-summary-default-score 0))) | |
6515 (let ((data gnus-newsgroup-data) | |
6516 articles) | |
6517 (while data | |
6518 (when (>= (gnus-summary-article-score (gnus-data-number (car data))) | |
6519 score) | |
6520 (push (gnus-data-number (car data)) articles)) | |
6521 (setq data (cdr data))) | |
6522 (prog1 | |
6523 (gnus-summary-limit articles) | |
6524 (gnus-summary-position-point)))) | |
6525 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6526 (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
|
6527 "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
|
6528 (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
|
6529 (let ((articles (gnus-articles-in-thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6530 (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
|
6531 (prog1 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6532 (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
|
6533 (gnus-summary-position-point)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6534 |
17493 | 6535 (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
|
6536 "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
|
6537 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
|
6538 fetched for this group." |
17493 | 6539 (interactive) |
6540 (unless gnus-newsgroup-dormant | |
6541 (error "There are no dormant articles in this group")) | |
6542 (prog1 | |
6543 (gnus-summary-limit (append gnus-newsgroup-dormant gnus-newsgroup-limit)) | |
6544 (gnus-summary-position-point))) | |
6545 | |
6546 (defun gnus-summary-limit-exclude-dormant () | |
6547 "Hide all dormant articles." | |
6548 (interactive) | |
6549 (prog1 | |
6550 (gnus-summary-limit-to-marks (list gnus-dormant-mark) 'reverse) | |
6551 (gnus-summary-position-point))) | |
6552 | |
6553 (defun gnus-summary-limit-exclude-childless-dormant () | |
6554 "Hide all dormant articles that have no children." | |
6555 (interactive) | |
6556 (let ((data (gnus-data-list t)) | |
6557 articles d children) | |
6558 ;; Find all articles that are either not dormant or have | |
6559 ;; children. | |
6560 (while (setq d (pop data)) | |
6561 (when (or (not (= (gnus-data-mark d) gnus-dormant-mark)) | |
6562 (and (setq children | |
6563 (gnus-article-children (gnus-data-number d))) | |
6564 (let (found) | |
6565 (while children | |
6566 (when (memq (car children) articles) | |
6567 (setq children nil | |
6568 found t)) | |
6569 (pop children)) | |
6570 found))) | |
6571 (push (gnus-data-number d) articles))) | |
6572 ;; Do the limiting. | |
6573 (prog1 | |
6574 (gnus-summary-limit articles) | |
6575 (gnus-summary-position-point)))) | |
6576 | |
6577 (defun gnus-summary-limit-mark-excluded-as-read (&optional all) | |
6578 "Mark all unread excluded articles as read. | |
6579 If ALL, mark even excluded ticked and dormants as read." | |
6580 (interactive "P") | |
6581 (let ((articles (gnus-sorted-complement | |
6582 (sort | |
6583 (mapcar (lambda (h) (mail-header-number h)) | |
6584 gnus-newsgroup-headers) | |
6585 '<) | |
6586 (sort gnus-newsgroup-limit '<))) | |
6587 article) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6588 (setq gnus-newsgroup-unreads |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6589 (gnus-intersection gnus-newsgroup-unreads gnus-newsgroup-limit)) |
17493 | 6590 (if all |
6591 (setq gnus-newsgroup-dormant nil | |
6592 gnus-newsgroup-marked nil | |
6593 gnus-newsgroup-reads | |
6594 (nconc | |
6595 (mapcar (lambda (n) (cons n gnus-catchup-mark)) articles) | |
6596 gnus-newsgroup-reads)) | |
6597 (while (setq article (pop articles)) | |
6598 (unless (or (memq article gnus-newsgroup-dormant) | |
6599 (memq article gnus-newsgroup-marked)) | |
6600 (push (cons article gnus-catchup-mark) gnus-newsgroup-reads)))))) | |
6601 | |
6602 (defun gnus-summary-limit (articles &optional pop) | |
6603 (if pop | |
6604 ;; We pop the previous limit off the stack and use that. | |
6605 (setq articles (car gnus-newsgroup-limits) | |
6606 gnus-newsgroup-limits (cdr gnus-newsgroup-limits)) | |
6607 ;; We use the new limit, so we push the old limit on the stack. | |
6608 (push gnus-newsgroup-limit gnus-newsgroup-limits)) | |
6609 ;; Set the limit. | |
6610 (setq gnus-newsgroup-limit articles) | |
6611 (let ((total (length gnus-newsgroup-data)) | |
6612 (data (gnus-data-find-list (gnus-summary-article-number))) | |
6613 (gnus-summary-mark-below nil) ; Inhibit this. | |
6614 found) | |
6615 ;; This will do all the work of generating the new summary buffer | |
6616 ;; according to the new limit. | |
6617 (gnus-summary-prepare) | |
6618 ;; Hide any threads, possibly. | |
6619 (and gnus-show-threads | |
6620 gnus-thread-hide-subtree | |
6621 (gnus-summary-hide-all-threads)) | |
6622 ;; Try to return to the article you were at, or one in the | |
6623 ;; neighborhood. | |
6624 (when data | |
6625 ;; We try to find some article after the current one. | |
6626 (while data | |
6627 (when (gnus-summary-goto-subject (gnus-data-number (car data)) nil t) | |
6628 (setq data nil | |
6629 found t)) | |
6630 (setq data (cdr data)))) | |
6631 (unless found | |
6632 ;; If there is no data, that means that we were after the last | |
6633 ;; article. The same goes when we can't find any articles | |
6634 ;; after the current one. | |
6635 (goto-char (point-max)) | |
6636 (gnus-summary-find-prev)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6637 (gnus-set-mode-line 'summary) |
17493 | 6638 ;; We return how many articles were removed from the summary |
6639 ;; buffer as a result of the new limit. | |
6640 (- total (length gnus-newsgroup-data)))) | |
6641 | |
6642 (defsubst gnus-invisible-cut-children (threads) | |
6643 (let ((num 0)) | |
6644 (while threads | |
6645 (when (memq (mail-header-number (caar threads)) gnus-newsgroup-limit) | |
6646 (incf num)) | |
6647 (pop threads)) | |
6648 (< num 2))) | |
6649 | |
6650 (defsubst gnus-cut-thread (thread) | |
6651 "Go forwards in the thread until we find an article that we want to display." | |
6652 (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
|
6653 (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
|
6654 (numberp gnus-fetch-old-headers) |
17493 | 6655 (eq gnus-build-sparse-threads 'some) |
6656 (eq gnus-build-sparse-threads 'more)) | |
6657 ;; Deal with old-fetched headers and sparse threads. | |
6658 (while (and | |
6659 thread | |
6660 (or | |
6661 (gnus-summary-article-sparse-p (mail-header-number (car thread))) | |
6662 (gnus-summary-article-ancient-p | |
6663 (mail-header-number (car thread)))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6664 (if (or (<= (length (cdr thread)) 1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6665 (eq gnus-fetch-old-headers 'invisible)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6666 (setq gnus-newsgroup-limit |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6667 (delq (mail-header-number (car thread)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6668 gnus-newsgroup-limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6669 thread (cadr thread)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6670 (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
|
6671 (let ((th (cdr thread))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6672 (while th |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6673 (if (memq (mail-header-number (caar th)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6674 gnus-newsgroup-limit) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6675 (setq thread (car th) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6676 th nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6677 (setq th (cdr th)))))))))) |
17493 | 6678 thread) |
6679 | |
6680 (defun gnus-cut-threads (threads) | |
6681 "Cut off all uninteresting articles from the beginning of threads." | |
6682 (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
|
6683 (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
|
6684 (numberp gnus-fetch-old-headers) |
17493 | 6685 (eq gnus-build-sparse-threads 'some) |
6686 (eq gnus-build-sparse-threads 'more)) | |
6687 (let ((th threads)) | |
6688 (while th | |
6689 (setcar th (gnus-cut-thread (car th))) | |
6690 (setq th (cdr th))))) | |
6691 ;; Remove nixed out threads. | |
6692 (delq nil threads)) | |
6693 | |
6694 (defun gnus-summary-initial-limit (&optional show-if-empty) | |
6695 "Figure out what the initial limit is supposed to be on group entry. | |
6696 This entails weeding out unwanted dormants, low-scored articles, | |
6697 fetch-old-headers verbiage, and so on." | |
6698 ;; Most groups have nothing to remove. | |
6699 (if (or gnus-inhibit-limiting | |
6700 (and (null gnus-newsgroup-dormant) | |
6701 (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
|
6702 (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
|
6703 (not (eq gnus-fetch-old-headers 'invisible)) |
17493 | 6704 (null gnus-summary-expunge-below) |
6705 (not (eq gnus-build-sparse-threads 'some)) | |
6706 (not (eq gnus-build-sparse-threads 'more)) | |
6707 (null gnus-thread-expunge-below) | |
6708 (not gnus-use-nocem))) | |
6709 () ; Do nothing. | |
6710 (push gnus-newsgroup-limit gnus-newsgroup-limits) | |
6711 (setq gnus-newsgroup-limit nil) | |
6712 (mapatoms | |
6713 (lambda (node) | |
6714 (unless (car (symbol-value node)) | |
6715 ;; These threads have no parents -- they are roots. | |
6716 (let ((nodes (cdr (symbol-value node))) | |
6717 thread) | |
6718 (while nodes | |
6719 (if (and gnus-thread-expunge-below | |
6720 (< (gnus-thread-total-score (car nodes)) | |
6721 gnus-thread-expunge-below)) | |
6722 (gnus-expunge-thread (pop nodes)) | |
6723 (setq thread (pop nodes)) | |
6724 (gnus-summary-limit-children thread)))))) | |
6725 gnus-newsgroup-dependencies) | |
6726 ;; If this limitation resulted in an empty group, we might | |
6727 ;; pop the previous limit and use it instead. | |
6728 (when (and (not gnus-newsgroup-limit) | |
6729 show-if-empty) | |
6730 (setq gnus-newsgroup-limit (pop gnus-newsgroup-limits))) | |
6731 gnus-newsgroup-limit)) | |
6732 | |
6733 (defun gnus-summary-limit-children (thread) | |
6734 "Return 1 if this subthread is visible and 0 if it is not." | |
6735 ;; First we get the number of visible children to this thread. This | |
6736 ;; is done by recursing down the thread using this function, so this | |
6737 ;; will really go down to a leaf article first, before slowly | |
6738 ;; working its way up towards the root. | |
6739 (when thread | |
6740 (let ((children | |
6741 (if (cdr thread) | |
6742 (apply '+ (mapcar 'gnus-summary-limit-children | |
6743 (cdr thread))) | |
6744 0)) | |
6745 (number (mail-header-number (car thread))) | |
6746 score) | |
6747 (if (and | |
6748 (not (memq number gnus-newsgroup-marked)) | |
6749 (or | |
6750 ;; If this article is dormant and has absolutely no visible | |
6751 ;; children, then this article isn't visible. | |
6752 (and (memq number gnus-newsgroup-dormant) | |
6753 (zerop children)) | |
6754 ;; If this is "fetch-old-headered" and there is no | |
6755 ;; 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
|
6756 (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
|
6757 (numberp gnus-fetch-old-headers)) |
17493 | 6758 (gnus-summary-article-ancient-p number) |
6759 (zerop children)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6760 ;; 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
|
6761 ;; we don't want this article. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6762 (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
|
6763 (gnus-summary-article-ancient-p number)) |
17493 | 6764 ;; If this is a sparsely inserted article with no children, |
6765 ;; we don't want it. | |
6766 (and (eq gnus-build-sparse-threads 'some) | |
6767 (gnus-summary-article-sparse-p number) | |
6768 (zerop children)) | |
6769 ;; If we use expunging, and this article is really | |
6770 ;; low-scored, then we don't want this article. | |
6771 (when (and gnus-summary-expunge-below | |
6772 (< (setq score | |
6773 (or (cdr (assq number gnus-newsgroup-scored)) | |
6774 gnus-summary-default-score)) | |
6775 gnus-summary-expunge-below)) | |
6776 ;; We increase the expunge-tally here, but that has | |
6777 ;; nothing to do with the limits, really. | |
6778 (incf gnus-newsgroup-expunged-tally) | |
6779 ;; We also mark as read here, if that's wanted. | |
6780 (when (and gnus-summary-mark-below | |
6781 (< score gnus-summary-mark-below)) | |
6782 (setq gnus-newsgroup-unreads | |
6783 (delq number gnus-newsgroup-unreads)) | |
6784 (if gnus-newsgroup-auto-expire | |
6785 (push number gnus-newsgroup-expirable) | |
6786 (push (cons number gnus-low-score-mark) | |
6787 gnus-newsgroup-reads))) | |
6788 t) | |
6789 ;; Check NoCeM things. | |
6790 (if (and gnus-use-nocem | |
6791 (gnus-nocem-unwanted-article-p | |
6792 (mail-header-id (car thread)))) | |
6793 (progn | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6794 (setq gnus-newsgroup-unreads |
17493 | 6795 (delq number gnus-newsgroup-unreads)) |
6796 t)))) | |
6797 ;; Nope, invisible article. | |
6798 0 | |
6799 ;; Ok, this article is to be visible, so we add it to the limit | |
6800 ;; and return 1. | |
6801 (push number gnus-newsgroup-limit) | |
6802 1)))) | |
6803 | |
6804 (defun gnus-expunge-thread (thread) | |
6805 "Mark all articles in THREAD as read." | |
6806 (let* ((number (mail-header-number (car thread)))) | |
6807 (incf gnus-newsgroup-expunged-tally) | |
6808 ;; We also mark as read here, if that's wanted. | |
6809 (setq gnus-newsgroup-unreads | |
6810 (delq number gnus-newsgroup-unreads)) | |
6811 (if gnus-newsgroup-auto-expire | |
6812 (push number gnus-newsgroup-expirable) | |
6813 (push (cons number gnus-low-score-mark) | |
6814 gnus-newsgroup-reads))) | |
6815 ;; Go recursively through all subthreads. | |
6816 (mapcar 'gnus-expunge-thread (cdr thread))) | |
6817 | |
6818 ;; Summary article oriented commands | |
6819 | |
6820 (defun gnus-summary-refer-parent-article (n) | |
6821 "Refer parent article N times. | |
6822 If N is negative, go to ancestor -N instead. | |
6823 The difference between N and the number of articles fetched is returned." | |
6824 (interactive "p") | |
6825 (let ((skip 1) | |
6826 error header ref) | |
6827 (when (not (natnump n)) | |
6828 (setq skip (abs n) | |
6829 n 1)) | |
6830 (while (and (> n 0) | |
6831 (not error)) | |
6832 (setq header (gnus-summary-article-header)) | |
6833 (if (and (eq (mail-header-number header) | |
6834 (cdr gnus-article-current)) | |
6835 (equal gnus-newsgroup-name | |
6836 (car gnus-article-current))) | |
6837 ;; If we try to find the parent of the currently | |
6838 ;; displayed article, then we take a look at the actual | |
6839 ;; References header, since this is slightly more | |
6840 ;; reliable than the References field we got from the | |
6841 ;; server. | |
6842 (save-excursion | |
6843 (set-buffer gnus-original-article-buffer) | |
6844 (nnheader-narrow-to-headers) | |
6845 (unless (setq ref (message-fetch-field "references")) | |
6846 (setq ref (message-fetch-field "in-reply-to"))) | |
6847 (widen)) | |
6848 (setq ref | |
6849 ;; It's not the current article, so we take a bet on | |
6850 ;; the value we got from the server. | |
6851 (mail-header-references header))) | |
6852 (if (and ref | |
6853 (not (equal ref ""))) | |
6854 (unless (gnus-summary-refer-article (gnus-parent-id ref skip)) | |
6855 (gnus-message 1 "Couldn't find parent")) | |
6856 (gnus-message 1 "No references in article %d" | |
6857 (gnus-summary-article-number)) | |
6858 (setq error t)) | |
6859 (decf n)) | |
6860 (gnus-summary-position-point) | |
6861 n)) | |
6862 | |
6863 (defun gnus-summary-refer-references () | |
6864 "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
|
6865 Return the number of articles fetched." |
17493 | 6866 (interactive) |
6867 (let ((ref (mail-header-references (gnus-summary-article-header))) | |
6868 (current (gnus-summary-article-number)) | |
6869 (n 0)) | |
6870 (if (or (not ref) | |
6871 (equal ref "")) | |
6872 (error "No References in the current article") | |
6873 ;; For each Message-ID in the References header... | |
6874 (while (string-match "<[^>]*>" ref) | |
6875 (incf n) | |
6876 ;; ... fetch that article. | |
6877 (gnus-summary-refer-article | |
6878 (prog1 (match-string 0 ref) | |
6879 (setq ref (substring ref (match-end 0)))))) | |
6880 (gnus-summary-goto-subject current) | |
6881 (gnus-summary-position-point) | |
6882 n))) | |
6883 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6884 (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
|
6885 "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
|
6886 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
|
6887 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
|
6888 (interactive "P") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6889 (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
|
6890 (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
|
6891 gnus-refer-thread-limit))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6892 ;; 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
|
6893 ;; 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
|
6894 ;; 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
|
6895 (when (numberp limit) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6896 (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
|
6897 (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
|
6898 (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
|
6899 ;; 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
|
6900 (if (eq (gnus-retrieve-headers |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6901 (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
|
6902 'nov) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6903 (gnus-build-all-threads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6904 (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
|
6905 (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
|
6906 (gnus-summary-limit-include-thread id))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
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-refer-article (message-id) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6909 "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
|
6910 (interactive "sMessage-ID: ") |
17493 | 6911 (when (and (stringp message-id) |
6912 (not (zerop (length message-id)))) | |
6913 ;; Construct the correct Message-ID if necessary. | |
6914 ;; Suggested by tale@pawl.rpi.edu. | |
6915 (unless (string-match "^<" message-id) | |
6916 (setq message-id (concat "<" message-id))) | |
6917 (unless (string-match ">$" message-id) | |
6918 (setq message-id (concat message-id ">"))) | |
6919 (let* ((header (gnus-id-to-header message-id)) | |
6920 (sparse (and header | |
6921 (gnus-summary-article-sparse-p | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6922 (mail-header-number header)) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
6923 (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
|
6924 gnus-newsgroup-limit))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6925 number) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6926 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6927 ;; 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
|
6928 ((and header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6929 (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
|
6930 (mail-header-number header))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6931 sparse)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6932 (prog1 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6933 (gnus-summary-goto-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6934 (mail-header-number header) nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6935 (when sparse |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6936 (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
|
6937 (t |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6938 ;; We fetch the article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6939 (catch 'found |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6940 (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
|
6941 (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
|
6942 ;; 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
|
6943 (when (setq number (gnus-summary-insert-subject message-id)) |
17493 | 6944 (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
|
6945 (throw 'found t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6946 (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
|
6947 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6948 (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
|
6949 "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
|
6950 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6951 ;; 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
|
6952 ((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
|
6953 (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
|
6954 ;; Current. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6955 ((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
|
6956 (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
|
6957 ;; 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
|
6958 ((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
|
6959 (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
|
6960 (let (out) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6961 (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
|
6962 (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
|
6963 gnus-current-select-method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6964 method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6965 out)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6966 (nreverse out))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6967 ;; One single select method. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6968 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6969 (list gnus-refer-article-method)))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6970 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6971 (defun gnus-summary-edit-parameters () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6972 "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
|
6973 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
6974 (gnus-group-edit-group gnus-newsgroup-name 'params)) |
17493 | 6975 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6976 (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
|
6977 "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
|
6978 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
6979 (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
|
6980 |
17493 | 6981 (defun gnus-summary-enter-digest-group (&optional force) |
6982 "Enter an nndoc group based on the current article. | |
6983 If FORCE, force a digest interpretation. If not, try | |
6984 to guess what the document format is." | |
6985 (interactive "P") | |
6986 (let ((conf gnus-current-window-configuration)) | |
6987 (save-excursion | |
6988 (gnus-summary-select-article)) | |
6989 (setq gnus-current-window-configuration conf) | |
6990 (let* ((name (format "%s-%d" | |
6991 (gnus-group-prefixed-name | |
6992 gnus-newsgroup-name (list 'nndoc "")) | |
6993 (save-excursion | |
6994 (set-buffer gnus-summary-buffer) | |
6995 gnus-current-article))) | |
6996 (ogroup gnus-newsgroup-name) | |
6997 (params (append (gnus-info-params (gnus-get-info ogroup)) | |
6998 (list (cons 'to-group ogroup)) | |
6999 (list (cons 'save-article-group ogroup)))) | |
7000 (case-fold-search t) | |
7001 (buf (current-buffer)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7002 dig to-address) |
17493 | 7003 (save-excursion |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7004 (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
|
7005 ;; 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
|
7006 ;; the parent article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7007 (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
|
7008 (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
|
7009 (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
|
7010 (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
|
7011 (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
|
7012 to-address)))))) |
17493 | 7013 (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*")) |
7014 (insert-buffer-substring gnus-original-article-buffer) | |
7015 ;; Remove lines that may lead nndoc to misinterpret the | |
7016 ;; document type. | |
7017 (narrow-to-region | |
7018 (goto-char (point-min)) | |
7019 (or (search-forward "\n\n" nil t) (point))) | |
7020 (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
|
7021 (delete-matching-lines "^Path:\\|^From ") |
17493 | 7022 (widen)) |
7023 (unwind-protect | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7024 (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
|
7025 (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
|
7026 gnus-newsgroup-ignored-charsets)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7027 (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
|
7028 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
|
7029 (nndoc-article-type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7030 ,(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
|
7031 ;; Make all postings to this group go to the parent group. |
17493 | 7032 (nconc (gnus-info-params (gnus-get-info name)) |
7033 params) | |
7034 ;; Couldn't select this doc group. | |
7035 (switch-to-buffer buf) | |
7036 (gnus-set-global-variables) | |
7037 (gnus-configure-windows 'summary) | |
7038 (gnus-message 3 "Article couldn't be entered?")) | |
7039 (kill-buffer dig))))) | |
7040 | |
7041 (defun gnus-summary-read-document (n) | |
7042 "Open a new group based on the current article(s). | |
7043 This will allow you to read digests and other similar | |
7044 documents as newsgroups. | |
7045 Obeys the standard process/prefix convention." | |
7046 (interactive "P") | |
7047 (let* ((articles (gnus-summary-work-articles n)) | |
7048 (ogroup gnus-newsgroup-name) | |
7049 (params (append (gnus-info-params (gnus-get-info ogroup)) | |
7050 (list (cons 'to-group ogroup)))) | |
7051 article group egroup groups vgroup) | |
7052 (while (setq article (pop articles)) | |
7053 (setq group (format "%s-%d" gnus-newsgroup-name article)) | |
7054 (gnus-summary-remove-process-mark article) | |
7055 (when (gnus-summary-display-article article) | |
7056 (save-excursion | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7057 (with-temp-buffer |
17493 | 7058 (insert-buffer-substring gnus-original-article-buffer) |
7059 ;; Remove some headers that may lead nndoc to make | |
7060 ;; the wrong guess. | |
7061 (message-narrow-to-head) | |
7062 (goto-char (point-min)) | |
7063 (delete-matching-lines "^\\(Path\\):\\|^From ") | |
7064 (widen) | |
7065 (if (setq egroup | |
7066 (gnus-group-read-ephemeral-group | |
7067 group `(nndoc ,group (nndoc-address ,(current-buffer)) | |
7068 (nndoc-article-type guess)) | |
7069 t nil t)) | |
7070 (progn | |
7071 ;; Make all postings to this group go to the parent group. | |
7072 (nconc (gnus-info-params (gnus-get-info egroup)) | |
7073 params) | |
7074 (push egroup groups)) | |
7075 ;; Couldn't select this doc group. | |
7076 (gnus-error 3 "Article couldn't be entered")))))) | |
7077 ;; Now we have selected all the documents. | |
7078 (cond | |
7079 ((not groups) | |
7080 (error "None of the articles could be interpreted as documents")) | |
7081 ((gnus-group-read-ephemeral-group | |
7082 (setq vgroup (format | |
7083 "nnvirtual:%s-%s" gnus-newsgroup-name | |
7084 (format-time-string "%Y%m%dT%H%M%S" (current-time)))) | |
7085 `(nnvirtual ,vgroup (nnvirtual-component-groups ,groups)) | |
7086 t | |
7087 (cons (current-buffer) 'summary))) | |
7088 (t | |
7089 (error "Couldn't select virtual nndoc group"))))) | |
7090 | |
7091 (defun gnus-summary-isearch-article (&optional regexp-p) | |
7092 "Do incremental search forward on the current article. | |
7093 If REGEXP-P (the prefix) is non-nil, do regexp isearch." | |
7094 (interactive "P") | |
7095 (gnus-summary-select-article) | |
7096 (gnus-configure-windows 'article) | |
7097 (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
|
7098 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7099 (widen) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7100 (isearch-forward regexp-p)))) |
17493 | 7101 |
7102 (defun gnus-summary-search-article-forward (regexp &optional backward) | |
7103 "Search for an article containing REGEXP forward. | |
7104 If BACKWARD, search backward instead." | |
7105 (interactive | |
7106 (list (read-string | |
7107 (format "Search article %s (regexp%s): " | |
7108 (if current-prefix-arg "backward" "forward") | |
7109 (if gnus-last-search-regexp | |
7110 (concat ", default " gnus-last-search-regexp) | |
7111 ""))) | |
7112 current-prefix-arg)) | |
7113 (if (string-equal regexp "") | |
7114 (setq regexp (or gnus-last-search-regexp "")) | |
7115 (setq gnus-last-search-regexp regexp)) | |
7116 (if (gnus-summary-search-article regexp backward) | |
7117 (gnus-summary-show-thread) | |
7118 (error "Search failed: \"%s\"" regexp))) | |
7119 | |
7120 (defun gnus-summary-search-article-backward (regexp) | |
7121 "Search for an article containing REGEXP backward." | |
7122 (interactive | |
7123 (list (read-string | |
7124 (format "Search article backward (regexp%s): " | |
7125 (if gnus-last-search-regexp | |
7126 (concat ", default " gnus-last-search-regexp) | |
7127 ""))))) | |
7128 (gnus-summary-search-article-forward regexp 'backward)) | |
7129 | |
7130 (defun gnus-summary-search-article (regexp &optional backward) | |
7131 "Search for an article containing REGEXP. | |
7132 Optional argument BACKWARD means do search for backward. | |
7133 `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
|
7134 ;; 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
|
7135 ;; dynamic binding isn't shadowed by autoloading. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7136 (require 'gnus-async) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7137 (require 'gnus-art) |
17493 | 7138 (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
|
7139 (gnus-article-prepare-hook nil) |
17493 | 7140 (gnus-mark-article-hook nil) ;Inhibit marking as read. |
7141 (gnus-use-article-prefetch nil) | |
7142 (gnus-xmas-force-redisplay nil) ;Inhibit XEmacs redisplay. | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7143 (gnus-use-trees nil) ;Inhibit updating tree buffer. |
17493 | 7144 (sum (current-buffer)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7145 (gnus-display-mime-function nil) |
17493 | 7146 (found nil) |
7147 point) | |
7148 (gnus-save-hidden-threads | |
7149 (gnus-summary-select-article) | |
7150 (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
|
7151 (goto-char (window-point (get-buffer-window (current-buffer)))) |
17493 | 7152 (when backward |
7153 (forward-line -1)) | |
7154 (while (not found) | |
7155 (gnus-message 7 "Searching article: %d..." (cdr gnus-article-current)) | |
7156 (if (if backward | |
7157 (re-search-backward regexp nil t) | |
7158 (re-search-forward regexp nil t)) | |
7159 ;; We found the regexp. | |
7160 (progn | |
7161 (setq found 'found) | |
7162 (beginning-of-line) | |
7163 (set-window-start | |
7164 (get-buffer-window (current-buffer)) | |
7165 (point)) | |
7166 (forward-line 1) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7167 (set-window-point |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7168 (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
|
7169 (point)) |
17493 | 7170 (set-buffer sum) |
7171 (setq point (point))) | |
7172 ;; We didn't find it, so we go to the next article. | |
7173 (set-buffer sum) | |
7174 (setq found 'not) | |
7175 (while (eq found 'not) | |
7176 (if (not (if backward (gnus-summary-find-prev) | |
7177 (gnus-summary-find-next))) | |
7178 ;; No more articles. | |
7179 (setq found t) | |
7180 ;; Select the next article and adjust point. | |
7181 (unless (gnus-summary-article-sparse-p | |
7182 (gnus-summary-article-number)) | |
7183 (setq found nil) | |
7184 (gnus-summary-select-article) | |
7185 (set-buffer gnus-article-buffer) | |
7186 (widen) | |
7187 (goto-char (if backward (point-max) (point-min)))))))) | |
7188 (gnus-message 7 "")) | |
7189 ;; Return whether we found the regexp. | |
7190 (when (eq found 'found) | |
7191 (goto-char point) | |
7192 (gnus-summary-show-thread) | |
7193 (gnus-summary-goto-subject gnus-current-article) | |
7194 (gnus-summary-position-point) | |
7195 t))) | |
7196 | |
7197 (defun gnus-summary-find-matching (header regexp &optional backward unread | |
7198 not-case-fold) | |
7199 "Return a list of all articles that match REGEXP on HEADER. | |
7200 The search stars on the current article and goes forwards unless | |
7201 BACKWARD is non-nil. If BACKWARD is `all', do all articles. | |
7202 If UNREAD is non-nil, only unread articles will | |
7203 be taken into consideration. If NOT-CASE-FOLD, case won't be folded | |
7204 in the comparisons." | |
7205 (let ((data (if (eq backward 'all) gnus-newsgroup-data | |
7206 (gnus-data-find-list | |
7207 (gnus-summary-article-number) (gnus-data-list backward)))) | |
7208 (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
|
7209 articles d func) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7210 (if (consp header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7211 (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
|
7212 (setq func |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7213 `(lambda (h) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7214 (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
|
7215 ""))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7216 (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
|
7217 (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
|
7218 (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
|
7219 (setq func `(lambda (h) (,(intern (concat "mail-header-" header)) h)))) |
17493 | 7220 (while data |
7221 (setq d (car data)) | |
7222 (and (or (not unread) ; We want all articles... | |
7223 (gnus-data-unread-p d)) ; Or just unreads. | |
7224 (vectorp (gnus-data-header d)) ; It's not a pseudo. | |
7225 (string-match regexp (funcall func (gnus-data-header d))) ; Match. | |
7226 (push (gnus-data-number d) articles)) ; Success! | |
7227 (setq data (cdr data))) | |
7228 (nreverse articles))) | |
7229 | |
7230 (defun gnus-summary-execute-command (header regexp command &optional backward) | |
7231 "Search forward for an article whose HEADER matches REGEXP and execute COMMAND. | |
7232 If HEADER is an empty string (or nil), the match is done on the entire | |
7233 article. If BACKWARD (the prefix) is non-nil, search backward instead." | |
7234 (interactive | |
7235 (list (let ((completion-ignore-case t)) | |
7236 (completing-read | |
7237 "Header name: " | |
7238 (mapcar (lambda (string) (list string)) | |
7239 '("Number" "Subject" "From" "Lines" "Date" | |
7240 "Message-ID" "Xref" "References" "Body")) | |
7241 nil 'require-match)) | |
7242 (read-string "Regexp: ") | |
7243 (read-key-sequence "Command: ") | |
7244 current-prefix-arg)) | |
7245 (when (equal header "Body") | |
7246 (setq header "")) | |
7247 ;; Hidden thread subtrees must be searched as well. | |
7248 (gnus-summary-show-all-threads) | |
7249 ;; We don't want to change current point nor window configuration. | |
7250 (save-excursion | |
7251 (save-window-excursion | |
7252 (gnus-message 6 "Executing %s..." (key-description command)) | |
7253 ;; We'd like to execute COMMAND interactively so as to give arguments. | |
7254 (gnus-execute header regexp | |
7255 `(call-interactively ',(key-binding command)) | |
7256 backward) | |
7257 (gnus-message 6 "Executing %s...done" (key-description command))))) | |
7258 | |
7259 (defun gnus-summary-beginning-of-article () | |
7260 "Scroll the article back to the beginning." | |
7261 (interactive) | |
7262 (gnus-summary-select-article) | |
7263 (gnus-configure-windows 'article) | |
7264 (gnus-eval-in-buffer-window gnus-article-buffer | |
7265 (widen) | |
7266 (goto-char (point-min)) | |
7267 (when gnus-page-broken | |
7268 (gnus-narrow-to-page)))) | |
7269 | |
7270 (defun gnus-summary-end-of-article () | |
7271 "Scroll to the end of the article." | |
7272 (interactive) | |
7273 (gnus-summary-select-article) | |
7274 (gnus-configure-windows 'article) | |
7275 (gnus-eval-in-buffer-window gnus-article-buffer | |
7276 (widen) | |
7277 (goto-char (point-max)) | |
7278 (recenter -3) | |
7279 (when gnus-page-broken | |
7280 (gnus-narrow-to-page)))) | |
7281 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7282 (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
|
7283 "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
|
7284 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7285 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
|
7286 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
|
7287 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7288 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
|
7289 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
|
7290 that name. If FILENAME is a number, prompt the user for the name of the file |
17493 | 7291 to save in." |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7292 (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
|
7293 current-prefix-arg)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7294 (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
|
7295 (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
|
7296 (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
|
7297 (let ((buffer (generate-new-buffer " *print*"))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7298 (unwind-protect |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7299 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7300 (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
|
7301 (set-buffer buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7302 (gnus-article-delete-invisible-text) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7303 (let ((ps-left-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7304 (list |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7305 (concat "(" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7306 (mail-header-subject gnus-current-headers) ")") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7307 (concat "(" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7308 (mail-header-from gnus-current-headers) ")"))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7309 (ps-right-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7310 (list |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7311 "/pagenumberstring load" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7312 (concat "(" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7313 (mail-header-date gnus-current-headers) ")")))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7314 (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
|
7315 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7316 (ps-print-buffer-with-faces filename)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7317 (kill-buffer buffer)))))) |
17493 | 7318 |
7319 (defun gnus-summary-show-article (&optional arg) | |
7320 "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
|
7321 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
|
7322 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
|
7323 inputed. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7324 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
|
7325 without any article massaging functions being run." |
17493 | 7326 (interactive "P") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7327 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7328 ((numberp arg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7329 (let ((gnus-newsgroup-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7330 (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
|
7331 (read-coding-system "Charset: "))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7332 (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
|
7333 (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
|
7334 ((not arg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7335 ;; 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
|
7336 (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
|
7337 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7338 ;; 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
|
7339 ;; 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
|
7340 (require 'gnus-async) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7341 (require 'gnus-art) |
17493 | 7342 ;; Bind the article treatment functions to nil. |
7343 (let ((gnus-have-all-headers t) | |
7344 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
|
7345 gnus-article-decode-hook |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7346 gnus-display-mime-function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7347 gnus-break-pages) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7348 ;; Destroy any MIME parts. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7349 (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
|
7350 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7351 (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
|
7352 (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
|
7353 ;; 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
|
7354 (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
|
7355 (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
|
7356 (gnus-summary-select-article nil 'force)))) |
17493 | 7357 (gnus-summary-goto-subject gnus-current-article) |
7358 (gnus-summary-position-point)) | |
7359 | |
7360 (defun gnus-summary-verbose-headers (&optional arg) | |
7361 "Toggle permanent full header display. | |
7362 If ARG is a positive number, turn header display on. | |
7363 If ARG is a negative number, turn header display off." | |
7364 (interactive "P") | |
7365 (setq gnus-show-all-headers | |
7366 (cond ((or (not (numberp arg)) | |
7367 (zerop arg)) | |
7368 (not gnus-show-all-headers)) | |
7369 ((natnump arg) | |
7370 t))) | |
7371 (gnus-summary-show-article)) | |
7372 | |
7373 (defun gnus-summary-toggle-header (&optional arg) | |
7374 "Show the headers if they are hidden, or hide them if they are shown. | |
7375 If ARG is a positive number, show the entire header. | |
7376 If ARG is a negative number, hide the unwanted header lines." | |
7377 (interactive "P") | |
7378 (save-excursion | |
7379 (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
|
7380 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7381 (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
|
7382 (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
|
7383 hidden e) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7384 (setq hidden |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7385 (if (numberp arg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7386 (>= arg 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7387 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7388 (article-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7389 (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
|
7390 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7391 (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
|
7392 (delete-region (point-min) (1- (point)))) |
17493 | 7393 (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
|
7394 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7395 (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
|
7396 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7397 (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
|
7398 (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
|
7399 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7400 (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
|
7401 (article-decode-encoded-words) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7402 (if hidden |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7403 (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
|
7404 (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
|
7405 (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
|
7406 (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
|
7407 (gnus-treat-article 'head)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7408 (gnus-treat-article 'head))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7409 (gnus-set-mode-line 'article))))) |
17493 | 7410 |
7411 (defun gnus-summary-show-all-headers () | |
7412 "Make all header lines visible." | |
7413 (interactive) | |
7414 (gnus-article-show-all-headers)) | |
7415 | |
7416 (defun gnus-summary-caesar-message (&optional arg) | |
7417 "Caesar rotate the current article by 13. | |
7418 The numerical prefix specifies how many places to rotate each letter | |
7419 forward." | |
7420 (interactive "P") | |
7421 (gnus-summary-select-article) | |
7422 (let ((mail-header-separator "")) | |
7423 (gnus-eval-in-buffer-window gnus-article-buffer | |
7424 (save-restriction | |
7425 (widen) | |
7426 (let ((start (window-start)) | |
7427 buffer-read-only) | |
7428 (message-caesar-buffer-body arg) | |
7429 (set-window-start (get-buffer-window (current-buffer)) start)))))) | |
7430 | |
7431 (defun gnus-summary-stop-page-breaking () | |
7432 "Stop page breaking in the current article." | |
7433 (interactive) | |
7434 (gnus-summary-select-article) | |
7435 (gnus-eval-in-buffer-window gnus-article-buffer | |
7436 (widen) | |
7437 (when (gnus-visual-p 'page-marker) | |
7438 (let ((buffer-read-only nil)) | |
7439 (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
|
7440 (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
|
7441 (setq gnus-page-broken nil)))) |
17493 | 7442 |
7443 (defun gnus-summary-move-article (&optional n to-newsgroup | |
7444 select-method action) | |
7445 "Move the current article to a different newsgroup. | |
7446 If N is a positive number, move the N next articles. | |
7447 If N is a negative number, move the N previous articles. | |
7448 If N is nil and any articles have been marked with the process mark, | |
7449 move those articles instead. | |
7450 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to. | |
7451 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but | |
7452 re-spool using this method. | |
7453 | |
7454 For this function to work, both the current newsgroup and the | |
7455 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
|
7456 and `request-accept' functions. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7457 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7458 ACTION can be either `move' (the default), `crosspost' or `copy'." |
17493 | 7459 (interactive "P") |
7460 (unless action | |
7461 (setq action 'move)) | |
7462 ;; Disable marking as read. | |
7463 (let (gnus-mark-article-hook) | |
7464 (save-window-excursion | |
7465 (gnus-summary-select-article))) | |
7466 ;; Check whether the source group supports the required functions. | |
7467 (cond ((and (eq action 'move) | |
7468 (not (gnus-check-backend-function | |
7469 'request-move-article gnus-newsgroup-name))) | |
7470 (error "The current group does not support article moving")) | |
7471 ((and (eq action 'crosspost) | |
7472 (not (gnus-check-backend-function | |
7473 'request-replace-article gnus-newsgroup-name))) | |
7474 (error "The current group does not support article editing"))) | |
7475 (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
|
7476 (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
|
7477 '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
|
7478 (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
|
7479 "")) |
17493 | 7480 (names '((move "Move" "Moving") |
7481 (copy "Copy" "Copying") | |
7482 (crosspost "Crosspost" "Crossposting"))) | |
7483 (copy-buf (save-excursion | |
7484 (nnheader-set-temp-buffer " *copy article*"))) | |
7485 art-group to-method new-xref article to-groups) | |
7486 (unless (assq action names) | |
7487 (error "Unknown action %s" action)) | |
7488 ;; Read the newsgroup name. | |
7489 (when (and (not to-newsgroup) | |
7490 (not select-method)) | |
7491 (setq to-newsgroup | |
7492 (gnus-read-move-group-name | |
7493 (cadr (assq action names)) | |
7494 (symbol-value (intern (format "gnus-current-%s-group" action))) | |
7495 articles prefix)) | |
7496 (set (intern (format "gnus-current-%s-group" action)) to-newsgroup)) | |
7497 (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
|
7498 (gnus-server-to-method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7499 (gnus-group-method to-newsgroup)))) |
17493 | 7500 ;; Check the method we are to move this article to... |
7501 (unless (gnus-check-backend-function | |
7502 'request-accept-article (car to-method)) | |
7503 (error "%s does not support article copying" (car to-method))) | |
7504 (unless (gnus-check-server to-method) | |
7505 (error "Can't open server %s" (car to-method))) | |
7506 (gnus-message 6 "%s to %s: %s..." | |
7507 (caddr (assq action names)) | |
7508 (or (car select-method) to-newsgroup) articles) | |
7509 (while articles | |
7510 (setq article (pop articles)) | |
7511 (setq | |
7512 art-group | |
7513 (cond | |
7514 ;; Move the article. | |
7515 ((eq action 'move) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7516 ;; Remove this article from future suppression. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7517 (gnus-dup-unsuppress-article article) |
17493 | 7518 (gnus-request-move-article |
7519 article ; Article to move | |
7520 gnus-newsgroup-name ; From newsgroup | |
7521 (nth 1 (gnus-find-method-for-group | |
7522 gnus-newsgroup-name)) ; Server | |
7523 (list 'gnus-request-accept-article | |
7524 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
|
7525 (not articles) t) ; Accept form |
17493 | 7526 (not articles))) ; Only save nov last time |
7527 ;; Copy the article. | |
7528 ((eq action 'copy) | |
7529 (save-excursion | |
7530 (set-buffer copy-buf) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7531 (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
|
7532 (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
|
7533 to-newsgroup select-method (not articles) t)))) |
17493 | 7534 ;; Crosspost the article. |
7535 ((eq action 'crosspost) | |
7536 (let ((xref (message-tokenize-header | |
7537 (mail-header-xref (gnus-summary-article-header article)) | |
7538 " "))) | |
7539 (setq new-xref (concat (gnus-group-real-name gnus-newsgroup-name) | |
7540 ":" article)) | |
7541 (unless xref | |
7542 (setq xref (list (system-name)))) | |
7543 (setq new-xref | |
7544 (concat | |
7545 (mapconcat 'identity | |
7546 (delete "Xref:" (delete new-xref xref)) | |
7547 " ") | |
7548 " " new-xref)) | |
7549 (save-excursion | |
7550 (set-buffer copy-buf) | |
7551 ;; First put the article in the destination group. | |
7552 (gnus-request-article-this-buffer article gnus-newsgroup-name) | |
7553 (when (consp (setq art-group | |
7554 (gnus-request-accept-article | |
7555 to-newsgroup select-method (not articles)))) | |
7556 (setq new-xref (concat new-xref " " (car art-group) | |
7557 ":" (cdr art-group))) | |
7558 ;; Now we have the new Xrefs header, so we insert | |
7559 ;; it and replace the new article. | |
7560 (nnheader-replace-header "Xref" new-xref) | |
7561 (gnus-request-replace-article | |
7562 (cdr art-group) to-newsgroup (current-buffer)) | |
7563 art-group)))))) | |
7564 (cond | |
7565 ((not art-group) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7566 (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
|
7567 (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
|
7568 (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
|
7569 ((eq art-group 'junk) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7570 (when (eq action 'move) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7571 (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
|
7572 (gnus-message 4 "Deleted article %s" article))) |
17493 | 7573 (t |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7574 (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
|
7575 (car art-group) to-method)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7576 (entry |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7577 (gnus-gethash pto-group gnus-newsrc-hashtb)) |
17493 | 7578 (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
|
7579 (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
|
7580 to-marks) |
17493 | 7581 ;; Update the group that has been moved to. |
7582 (when (and info | |
7583 (memq action '(move copy))) | |
7584 (unless (member to-group to-groups) | |
7585 (push to-group to-groups)) | |
7586 | |
7587 (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
|
7588 (push 'read to-marks) |
17493 | 7589 (gnus-info-set-read |
7590 info (gnus-add-to-range (gnus-info-read info) | |
7591 (list (cdr art-group))))) | |
7592 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7593 ;; See whether the article is to be put in the cache. |
17493 | 7594 (let ((marks gnus-article-mark-lists) |
7595 (to-article (cdr art-group))) | |
7596 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7597 ;; 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
|
7598 ;; if that is required. |
17493 | 7599 (when gnus-use-cache |
7600 (gnus-cache-possibly-enter-article | |
7601 to-group to-article | |
7602 (memq article gnus-newsgroup-marked) | |
7603 (memq article gnus-newsgroup-dormant) | |
7604 (memq article gnus-newsgroup-unreads))) | |
7605 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7606 (when gnus-preserve-marks |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7607 ;; 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
|
7608 (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
|
7609 (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
|
7610 ;; 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
|
7611 (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
|
7612 (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
|
7613 (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
|
7614 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7615 (while marks |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7616 (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
|
7617 (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
|
7618 (caar marks))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7619 (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
|
7620 ;; 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
|
7621 ;; 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
|
7622 (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
|
7623 (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
|
7624 (cons to-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7625 (symbol-value |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7626 (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
|
7627 (caar marks))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7628 ;; 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
|
7629 (gnus-add-marked-articles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7630 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
|
7631 (setq marks (cdr marks))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7632 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7633 (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
|
7634 'set |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7635 to-marks)))) |
17493 | 7636 |
7637 (gnus-dribble-enter | |
7638 (concat "(gnus-group-set-info '" | |
7639 (gnus-prin1-to-string (gnus-get-info to-group)) | |
7640 ")")))) | |
7641 | |
7642 ;; Update the Xref header in this article to point to | |
7643 ;; the new crossposted article we have just created. | |
7644 (when (eq action 'crosspost) | |
7645 (save-excursion | |
7646 (set-buffer copy-buf) | |
7647 (gnus-request-article-this-buffer article gnus-newsgroup-name) | |
7648 (nnheader-replace-header "Xref" new-xref) | |
7649 (gnus-request-replace-article | |
7650 article gnus-newsgroup-name (current-buffer))))) | |
7651 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7652 ;;;!!!Why is this necessary? |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7653 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7654 |
17493 | 7655 (gnus-summary-goto-subject article) |
7656 (when (eq action 'move) | |
7657 (gnus-summary-mark-article article gnus-canceled-mark)))) | |
7658 (gnus-summary-remove-process-mark article)) | |
7659 ;; Re-activate all groups that have been moved to. | |
7660 (while to-groups | |
7661 (save-excursion | |
7662 (set-buffer gnus-group-buffer) | |
7663 (when (gnus-group-goto-group (car to-groups) t) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7664 (gnus-group-get-new-news-this-group 1 t)) |
17493 | 7665 (pop to-groups))) |
7666 | |
7667 (gnus-kill-buffer copy-buf) | |
7668 (gnus-summary-position-point) | |
7669 (gnus-set-mode-line 'summary))) | |
7670 | |
7671 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method) | |
7672 "Move the current article to a different newsgroup. | |
7673 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to. | |
7674 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but | |
7675 re-spool using this method." | |
7676 (interactive "P") | |
7677 (gnus-summary-move-article n to-newsgroup select-method 'copy)) | |
7678 | |
7679 (defun gnus-summary-crosspost-article (&optional n) | |
7680 "Crosspost the current article to some other group." | |
7681 (interactive "P") | |
7682 (gnus-summary-move-article n nil nil 'crosspost)) | |
7683 | |
7684 (defcustom gnus-summary-respool-default-method nil | |
7685 "Default method for respooling an article. | |
7686 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
|
7687 :type '(choice (gnus-select-method :value (nnml "")) |
41843e16f6ac
(gnus-summary-respool-default-method): Fix type.
Karl Heuer <kwzh@gnu.org>
parents:
20117
diff
changeset
|
7688 (const nil)) |
17493 | 7689 :group 'gnus-summary-mail) |
7690 | |
7691 (defun gnus-summary-respool-article (&optional n method) | |
7692 "Respool the current article. | |
7693 The article will be squeezed through the mail spooling process again, | |
7694 which means that it will be put in some mail newsgroup or other | |
7695 depending on `nnmail-split-methods'. | |
7696 If N is a positive number, respool the N next articles. | |
7697 If N is a negative number, respool the N previous articles. | |
7698 If N is nil and any articles have been marked with the process mark, | |
7699 respool those articles instead. | |
7700 | |
7701 Respooling can be done both from mail groups and \"real\" newsgroups. | |
7702 In the former case, the articles in question will be moved from the | |
7703 current group into whatever groups they are destined to. In the | |
7704 latter case, they will be copied into the relevant groups." | |
7705 (interactive | |
7706 (list current-prefix-arg | |
7707 (let* ((methods (gnus-methods-using 'respool)) | |
7708 (methname | |
7709 (symbol-name (or gnus-summary-respool-default-method | |
7710 (car (gnus-find-method-for-group | |
7711 gnus-newsgroup-name))))) | |
7712 (method | |
7713 (gnus-completing-read | |
7714 methname "What backend do you want to use when respooling?" | |
7715 methods nil t nil 'gnus-mail-method-history)) | |
7716 ms) | |
7717 (cond | |
7718 ((zerop (length (setq ms (gnus-servers-using-backend | |
7719 (intern method))))) | |
7720 (list (intern method) "")) | |
7721 ((= 1 (length ms)) | |
7722 (car ms)) | |
7723 (t | |
7724 (let ((ms-alist (mapcar (lambda (m) (cons (cadr m) m)) ms))) | |
7725 (cdr (assoc (completing-read "Server name: " ms-alist nil t) | |
7726 ms-alist)))))))) | |
7727 (unless method | |
7728 (error "No method given for respooling")) | |
7729 (if (assoc (symbol-name | |
7730 (car (gnus-find-method-for-group gnus-newsgroup-name))) | |
7731 (gnus-methods-using 'respool)) | |
7732 (gnus-summary-move-article n nil method) | |
7733 (gnus-summary-copy-article n nil method))) | |
7734 | |
7735 (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
|
7736 "Import an arbitrary file into a mail newsgroup." |
17493 | 7737 (interactive "fImport file: ") |
7738 (let ((group gnus-newsgroup-name) | |
7739 (now (current-time)) | |
7740 atts lines) | |
7741 (unless (gnus-check-backend-function 'request-accept-article group) | |
7742 (error "%s does not support article importing" group)) | |
7743 (or (file-readable-p file) | |
7744 (not (file-regular-p file)) | |
7745 (error "Can't read %s" file)) | |
7746 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7747 (set-buffer (gnus-get-buffer-create " *import file*")) |
17493 | 7748 (erase-buffer) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7749 (nnheader-insert-file-contents file) |
17493 | 7750 (goto-char (point-min)) |
7751 (unless (nnheader-article-p) | |
7752 ;; This doesn't look like an article, so we fudge some headers. | |
7753 (setq atts (file-attributes file) | |
7754 lines (count-lines (point-min) (point-max))) | |
7755 (insert "From: " (read-string "From: ") "\n" | |
7756 "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
|
7757 "Date: " (message-make-date (nth 5 atts)) |
17493 | 7758 "\n" |
7759 "Message-ID: " (message-make-message-id) "\n" | |
7760 "Lines: " (int-to-string lines) "\n" | |
7761 "Chars: " (int-to-string (nth 7 atts)) "\n\n")) | |
7762 (gnus-request-accept-article group nil t) | |
7763 (kill-buffer (current-buffer))))) | |
7764 | |
7765 (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
|
7766 "Say whether the current (mail) article is available from news as well. |
17493 | 7767 This will be the case if the article has both been mailed and posted." |
7768 (interactive) | |
7769 (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
|
7770 (gnus-override-method (car (gnus-refer-article-methods)))) |
17493 | 7771 (if (gnus-request-head id "") |
7772 (gnus-message 2 "The current message was found on %s" | |
7773 gnus-override-method) | |
7774 (gnus-message 2 "The current message couldn't be found on %s" | |
7775 gnus-override-method) | |
7776 nil))) | |
7777 | |
7778 (defun gnus-summary-expire-articles (&optional now) | |
7779 "Expire all articles that are marked as expirable in the current group." | |
7780 (interactive) | |
7781 (when (gnus-check-backend-function | |
7782 'request-expire-articles gnus-newsgroup-name) | |
7783 ;; This backend supports expiry. | |
7784 (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name)) | |
7785 (expirable (if total | |
7786 (progn | |
7787 ;; We need to update the info for | |
7788 ;; this group for `gnus-list-of-read-articles' | |
7789 ;; 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
|
7790 (gnus-run-hooks 'gnus-exit-group-hook) |
17493 | 7791 (gnus-summary-update-info) |
7792 (gnus-list-of-read-articles gnus-newsgroup-name)) | |
7793 (setq gnus-newsgroup-expirable | |
7794 (sort gnus-newsgroup-expirable '<)))) | |
7795 (expiry-wait (if now 'immediate | |
7796 (gnus-group-find-parameter | |
7797 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
|
7798 (nnmail-expiry-target |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7799 (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
|
7800 nnmail-expiry-target)) |
17493 | 7801 es) |
7802 (when expirable | |
7803 ;; There are expirable articles in this group, so we run them | |
7804 ;; through the expiry process. | |
7805 (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
|
7806 (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
|
7807 (error "Can't open server for %s" gnus-newsgroup-name)) |
17493 | 7808 ;; 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
|
7809 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7810 (if expiry-wait |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7811 (let ((nnmail-expiry-wait-function nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7812 (nnmail-expiry-wait expiry-wait)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7813 (setq es (gnus-request-expire-articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7814 expirable gnus-newsgroup-name))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7815 (setq es (gnus-request-expire-articles |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7816 expirable gnus-newsgroup-name)))) |
17493 | 7817 (unless total |
7818 (setq gnus-newsgroup-expirable es)) | |
7819 ;; We go through the old list of expirable, and mark all | |
7820 ;; really expired articles as nonexistent. | |
7821 (unless (eq es expirable) ;If nothing was expired, we don't mark. | |
7822 (let ((gnus-use-cache nil)) | |
7823 (while expirable | |
7824 (unless (memq (car expirable) es) | |
7825 (when (gnus-data-find (car expirable)) | |
7826 (gnus-summary-mark-article | |
7827 (car expirable) gnus-canceled-mark))) | |
7828 (setq expirable (cdr expirable))))) | |
7829 (gnus-message 6 "Expiring articles...done"))))) | |
7830 | |
7831 (defun gnus-summary-expire-articles-now () | |
7832 "Expunge all expirable articles in the current group. | |
7833 This means that *all* articles that are marked as expirable will be | |
7834 deleted forever, right now." | |
7835 (interactive) | |
7836 (or gnus-expert-user | |
7837 (gnus-yes-or-no-p | |
7838 "Are you really, really, really sure you want to delete all these messages? ") | |
7839 (error "Phew!")) | |
7840 (gnus-summary-expire-articles t)) | |
7841 | |
7842 ;; Suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>. | |
7843 (defun gnus-summary-delete-article (&optional n) | |
7844 "Delete the N next (mail) articles. | |
7845 This command actually deletes articles. This is not a marking | |
7846 command. The article will disappear forever from your life, never to | |
7847 return. | |
7848 If N is negative, delete backwards. | |
7849 If N is nil and articles have been marked with the process mark, | |
7850 delete these instead." | |
7851 (interactive "P") | |
7852 (unless (gnus-check-backend-function 'request-expire-articles | |
7853 gnus-newsgroup-name) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
7854 (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
|
7855 (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
|
7856 (error "Couldn't open server")) |
17493 | 7857 ;; 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
|
7858 (let ((articles (sort (copy-sequence (gnus-summary-work-articles n)) '<)) |
17493 | 7859 not-deleted) |
7860 (if (and gnus-novice-user | |
7861 (not (gnus-yes-or-no-p | |
7862 (format "Do you really want to delete %s forever? " | |
7863 (if (> (length articles) 1) | |
7864 (format "these %s articles" (length articles)) | |
7865 "this article"))))) | |
7866 () | |
7867 ;; Delete the articles. | |
7868 (setq not-deleted (gnus-request-expire-articles | |
7869 articles gnus-newsgroup-name 'force)) | |
7870 (while articles | |
7871 (gnus-summary-remove-process-mark (car articles)) | |
7872 ;; The backend might not have been able to delete the article | |
7873 ;; after all. | |
7874 (unless (memq (car articles) not-deleted) | |
7875 (gnus-summary-mark-article (car articles) gnus-canceled-mark)) | |
7876 (setq articles (cdr articles))) | |
7877 (when not-deleted | |
7878 (gnus-message 4 "Couldn't delete articles %s" not-deleted))) | |
7879 (gnus-summary-position-point) | |
7880 (gnus-set-mode-line 'summary) | |
7881 not-deleted)) | |
7882 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7883 (defun gnus-summary-edit-article (&optional arg) |
17493 | 7884 "Edit the current article. |
7885 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
|
7886 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
|
7887 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
|
7888 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
|
7889 Otherwise, allow editing of articles even in read-only |
17493 | 7890 groups." |
7891 (interactive "P") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7892 (let (force raw) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7893 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7894 ((null arg)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7895 ((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
|
7896 ((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
|
7897 force t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7898 (t (setq force t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7899 (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
|
7900 (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
|
7901 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7902 (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
|
7903 (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
|
7904 (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
|
7905 (gnus-set-global-variables) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7906 (when (and (not force) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7907 (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
|
7908 (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
|
7909 (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
|
7910 (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
|
7911 (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
|
7912 (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
|
7913 (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
|
7914 (setq raw t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7915 (gnus-article-edit-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7916 (if raw 'ignore |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7917 #'(lambda () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7918 (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
|
7919 (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
|
7920 (mime-to-mml) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7921 (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
|
7922 (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
|
7923 (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
|
7924 (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
|
7925 (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
|
7926 `(lambda (no-highlight) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7927 (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
|
7928 (mail-parse-ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7929 ',gnus-newsgroup-ignored-charsets)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7930 ,(if (not raw) '(progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7931 (mml-to-mime) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7932 (mml-destroy-buffers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7933 (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
|
7934 'mml-destroy-buffers t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7935 (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
|
7936 (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
|
7937 ,(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
|
7938 ,(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
|
7939 ,gnus-summary-buffer no-highlight)))))))) |
17493 | 7940 |
7941 (defalias 'gnus-summary-edit-article-postpone 'gnus-article-edit-exit) | |
7942 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7943 (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
|
7944 no-highlight) |
17493 | 7945 "Make edits to the current article permanent." |
7946 (interactive) | |
7947 ;; Replace the article. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7948 (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
|
7949 (with-temp-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7950 (insert-buffer-substring buf) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7951 (if (and (not read-only) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7952 (not (gnus-request-replace-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7953 (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
|
7954 (current-buffer) t))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7955 (error "Couldn't replace article") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7956 ;; Update the summary buffer. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7957 (if (and references |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7958 (equal (message-tokenize-header references " ") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7959 (message-tokenize-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7960 (or (message-fetch-field "references") "") " "))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7961 ;; 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
|
7962 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7963 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7964 (message-narrow-to-head) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7965 (let ((head (buffer-string)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7966 header) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
7967 (with-temp-buffer |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7968 (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
|
7969 (cdr gnus-article-current))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7970 (insert head) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7971 (insert ".\n") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7972 (let ((nntp-server-buffer (current-buffer))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7973 (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
|
7974 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7975 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7976 gnus-newsgroup-dependencies) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7977 t)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7978 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7979 (set-buffer gnus-summary-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7980 (gnus-data-set-header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7981 (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
|
7982 header) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7983 (gnus-summary-update-article-line |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7984 (cdr gnus-article-current) header)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7985 ;; Update threads. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7986 (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
|
7987 (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
|
7988 ;; Prettify the article buffer again. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7989 (unless no-highlight |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7990 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7991 (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
|
7992 ;;;!!! 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
|
7993 ;;;(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
|
7994 (set-buffer gnus-original-article-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7995 (gnus-request-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7996 (cdr gnus-article-current) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7997 (car gnus-article-current) (current-buffer)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7998 ;; Prettify the summary buffer line. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
7999 (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
|
8000 (gnus-run-hooks 'gnus-visual-mark-article-hook)))))) |
17493 | 8001 |
8002 (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
|
8003 "Perform editing command KEY in the article buffer." |
17493 | 8004 (interactive |
8005 (list | |
8006 (progn | |
8007 (message "%s" (concat (this-command-keys) "- ")) | |
8008 (read-char)))) | |
8009 (message "") | |
8010 (gnus-summary-edit-article) | |
8011 (execute-kbd-macro (concat (this-command-keys) key)) | |
8012 (gnus-article-edit-done)) | |
8013 | |
8014 ;;; Respooling | |
8015 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8016 (defun gnus-summary-respool-query (&optional silent trace) |
17493 | 8017 "Query where the respool algorithm would put this article." |
8018 (interactive) | |
8019 (let (gnus-mark-article-hook) | |
8020 (gnus-summary-select-article) | |
8021 (save-excursion | |
8022 (set-buffer gnus-original-article-buffer) | |
8023 (save-restriction | |
8024 (message-narrow-to-head) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8025 (let ((groups (nnmail-article-group 'identity trace))) |
17493 | 8026 (unless silent |
8027 (if groups | |
8028 (message "This message would go to %s" | |
8029 (mapconcat 'car groups ", ")) | |
8030 (message "This message would go to no groups")) | |
8031 groups)))))) | |
8032 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8033 (defun gnus-summary-respool-trace () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8034 "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
|
8035 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
|
8036 (interactive) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8037 (gnus-summary-respool-query nil t)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8038 |
17493 | 8039 ;; Summary marking commands. |
8040 | |
8041 (defun gnus-summary-kill-same-subject-and-select (&optional unmark) | |
8042 "Mark articles which has the same subject as read, and then select the next. | |
8043 If UNMARK is positive, remove any kind of mark. | |
8044 If UNMARK is negative, tick articles." | |
8045 (interactive "P") | |
8046 (when unmark | |
8047 (setq unmark (prefix-numeric-value unmark))) | |
8048 (let ((count | |
8049 (gnus-summary-mark-same-subject | |
8050 (gnus-summary-article-subject) unmark))) | |
8051 ;; Select next unread article. If auto-select-same mode, should | |
8052 ;; select the first unread article. | |
8053 (gnus-summary-next-article t (and gnus-auto-select-same | |
8054 (gnus-summary-article-subject))) | |
8055 (gnus-message 7 "%d article%s marked as %s" | |
8056 count (if (= count 1) " is" "s are") | |
8057 (if unmark "unread" "read")))) | |
8058 | |
8059 (defun gnus-summary-kill-same-subject (&optional unmark) | |
8060 "Mark articles which has the same subject as read. | |
8061 If UNMARK is positive, remove any kind of mark. | |
8062 If UNMARK is negative, tick articles." | |
8063 (interactive "P") | |
8064 (when unmark | |
8065 (setq unmark (prefix-numeric-value unmark))) | |
8066 (let ((count | |
8067 (gnus-summary-mark-same-subject | |
8068 (gnus-summary-article-subject) unmark))) | |
8069 ;; If marked as read, go to next unread subject. | |
8070 (when (null unmark) | |
8071 ;; Go to next unread subject. | |
8072 (gnus-summary-next-subject 1 t)) | |
8073 (gnus-message 7 "%d articles are marked as %s" | |
8074 count (if unmark "unread" "read")))) | |
8075 | |
8076 (defun gnus-summary-mark-same-subject (subject &optional unmark) | |
8077 "Mark articles with same SUBJECT as read, and return marked number. | |
8078 If optional argument UNMARK is positive, remove any kinds of marks. | |
8079 If optional argument UNMARK is negative, mark articles as unread instead." | |
8080 (let ((count 1)) | |
8081 (save-excursion | |
8082 (cond | |
8083 ((null unmark) ; Mark as read. | |
8084 (while (and | |
8085 (progn | |
8086 (gnus-summary-mark-article-as-read gnus-killed-mark) | |
8087 (gnus-summary-show-thread) t) | |
8088 (gnus-summary-find-subject subject)) | |
8089 (setq count (1+ count)))) | |
8090 ((> unmark 0) ; Tick. | |
8091 (while (and | |
8092 (progn | |
8093 (gnus-summary-mark-article-as-unread gnus-ticked-mark) | |
8094 (gnus-summary-show-thread) t) | |
8095 (gnus-summary-find-subject subject)) | |
8096 (setq count (1+ count)))) | |
8097 (t ; Mark as unread. | |
8098 (while (and | |
8099 (progn | |
8100 (gnus-summary-mark-article-as-unread gnus-unread-mark) | |
8101 (gnus-summary-show-thread) t) | |
8102 (gnus-summary-find-subject subject)) | |
8103 (setq count (1+ count))))) | |
8104 (gnus-set-mode-line 'summary) | |
8105 ;; Return the number of marked articles. | |
8106 count))) | |
8107 | |
8108 (defun gnus-summary-mark-as-processable (n &optional unmark) | |
8109 "Set the process mark on the next N articles. | |
8110 If N is negative, mark backward instead. If UNMARK is non-nil, remove | |
8111 the process mark instead. The difference between N and the actual | |
8112 number of articles marked is returned." | |
8113 (interactive "p") | |
8114 (let ((backward (< n 0)) | |
8115 (n (abs n))) | |
8116 (while (and | |
8117 (> n 0) | |
8118 (if unmark | |
8119 (gnus-summary-remove-process-mark | |
8120 (gnus-summary-article-number)) | |
8121 (gnus-summary-set-process-mark (gnus-summary-article-number))) | |
8122 (zerop (gnus-summary-next-subject (if backward -1 1) nil t))) | |
8123 (setq n (1- n))) | |
8124 (when (/= 0 n) | |
8125 (gnus-message 7 "No more articles")) | |
8126 (gnus-summary-recenter) | |
8127 (gnus-summary-position-point) | |
8128 n)) | |
8129 | |
8130 (defun gnus-summary-unmark-as-processable (n) | |
8131 "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
|
8132 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
|
8133 the actual number of articles unmarked is returned." |
17493 | 8134 (interactive "p") |
8135 (gnus-summary-mark-as-processable n t)) | |
8136 | |
8137 (defun gnus-summary-unmark-all-processable () | |
8138 "Remove the process mark from all articles." | |
8139 (interactive) | |
8140 (save-excursion | |
8141 (while gnus-newsgroup-processable | |
8142 (gnus-summary-remove-process-mark (car gnus-newsgroup-processable)))) | |
8143 (gnus-summary-position-point)) | |
8144 | |
8145 (defun gnus-summary-mark-as-expirable (n) | |
8146 "Mark N articles forward as expirable. | |
8147 If N is negative, mark backward instead. The difference between N and | |
8148 the actual number of articles marked is returned." | |
8149 (interactive "p") | |
8150 (gnus-summary-mark-forward n gnus-expirable-mark)) | |
8151 | |
8152 (defun gnus-summary-mark-article-as-replied (article) | |
8153 "Mark ARTICLE replied and update the summary line." | |
8154 (push article gnus-newsgroup-replied) | |
8155 (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
|
8156 (when (gnus-summary-goto-subject article nil t) |
17493 | 8157 (gnus-summary-update-secondary-mark article)))) |
8158 | |
8159 (defun gnus-summary-set-bookmark (article) | |
8160 "Set a bookmark in current article." | |
8161 (interactive (list (gnus-summary-article-number))) | |
8162 (when (or (not (get-buffer gnus-article-buffer)) | |
8163 (not gnus-current-article) | |
8164 (not gnus-article-current) | |
8165 (not (equal gnus-newsgroup-name (car gnus-article-current)))) | |
8166 (error "No current article selected")) | |
8167 ;; Remove old bookmark, if one exists. | |
8168 (let ((old (assq article gnus-newsgroup-bookmarks))) | |
8169 (when old | |
8170 (setq gnus-newsgroup-bookmarks | |
8171 (delq old gnus-newsgroup-bookmarks)))) | |
8172 ;; Set the new bookmark, which is on the form | |
8173 ;; (article-number . line-number-in-body). | |
8174 (push | |
8175 (cons article | |
8176 (save-excursion | |
8177 (set-buffer gnus-article-buffer) | |
8178 (count-lines | |
8179 (min (point) | |
8180 (save-excursion | |
8181 (goto-char (point-min)) | |
8182 (search-forward "\n\n" nil t) | |
8183 (point))) | |
8184 (point)))) | |
8185 gnus-newsgroup-bookmarks) | |
8186 (gnus-message 6 "A bookmark has been added to the current article.")) | |
8187 | |
8188 (defun gnus-summary-remove-bookmark (article) | |
8189 "Remove the bookmark from the current article." | |
8190 (interactive (list (gnus-summary-article-number))) | |
8191 ;; Remove old bookmark, if one exists. | |
8192 (let ((old (assq article gnus-newsgroup-bookmarks))) | |
8193 (if old | |
8194 (progn | |
8195 (setq gnus-newsgroup-bookmarks | |
8196 (delq old gnus-newsgroup-bookmarks)) | |
8197 (gnus-message 6 "Removed bookmark.")) | |
8198 (gnus-message 6 "No bookmark in current article.")))) | |
8199 | |
8200 ;; Suggested by Daniel Quinlan <quinlan@best.com>. | |
8201 (defun gnus-summary-mark-as-dormant (n) | |
8202 "Mark N articles forward as dormant. | |
8203 If N is negative, mark backward instead. The difference between N and | |
8204 the actual number of articles marked is returned." | |
8205 (interactive "p") | |
8206 (gnus-summary-mark-forward n gnus-dormant-mark)) | |
8207 | |
8208 (defun gnus-summary-set-process-mark (article) | |
8209 "Set the process mark on ARTICLE and update the summary line." | |
8210 (setq gnus-newsgroup-processable | |
8211 (cons article | |
8212 (delq article gnus-newsgroup-processable))) | |
8213 (when (gnus-summary-goto-subject article) | |
8214 (gnus-summary-show-thread) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8215 (gnus-summary-goto-subject article) |
17493 | 8216 (gnus-summary-update-secondary-mark article))) |
8217 | |
8218 (defun gnus-summary-remove-process-mark (article) | |
8219 "Remove the process mark from ARTICLE and update the summary line." | |
8220 (setq gnus-newsgroup-processable (delq article gnus-newsgroup-processable)) | |
8221 (when (gnus-summary-goto-subject article) | |
8222 (gnus-summary-show-thread) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8223 (gnus-summary-goto-subject article) |
17493 | 8224 (gnus-summary-update-secondary-mark article))) |
8225 | |
8226 (defun gnus-summary-set-saved-mark (article) | |
8227 "Set the process mark on ARTICLE and update the summary line." | |
8228 (push article gnus-newsgroup-saved) | |
8229 (when (gnus-summary-goto-subject article) | |
8230 (gnus-summary-update-secondary-mark article))) | |
8231 | |
8232 (defun gnus-summary-mark-forward (n &optional mark no-expire) | |
8233 "Mark N articles as read forwards. | |
8234 If N is negative, mark backwards instead. Mark with MARK, ?r by default. | |
8235 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
|
8236 returned. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8237 Iff NO-EXPIRE, auto-expiry will be inhibited." |
17493 | 8238 (interactive "p") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8239 (gnus-summary-show-thread) |
17493 | 8240 (let ((backward (< n 0)) |
8241 (gnus-summary-goto-unread | |
8242 (and gnus-summary-goto-unread | |
8243 (not (eq gnus-summary-goto-unread 'never)) | |
8244 (not (memq mark (list gnus-unread-mark | |
8245 gnus-ticked-mark gnus-dormant-mark))))) | |
8246 (n (abs n)) | |
8247 (mark (or mark gnus-del-mark))) | |
8248 (while (and (> n 0) | |
8249 (gnus-summary-mark-article nil mark no-expire) | |
8250 (zerop (gnus-summary-next-subject | |
8251 (if backward -1 1) | |
8252 (and gnus-summary-goto-unread | |
8253 (not (eq gnus-summary-goto-unread 'never))) | |
8254 t))) | |
8255 (setq n (1- n))) | |
8256 (when (/= 0 n) | |
8257 (gnus-message 7 "No more %sarticles" (if mark "" "unread "))) | |
8258 (gnus-summary-recenter) | |
8259 (gnus-summary-position-point) | |
8260 (gnus-set-mode-line 'summary) | |
8261 n)) | |
8262 | |
8263 (defun gnus-summary-mark-article-as-read (mark) | |
8264 "Mark the current article quickly as read with MARK." | |
8265 (let ((article (gnus-summary-article-number))) | |
8266 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) | |
8267 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) | |
8268 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) | |
8269 (push (cons article mark) gnus-newsgroup-reads) | |
8270 ;; Possibly remove from cache, if that is used. | |
8271 (when gnus-use-cache | |
8272 (gnus-cache-enter-remove-article article)) | |
8273 ;; Allow the backend to change the mark. | |
8274 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) | |
8275 ;; Check for auto-expiry. | |
8276 (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
|
8277 (memq mark gnus-auto-expirable-marks)) |
17493 | 8278 (setq mark gnus-expirable-mark) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8279 ;; 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
|
8280 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) |
17493 | 8281 (push article gnus-newsgroup-expirable)) |
8282 ;; Set the mark in the buffer. | |
8283 (gnus-summary-update-mark mark 'unread) | |
8284 t)) | |
8285 | |
8286 (defun gnus-summary-mark-article-as-unread (mark) | |
8287 "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
|
8288 (let* ((article (gnus-summary-article-number)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8289 (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
|
8290 ;; 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
|
8291 (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
|
8292 (if (eq mark old-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8293 t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8294 (if (<= article 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8295 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8296 (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
|
8297 nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8298 (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
|
8299 (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
|
8300 (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
|
8301 (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
|
8302 (cond ((= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8303 (push article gnus-newsgroup-marked)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8304 ((= mark gnus-dormant-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8305 (push article gnus-newsgroup-dormant)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8306 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8307 (push article gnus-newsgroup-unreads))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8308 (gnus-pull article gnus-newsgroup-reads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8309 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8310 ;; 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
|
8311 (and gnus-use-cache |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8312 (vectorp (gnus-summary-article-header article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8313 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8314 (gnus-cache-possibly-enter-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8315 gnus-newsgroup-name article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8316 (= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8317 (= 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
|
8318 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8319 ;; Fix the mark. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8320 (gnus-summary-update-mark mark 'unread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8321 t)))) |
17493 | 8322 |
8323 (defun gnus-summary-mark-article (&optional article mark no-expire) | |
8324 "Mark ARTICLE with MARK. MARK can be any character. | |
8325 Four MARK strings are reserved: `? ' (unread), `?!' (ticked), | |
8326 `??' (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
|
8327 If MARK is nil, then the default character `?r' is used. |
17493 | 8328 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
|
8329 marked. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8330 Iff NO-EXPIRE, auto-expiry will be inhibited." |
17493 | 8331 ;; The mark might be a string. |
8332 (when (stringp mark) | |
8333 (setq mark (aref mark 0))) | |
8334 ;; 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
|
8335 (when (null mark) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8336 (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
|
8337 (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
|
8338 gnus-newsgroup-auto-expire |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8339 (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
|
8340 (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
|
8341 (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
|
8342 (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
|
8343 ;; 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
|
8344 (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
|
8345 (if (eq mark old-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8346 t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8347 (unless article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8348 (error "No article on current line")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8349 (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
|
8350 (= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8351 (= mark gnus-dormant-mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8352 (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
|
8353 (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
|
8354 t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8355 ;; 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
|
8356 (and gnus-use-cache |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8357 (not (= mark gnus-canceled-mark)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8358 (vectorp (gnus-summary-article-header article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8359 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8360 (gnus-cache-possibly-enter-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8361 gnus-newsgroup-name article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8362 (= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8363 (= 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
|
8364 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8365 (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
|
8366 (let ((buffer-read-only nil)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8367 (gnus-summary-show-thread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8368 ;; Fix the mark. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8369 (gnus-summary-update-mark mark 'unread) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8370 t)))))) |
17493 | 8371 |
8372 (defun gnus-summary-update-secondary-mark (article) | |
8373 "Update the secondary (read, process, cache) mark." | |
8374 (gnus-summary-update-mark | |
8375 (cond ((memq article gnus-newsgroup-processable) | |
8376 gnus-process-mark) | |
8377 ((memq article gnus-newsgroup-cached) | |
8378 gnus-cached-mark) | |
8379 ((memq article gnus-newsgroup-replied) | |
8380 gnus-replied-mark) | |
8381 ((memq article gnus-newsgroup-saved) | |
8382 gnus-saved-mark) | |
8383 (t gnus-unread-mark)) | |
8384 'replied) | |
8385 (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
|
8386 (gnus-run-hooks 'gnus-summary-update-hook)) |
17493 | 8387 t) |
8388 | |
8389 (defun gnus-summary-update-mark (mark type) | |
8390 (let ((forward (cdr (assq type gnus-summary-mark-positions))) | |
8391 (buffer-read-only nil)) | |
8392 (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
|
8393 (when forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8394 (when (looking-at "\r") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8395 (incf forward)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8396 (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
|
8397 ;; 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
|
8398 (goto-char (+ forward (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8399 ;; 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
|
8400 (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
|
8401 ;; 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
|
8402 (when (eq type 'unread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8403 (gnus-data-set-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8404 (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
|
8405 (gnus-summary-update-line (eq mark gnus-unread-mark))))))) |
17493 | 8406 |
8407 (defun gnus-mark-article-as-read (article &optional mark) | |
8408 "Enter ARTICLE in the pertinent lists and remove it from others." | |
8409 ;; Make the article expirable. | |
8410 (let ((mark (or mark gnus-del-mark))) | |
8411 (if (= mark gnus-expirable-mark) | |
8412 (push article gnus-newsgroup-expirable) | |
8413 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))) | |
8414 ;; Remove from unread and marked lists. | |
8415 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) | |
8416 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) | |
8417 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) | |
8418 (push (cons article mark) gnus-newsgroup-reads) | |
8419 ;; Possibly remove from cache, if that is used. | |
8420 (when gnus-use-cache | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8421 (gnus-cache-enter-remove-article article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8422 t)) |
17493 | 8423 |
8424 (defun gnus-mark-article-as-unread (article &optional mark) | |
8425 "Enter ARTICLE in the pertinent lists and remove it from others." | |
8426 (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
|
8427 (if (<= article 0) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8428 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8429 (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
|
8430 nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8431 (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
|
8432 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
|
8433 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
|
8434 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
|
8435 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8436 ;; Unsuppress duplicates? |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8437 (when gnus-suppress-duplicates |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8438 (gnus-dup-unsuppress-article article)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8439 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8440 (cond ((= mark gnus-ticked-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8441 (push article gnus-newsgroup-marked)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8442 ((= mark gnus-dormant-mark) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8443 (push article gnus-newsgroup-dormant)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8444 (t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8445 (push article gnus-newsgroup-unreads))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8446 (gnus-pull article gnus-newsgroup-reads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8447 t))) |
17493 | 8448 |
8449 (defalias 'gnus-summary-mark-as-unread-forward | |
8450 'gnus-summary-tick-article-forward) | |
8451 (make-obsolete 'gnus-summary-mark-as-unread-forward | |
8452 'gnus-summary-tick-article-forward) | |
8453 (defun gnus-summary-tick-article-forward (n) | |
8454 "Tick N articles forwards. | |
8455 If N is negative, tick backwards instead. | |
8456 The difference between N and the number of articles ticked is returned." | |
8457 (interactive "p") | |
8458 (gnus-summary-mark-forward n gnus-ticked-mark)) | |
8459 | |
8460 (defalias 'gnus-summary-mark-as-unread-backward | |
8461 'gnus-summary-tick-article-backward) | |
8462 (make-obsolete 'gnus-summary-mark-as-unread-backward | |
8463 'gnus-summary-tick-article-backward) | |
8464 (defun gnus-summary-tick-article-backward (n) | |
8465 "Tick N articles backwards. | |
8466 The difference between N and the number of articles ticked is returned." | |
8467 (interactive "p") | |
8468 (gnus-summary-mark-forward (- n) gnus-ticked-mark)) | |
8469 | |
8470 (defalias 'gnus-summary-mark-as-unread 'gnus-summary-tick-article) | |
8471 (make-obsolete 'gnus-summary-mark-as-unread 'gnus-summary-tick-article) | |
8472 (defun gnus-summary-tick-article (&optional article clear-mark) | |
8473 "Mark current article as unread. | |
8474 Optional 1st argument ARTICLE specifies article number to be marked as unread. | |
8475 Optional 2nd argument CLEAR-MARK remove any kinds of mark." | |
8476 (interactive) | |
8477 (gnus-summary-mark-article article (if clear-mark gnus-unread-mark | |
8478 gnus-ticked-mark))) | |
8479 | |
8480 (defun gnus-summary-mark-as-read-forward (n) | |
8481 "Mark N articles as read forwards. | |
8482 If N is negative, mark backwards instead. | |
8483 The difference between N and the actual number of articles marked is | |
8484 returned." | |
8485 (interactive "p") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8486 (gnus-summary-mark-forward n gnus-del-mark gnus-inhibit-user-auto-expire)) |
17493 | 8487 |
8488 (defun gnus-summary-mark-as-read-backward (n) | |
8489 "Mark the N articles as read backwards. | |
8490 The difference between N and the actual number of articles marked is | |
8491 returned." | |
8492 (interactive "p") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8493 (gnus-summary-mark-forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8494 (- n) gnus-del-mark gnus-inhibit-user-auto-expire)) |
17493 | 8495 |
8496 (defun gnus-summary-mark-as-read (&optional article mark) | |
8497 "Mark current article as read. | |
8498 ARTICLE specifies the article to be marked as read. | |
8499 MARK specifies a string to be inserted at the beginning of the line." | |
8500 (gnus-summary-mark-article article mark)) | |
8501 | |
8502 (defun gnus-summary-clear-mark-forward (n) | |
8503 "Clear marks from N articles forward. | |
8504 If N is negative, clear backward instead. | |
8505 The difference between N and the number of marks cleared is returned." | |
8506 (interactive "p") | |
8507 (gnus-summary-mark-forward n gnus-unread-mark)) | |
8508 | |
8509 (defun gnus-summary-clear-mark-backward (n) | |
8510 "Clear marks from N articles backward. | |
8511 The difference between N and the number of marks cleared is returned." | |
8512 (interactive "p") | |
8513 (gnus-summary-mark-forward (- n) gnus-unread-mark)) | |
8514 | |
8515 (defun gnus-summary-mark-unread-as-read () | |
8516 "Intended to be used by `gnus-summary-mark-article-hook'." | |
8517 (when (memq gnus-current-article gnus-newsgroup-unreads) | |
8518 (gnus-summary-mark-article gnus-current-article gnus-read-mark))) | |
8519 | |
8520 (defun gnus-summary-mark-read-and-unread-as-read () | |
8521 "Intended to be used by `gnus-summary-mark-article-hook'." | |
8522 (let ((mark (gnus-summary-article-mark))) | |
8523 (when (or (gnus-unread-mark-p mark) | |
8524 (gnus-read-mark-p mark)) | |
8525 (gnus-summary-mark-article gnus-current-article gnus-read-mark)))) | |
8526 | |
8527 (defun gnus-summary-mark-region-as-read (point mark all) | |
8528 "Mark all unread articles between point and mark as read. | |
8529 If given a prefix, mark all articles between point and mark as read, | |
8530 even ticked and dormant ones." | |
8531 (interactive "r\nP") | |
8532 (save-excursion | |
8533 (let (article) | |
8534 (goto-char point) | |
8535 (beginning-of-line) | |
8536 (while (and | |
8537 (< (point) mark) | |
8538 (progn | |
8539 (when (or all | |
8540 (memq (setq article (gnus-summary-article-number)) | |
8541 gnus-newsgroup-unreads)) | |
8542 (gnus-summary-mark-article article gnus-del-mark)) | |
8543 t) | |
8544 (gnus-summary-find-next)))))) | |
8545 | |
8546 (defun gnus-summary-mark-below (score mark) | |
8547 "Mark articles with score less than SCORE with MARK." | |
8548 (interactive "P\ncMark: ") | |
8549 (setq score (if score | |
8550 (prefix-numeric-value score) | |
8551 (or gnus-summary-default-score 0))) | |
8552 (save-excursion | |
8553 (set-buffer gnus-summary-buffer) | |
8554 (goto-char (point-min)) | |
8555 (while | |
8556 (progn | |
8557 (and (< (gnus-summary-article-score) score) | |
8558 (gnus-summary-mark-article nil mark)) | |
8559 (gnus-summary-find-next))))) | |
8560 | |
8561 (defun gnus-summary-kill-below (&optional score) | |
8562 "Mark articles with score below SCORE as read." | |
8563 (interactive "P") | |
8564 (gnus-summary-mark-below score gnus-killed-mark)) | |
8565 | |
8566 (defun gnus-summary-clear-above (&optional score) | |
8567 "Clear all marks from articles with score above SCORE." | |
8568 (interactive "P") | |
8569 (gnus-summary-mark-above score gnus-unread-mark)) | |
8570 | |
8571 (defun gnus-summary-tick-above (&optional score) | |
8572 "Tick all articles with score above SCORE." | |
8573 (interactive "P") | |
8574 (gnus-summary-mark-above score gnus-ticked-mark)) | |
8575 | |
8576 (defun gnus-summary-mark-above (score mark) | |
8577 "Mark articles with score over SCORE with MARK." | |
8578 (interactive "P\ncMark: ") | |
8579 (setq score (if score | |
8580 (prefix-numeric-value score) | |
8581 (or gnus-summary-default-score 0))) | |
8582 (save-excursion | |
8583 (set-buffer gnus-summary-buffer) | |
8584 (goto-char (point-min)) | |
8585 (while (and (progn | |
8586 (when (> (gnus-summary-article-score) score) | |
8587 (gnus-summary-mark-article nil mark)) | |
8588 t) | |
8589 (gnus-summary-find-next))))) | |
8590 | |
8591 ;; Suggested by Daniel Quinlan <quinlan@best.com>. | |
8592 (defalias 'gnus-summary-show-all-expunged 'gnus-summary-limit-include-expunged) | |
8593 (defun gnus-summary-limit-include-expunged (&optional no-error) | |
8594 "Display all the hidden articles that were expunged for low scores." | |
8595 (interactive) | |
8596 (let ((buffer-read-only nil)) | |
8597 (let ((scored gnus-newsgroup-scored) | |
8598 headers h) | |
8599 (while scored | |
8600 (unless (gnus-summary-goto-subject (caar scored)) | |
8601 (and (setq h (gnus-summary-article-header (caar scored))) | |
8602 (< (cdar scored) gnus-summary-expunge-below) | |
8603 (push h headers))) | |
8604 (setq scored (cdr scored))) | |
8605 (if (not headers) | |
8606 (when (not no-error) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8607 (error "No expunged articles hidden")) |
17493 | 8608 (goto-char (point-min)) |
8609 (gnus-summary-prepare-unthreaded (nreverse headers)) | |
8610 (goto-char (point-min)) | |
8611 (gnus-summary-position-point) | |
8612 t)))) | |
8613 | |
8614 (defun gnus-summary-catchup (&optional all quietly to-here not-mark) | |
8615 "Mark all unread articles in this newsgroup as read. | |
8616 If prefix argument ALL is non-nil, ticked and dormant articles will | |
8617 also be marked as read. | |
8618 If QUIETLY is non-nil, no questions will be asked. | |
8619 If TO-HERE is non-nil, it should be a point in the buffer. All | |
8620 articles before this point will be marked as read. | |
8621 Note that this function will only catch up the unread article | |
8622 in the current summary buffer limitation. | |
8623 The number of articles marked as read is returned." | |
8624 (interactive "P") | |
8625 (prog1 | |
8626 (save-excursion | |
8627 (when (or quietly | |
8628 (not gnus-interactive-catchup) ;Without confirmation? | |
8629 gnus-expert-user | |
8630 (gnus-y-or-n-p | |
8631 (if all | |
8632 "Mark absolutely all articles as read? " | |
8633 "Mark all unread articles as read? "))) | |
8634 (if (and not-mark | |
8635 (not gnus-newsgroup-adaptive) | |
8636 (not gnus-newsgroup-auto-expire) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8637 (not gnus-suppress-duplicates) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8638 (or (not gnus-use-cache) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8639 (eq gnus-use-cache 'passive))) |
17493 | 8640 (progn |
8641 (when all | |
8642 (setq gnus-newsgroup-marked nil | |
8643 gnus-newsgroup-dormant nil)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8644 (setq gnus-newsgroup-unreads gnus-newsgroup-downloadable)) |
17493 | 8645 ;; We actually mark all articles as canceled, which we |
8646 ;; have to do when using auto-expiry or adaptive scoring. | |
8647 (gnus-summary-show-all-threads) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8648 (when (gnus-summary-first-subject (not all) t) |
17493 | 8649 (while (and |
8650 (if to-here (< (point) to-here) t) | |
8651 (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
|
8652 (gnus-summary-find-next (not all) nil nil t)))) |
17493 | 8653 (gnus-set-mode-line 'summary)) |
8654 t)) | |
8655 (gnus-summary-position-point))) | |
8656 | |
8657 (defun gnus-summary-catchup-to-here (&optional all) | |
8658 "Mark all unticked articles before the current one as read. | |
8659 If ALL is non-nil, also mark ticked and dormant articles as read." | |
8660 (interactive "P") | |
8661 (save-excursion | |
8662 (gnus-save-hidden-threads | |
8663 (let ((beg (point))) | |
8664 ;; We check that there are unread articles. | |
8665 (when (or all (gnus-summary-find-prev)) | |
8666 (gnus-summary-catchup all t beg))))) | |
8667 (gnus-summary-position-point)) | |
8668 | |
8669 (defun gnus-summary-catchup-all (&optional quietly) | |
8670 "Mark all articles in this newsgroup as read." | |
8671 (interactive "P") | |
8672 (gnus-summary-catchup t quietly)) | |
8673 | |
8674 (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
|
8675 "Mark all unread articles in this group as read, then exit. |
17493 | 8676 If prefix argument ALL is non-nil, all articles are marked as read." |
8677 (interactive "P") | |
8678 (when (gnus-summary-catchup all quietly nil 'fast) | |
8679 ;; Select next newsgroup or exit. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8680 (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
|
8681 (eq gnus-auto-select-next 'quietly)) |
17493 | 8682 (gnus-summary-next-group nil) |
8683 (gnus-summary-exit)))) | |
8684 | |
8685 (defun gnus-summary-catchup-all-and-exit (&optional quietly) | |
8686 "Mark all articles in this newsgroup as read, and then exit." | |
8687 (interactive "P") | |
8688 (gnus-summary-catchup-and-exit t quietly)) | |
8689 | |
8690 (defun gnus-summary-catchup-and-goto-next-group (&optional all) | |
8691 "Mark all articles in this group as read and select the next group. | |
8692 If given a prefix, mark all articles, unread as well as ticked, as | |
8693 read." | |
8694 (interactive "P") | |
8695 (save-excursion | |
8696 (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
|
8697 (gnus-summary-next-group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8698 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8699 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8700 ;;; with article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8701 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8702 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8703 (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
|
8704 "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
|
8705 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
|
8706 `(progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8707 ;; 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
|
8708 (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
|
8709 (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
|
8710 (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
|
8711 ,@forms |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8712 (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
|
8713 '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
|
8714 (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
|
8715 (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
|
8716 ,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
|
8717 (current-buffer) t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8718 (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
|
8719 ;; 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
|
8720 (when gnus-keep-backlog |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8721 (gnus-backlog-remove-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8722 (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
|
8723 (when gnus-use-cache |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8724 (gnus-cache-update-article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8725 (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
|
8726 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8727 (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
|
8728 (put 'gnus-with-article 'edebug-form-spec '(form body)) |
17493 | 8729 |
8730 ;; Thread-based commands. | |
8731 | |
8732 (defun gnus-summary-articles-in-thread (&optional article) | |
8733 "Return a list of all articles in the current thread. | |
8734 If ARTICLE is non-nil, return all articles in the thread that starts | |
8735 with that article." | |
8736 (let* ((article (or article (gnus-summary-article-number))) | |
8737 (data (gnus-data-find-list article)) | |
8738 (top-level (gnus-data-level (car data))) | |
8739 (top-subject | |
8740 (cond ((null gnus-thread-operation-ignore-subject) | |
8741 (gnus-simplify-subject-re | |
8742 (mail-header-subject (gnus-data-header (car data))))) | |
8743 ((eq gnus-thread-operation-ignore-subject 'fuzzy) | |
8744 (gnus-simplify-subject-fuzzy | |
8745 (mail-header-subject (gnus-data-header (car data))))) | |
8746 (t nil))) | |
8747 (end-point (save-excursion | |
8748 (if (gnus-summary-go-to-next-thread) | |
8749 (point) (point-max)))) | |
8750 articles) | |
8751 (while (and data | |
8752 (< (gnus-data-pos (car data)) end-point)) | |
8753 (when (or (not top-subject) | |
8754 (string= top-subject | |
8755 (if (eq gnus-thread-operation-ignore-subject 'fuzzy) | |
8756 (gnus-simplify-subject-fuzzy | |
8757 (mail-header-subject | |
8758 (gnus-data-header (car data)))) | |
8759 (gnus-simplify-subject-re | |
8760 (mail-header-subject | |
8761 (gnus-data-header (car data))))))) | |
8762 (push (gnus-data-number (car data)) articles)) | |
8763 (unless (and (setq data (cdr data)) | |
8764 (> (gnus-data-level (car data)) top-level)) | |
8765 (setq data nil))) | |
8766 ;; Return the list of articles. | |
8767 (nreverse articles))) | |
8768 | |
8769 (defun gnus-summary-rethread-current () | |
8770 "Rethread the thread the current article is part of." | |
8771 (interactive) | |
8772 (let* ((gnus-show-threads t) | |
8773 (article (gnus-summary-article-number)) | |
8774 (id (mail-header-id (gnus-summary-article-header))) | |
8775 (gnus-newsgroup-threads (list (gnus-id-to-thread (gnus-root-id id))))) | |
8776 (unless id | |
8777 (error "No article on the current line")) | |
8778 (gnus-rebuild-thread id) | |
8779 (gnus-summary-goto-subject article))) | |
8780 | |
8781 (defun gnus-summary-reparent-thread () | |
8782 "Make the current article child of the marked (or previous) article. | |
8783 | |
8784 Note that the re-threading will only work if `gnus-thread-ignore-subject' | |
8785 is non-nil or the Subject: of both articles are the same." | |
8786 (interactive) | |
8787 (unless (not (gnus-group-read-only-p)) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8788 (error "The current newsgroup does not support article editing")) |
17493 | 8789 (unless (<= (length gnus-newsgroup-processable) 1) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8790 (error "No more than one article may be marked")) |
17493 | 8791 (save-window-excursion |
8792 (let ((gnus-article-buffer " *reparent*") | |
8793 (current-article (gnus-summary-article-number)) | |
8794 ;; First grab the marked article, otherwise one line up. | |
8795 (parent-article (if (not (null gnus-newsgroup-processable)) | |
8796 (car gnus-newsgroup-processable) | |
8797 (save-excursion | |
8798 (if (eq (forward-line -1) 0) | |
8799 (gnus-summary-article-number) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8800 (error "Beginning of summary buffer")))))) |
17493 | 8801 (unless (not (eq current-article parent-article)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8802 (error "An article may not be self-referential")) |
17493 | 8803 (let ((message-id (mail-header-id |
8804 (gnus-summary-article-header parent-article)))) | |
8805 (unless (and message-id (not (equal message-id ""))) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8806 (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
|
8807 (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
|
8808 (save-restriction |
17493 | 8809 (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
|
8810 (message-narrow-to-head) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8811 (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
|
8812 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8813 (re-search-forward "^[^ \t]" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8814 (forward-line -1) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8815 (end-of-line) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8816 (insert " " message-id)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8817 (insert "References: " message-id "\n")))) |
17493 | 8818 (set-buffer gnus-summary-buffer) |
8819 (gnus-summary-unmark-all-processable) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
8820 (gnus-summary-update-article current-article) |
17493 | 8821 (gnus-summary-rethread-current) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
8822 (gnus-message 3 "Article %d is now the child of article %d" |
17493 | 8823 current-article parent-article))))) |
8824 | |
8825 (defun gnus-summary-toggle-threads (&optional arg) | |
8826 "Toggle showing conversation threads. | |
8827 If ARG is positive number, turn showing conversation threads on." | |
8828 (interactive "P") | |
8829 (let ((current (or (gnus-summary-article-number) gnus-newsgroup-end))) | |
8830 (setq gnus-show-threads | |
8831 (if (null arg) (not gnus-show-threads) | |
8832 (> (prefix-numeric-value arg) 0))) | |
8833 (gnus-summary-prepare) | |
8834 (gnus-summary-goto-subject current) | |
8835 (gnus-message 6 "Threading is now %s" (if gnus-show-threads "on" "off")) | |
8836 (gnus-summary-position-point))) | |
8837 | |
8838 (defun gnus-summary-show-all-threads () | |
8839 "Show all threads." | |
8840 (interactive) | |
8841 (save-excursion | |
8842 (let ((buffer-read-only nil)) | |
8843 (subst-char-in-region (point-min) (point-max) ?\^M ?\n t))) | |
8844 (gnus-summary-position-point)) | |
8845 | |
8846 (defun gnus-summary-show-thread () | |
8847 "Show thread subtrees. | |
8848 Returns nil if no thread was there to be shown." | |
8849 (interactive) | |
8850 (let ((buffer-read-only nil) | |
8851 (orig (point)) | |
8852 ;; first goto end then to beg, to have point at beg after let | |
8853 (end (progn (end-of-line) (point))) | |
8854 (beg (progn (beginning-of-line) (point)))) | |
8855 (prog1 | |
8856 ;; Any hidden lines here? | |
8857 (search-forward "\r" end t) | |
8858 (subst-char-in-region beg end ?\^M ?\n t) | |
8859 (goto-char orig) | |
8860 (gnus-summary-position-point)))) | |
8861 | |
8862 (defun gnus-summary-hide-all-threads () | |
8863 "Hide all thread subtrees." | |
8864 (interactive) | |
8865 (save-excursion | |
8866 (goto-char (point-min)) | |
8867 (gnus-summary-hide-thread) | |
8868 (while (zerop (gnus-summary-next-thread 1 t)) | |
8869 (gnus-summary-hide-thread))) | |
8870 (gnus-summary-position-point)) | |
8871 | |
8872 (defun gnus-summary-hide-thread () | |
8873 "Hide thread subtrees. | |
8874 Returns nil if no threads were there to be hidden." | |
8875 (interactive) | |
8876 (let ((buffer-read-only nil) | |
8877 (start (point)) | |
8878 (article (gnus-summary-article-number))) | |
8879 (goto-char start) | |
8880 ;; Go forward until either the buffer ends or the subthread | |
8881 ;; ends. | |
8882 (when (and (not (eobp)) | |
8883 (or (zerop (gnus-summary-next-thread 1 t)) | |
8884 (goto-char (point-max)))) | |
8885 (prog1 | |
8886 (if (and (> (point) start) | |
8887 (search-backward "\n" start t)) | |
8888 (progn | |
8889 (subst-char-in-region start (point) ?\n ?\^M) | |
8890 (gnus-summary-goto-subject article)) | |
8891 (goto-char start) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
8892 nil))))) |
17493 | 8893 |
8894 (defun gnus-summary-go-to-next-thread (&optional previous) | |
8895 "Go to the same level (or less) next thread. | |
8896 If PREVIOUS is non-nil, go to previous thread instead. | |
8897 Return the article number moved to, or nil if moving was impossible." | |
8898 (let ((level (gnus-summary-thread-level)) | |
8899 (way (if previous -1 1)) | |
8900 (beg (point))) | |
8901 (forward-line way) | |
8902 (while (and (not (eobp)) | |
8903 (< level (gnus-summary-thread-level))) | |
8904 (forward-line way)) | |
8905 (if (eobp) | |
8906 (progn | |
8907 (goto-char beg) | |
8908 nil) | |
8909 (setq beg (point)) | |
8910 (prog1 | |
8911 (gnus-summary-article-number) | |
8912 (goto-char beg))))) | |
8913 | |
8914 (defun gnus-summary-next-thread (n &optional silent) | |
8915 "Go to the same level next N'th thread. | |
8916 If N is negative, search backward instead. | |
8917 Returns the difference between N and the number of skips actually | |
8918 done. | |
8919 | |
8920 If SILENT, don't output messages." | |
8921 (interactive "p") | |
8922 (let ((backward (< n 0)) | |
8923 (n (abs n))) | |
8924 (while (and (> n 0) | |
8925 (gnus-summary-go-to-next-thread backward)) | |
8926 (decf n)) | |
8927 (unless silent | |
8928 (gnus-summary-position-point)) | |
8929 (when (and (not silent) (/= 0 n)) | |
8930 (gnus-message 7 "No more threads")) | |
8931 n)) | |
8932 | |
8933 (defun gnus-summary-prev-thread (n) | |
8934 "Go to the same level previous N'th thread. | |
8935 Returns the difference between N and the number of skips actually | |
8936 done." | |
8937 (interactive "p") | |
8938 (gnus-summary-next-thread (- n))) | |
8939 | |
8940 (defun gnus-summary-go-down-thread () | |
8941 "Go down one level in the current thread." | |
8942 (let ((children (gnus-summary-article-children))) | |
8943 (when children | |
8944 (gnus-summary-goto-subject (car children))))) | |
8945 | |
8946 (defun gnus-summary-go-up-thread () | |
8947 "Go up one level in the current thread." | |
8948 (let ((parent (gnus-summary-article-parent))) | |
8949 (when parent | |
8950 (gnus-summary-goto-subject parent)))) | |
8951 | |
8952 (defun gnus-summary-down-thread (n) | |
8953 "Go down thread N steps. | |
8954 If N is negative, go up instead. | |
8955 Returns the difference between N and how many steps down that were | |
8956 taken." | |
8957 (interactive "p") | |
8958 (let ((up (< n 0)) | |
8959 (n (abs n))) | |
8960 (while (and (> n 0) | |
8961 (if up (gnus-summary-go-up-thread) | |
8962 (gnus-summary-go-down-thread))) | |
8963 (setq n (1- n))) | |
8964 (gnus-summary-position-point) | |
8965 (when (/= 0 n) | |
8966 (gnus-message 7 "Can't go further")) | |
8967 n)) | |
8968 | |
8969 (defun gnus-summary-up-thread (n) | |
8970 "Go up thread N steps. | |
8971 If N is negative, go up instead. | |
8972 Returns the difference between N and how many steps down that were | |
8973 taken." | |
8974 (interactive "p") | |
8975 (gnus-summary-down-thread (- n))) | |
8976 | |
8977 (defun gnus-summary-top-thread () | |
8978 "Go to the top of the thread." | |
8979 (interactive) | |
8980 (while (gnus-summary-go-up-thread)) | |
8981 (gnus-summary-article-number)) | |
8982 | |
8983 (defun gnus-summary-kill-thread (&optional unmark) | |
8984 "Mark articles under current thread as read. | |
8985 If the prefix argument is positive, remove any kinds of marks. | |
8986 If the prefix argument is negative, tick articles instead." | |
8987 (interactive "P") | |
8988 (when unmark | |
8989 (setq unmark (prefix-numeric-value unmark))) | |
8990 (let ((articles (gnus-summary-articles-in-thread))) | |
8991 (save-excursion | |
8992 ;; Expand the thread. | |
8993 (gnus-summary-show-thread) | |
8994 ;; Mark all the articles. | |
8995 (while articles | |
8996 (gnus-summary-goto-subject (car articles)) | |
8997 (cond ((null unmark) | |
8998 (gnus-summary-mark-article-as-read gnus-killed-mark)) | |
8999 ((> unmark 0) | |
9000 (gnus-summary-mark-article-as-unread gnus-unread-mark)) | |
9001 (t | |
9002 (gnus-summary-mark-article-as-unread gnus-ticked-mark))) | |
9003 (setq articles (cdr articles)))) | |
9004 ;; Hide killed subtrees. | |
9005 (and (null unmark) | |
9006 gnus-thread-hide-killed | |
9007 (gnus-summary-hide-thread)) | |
9008 ;; If marked as read, go to next unread subject. | |
9009 (when (null unmark) | |
9010 ;; Go to next unread subject. | |
9011 (gnus-summary-next-subject 1 t))) | |
9012 (gnus-set-mode-line 'summary)) | |
9013 | |
9014 ;; Summary sorting commands | |
9015 | |
9016 (defun gnus-summary-sort-by-number (&optional reverse) | |
9017 "Sort the summary buffer by article number. | |
9018 Argument REVERSE means reverse order." | |
9019 (interactive "P") | |
9020 (gnus-summary-sort 'number reverse)) | |
9021 | |
9022 (defun gnus-summary-sort-by-author (&optional reverse) | |
9023 "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
|
9024 If `case-fold-search' is non-nil, case of letters is ignored. |
17493 | 9025 Argument REVERSE means reverse order." |
9026 (interactive "P") | |
9027 (gnus-summary-sort 'author reverse)) | |
9028 | |
9029 (defun gnus-summary-sort-by-subject (&optional reverse) | |
9030 "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
|
9031 If `case-fold-search' is non-nil, case of letters is ignored. |
17493 | 9032 Argument REVERSE means reverse order." |
9033 (interactive "P") | |
9034 (gnus-summary-sort 'subject reverse)) | |
9035 | |
9036 (defun gnus-summary-sort-by-date (&optional reverse) | |
9037 "Sort the summary buffer by date. | |
9038 Argument REVERSE means reverse order." | |
9039 (interactive "P") | |
9040 (gnus-summary-sort 'date reverse)) | |
9041 | |
9042 (defun gnus-summary-sort-by-score (&optional reverse) | |
9043 "Sort the summary buffer by score. | |
9044 Argument REVERSE means reverse order." | |
9045 (interactive "P") | |
9046 (gnus-summary-sort 'score reverse)) | |
9047 | |
9048 (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
|
9049 "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
|
9050 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
|
9051 (interactive "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9052 (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
|
9053 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9054 (defun gnus-summary-sort-by-chars (&optional reverse) |
17493 | 9055 "Sort the summary buffer by article length. |
9056 Argument REVERSE means reverse order." | |
9057 (interactive "P") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9058 (gnus-summary-sort 'chars reverse)) |
17493 | 9059 |
9060 (defun gnus-summary-sort (predicate reverse) | |
9061 "Sort summary buffer by PREDICATE. REVERSE means reverse order." | |
9062 (let* ((thread (intern (format "gnus-thread-sort-by-%s" predicate))) | |
9063 (article (intern (format "gnus-article-sort-by-%s" predicate))) | |
9064 (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
|
9065 (if (not reverse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9066 thread |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9067 `(lambda (t1 t2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9068 (,thread t2 t1)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9069 (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
|
9070 gnus-thread-sort-functions) |
17493 | 9071 (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
|
9072 (if (not reverse) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9073 article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9074 `(lambda (t1 t2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9075 (,article t2 t1)))) |
17493 | 9076 (buffer-read-only) |
9077 (gnus-summary-prepare-hook nil)) | |
9078 ;; We do the sorting by regenerating the threads. | |
9079 (gnus-summary-prepare) | |
9080 ;; Hide subthreads if needed. | |
9081 (when (and gnus-show-threads gnus-thread-hide-subtree) | |
9082 (gnus-summary-hide-all-threads)))) | |
9083 | |
9084 ;; Summary saving commands. | |
9085 | |
9086 (defun gnus-summary-save-article (&optional n not-saved) | |
9087 "Save the current article using the default saver function. | |
9088 If N is a positive number, save the N next articles. | |
9089 If N is a negative number, save the N previous articles. | |
9090 If N is nil and any articles have been marked with the process mark, | |
9091 save those articles instead. | |
9092 The variable `gnus-default-article-saver' specifies the saver function." | |
9093 (interactive "P") | |
9094 (let* ((articles (gnus-summary-work-articles n)) | |
9095 (save-buffer (save-excursion | |
9096 (nnheader-set-temp-buffer " *Gnus Save*"))) | |
9097 (num (length articles)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9098 header file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9099 (dolist (article articles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9100 (setq header (gnus-summary-article-header article)) |
17493 | 9101 (if (not (vectorp header)) |
9102 ;; This is a pseudo-article. | |
9103 (if (assq 'name header) | |
9104 (gnus-copy-file (cdr (assq 'name header))) | |
9105 (gnus-message 1 "Article %d is unsaveable" article)) | |
9106 ;; This is a real article. | |
9107 (save-window-excursion | |
9108 (gnus-summary-select-article t nil nil article)) | |
9109 (save-excursion | |
9110 (set-buffer save-buffer) | |
9111 (erase-buffer) | |
9112 (insert-buffer-substring gnus-original-article-buffer)) | |
9113 (setq file (gnus-article-save save-buffer file num)) | |
9114 (gnus-summary-remove-process-mark article) | |
9115 (unless not-saved | |
9116 (gnus-summary-set-saved-mark article)))) | |
9117 (gnus-kill-buffer save-buffer) | |
9118 (gnus-summary-position-point) | |
9119 (gnus-set-mode-line 'summary) | |
9120 n)) | |
9121 | |
9122 (defun gnus-summary-pipe-output (&optional arg) | |
9123 "Pipe the current article to a subprocess. | |
9124 If N is a positive number, pipe the N next articles. | |
9125 If N is a negative number, pipe the N previous articles. | |
9126 If N is nil and any articles have been marked with the process mark, | |
9127 pipe those articles instead." | |
9128 (interactive "P") | |
9129 (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe)) | |
9130 (gnus-summary-save-article arg t)) | |
9131 (gnus-configure-windows 'pipe)) | |
9132 | |
9133 (defun gnus-summary-save-article-mail (&optional arg) | |
9134 "Append the current article to an mail file. | |
9135 If N is a positive number, save the N next articles. | |
9136 If N is a negative number, save the N previous articles. | |
9137 If N is nil and any articles have been marked with the process mark, | |
9138 save those articles instead." | |
9139 (interactive "P") | |
9140 (let ((gnus-default-article-saver 'gnus-summary-save-in-mail)) | |
9141 (gnus-summary-save-article arg))) | |
9142 | |
9143 (defun gnus-summary-save-article-rmail (&optional arg) | |
9144 "Append the current article to an rmail file. | |
9145 If N is a positive number, save the N next articles. | |
9146 If N is a negative number, save the N previous articles. | |
9147 If N is nil and any articles have been marked with the process mark, | |
9148 save those articles instead." | |
9149 (interactive "P") | |
9150 (let ((gnus-default-article-saver 'gnus-summary-save-in-rmail)) | |
9151 (gnus-summary-save-article arg))) | |
9152 | |
9153 (defun gnus-summary-save-article-file (&optional arg) | |
9154 "Append the current article to a file. | |
9155 If N is a positive number, save the N next articles. | |
9156 If N is a negative number, save the N previous articles. | |
9157 If N is nil and any articles have been marked with the process mark, | |
9158 save those articles instead." | |
9159 (interactive "P") | |
9160 (let ((gnus-default-article-saver 'gnus-summary-save-in-file)) | |
9161 (gnus-summary-save-article arg))) | |
9162 | |
9163 (defun gnus-summary-write-article-file (&optional arg) | |
9164 "Write the current article to a file, deleting the previous file. | |
9165 If N is a positive number, save the N next articles. | |
9166 If N is a negative number, save the N previous articles. | |
9167 If N is nil and any articles have been marked with the process mark, | |
9168 save those articles instead." | |
9169 (interactive "P") | |
9170 (let ((gnus-default-article-saver 'gnus-summary-write-to-file)) | |
9171 (gnus-summary-save-article arg))) | |
9172 | |
9173 (defun gnus-summary-save-article-body-file (&optional arg) | |
9174 "Append the current article body to a file. | |
9175 If N is a positive number, save the N next articles. | |
9176 If N is a negative number, save the N previous articles. | |
9177 If N is nil and any articles have been marked with the process mark, | |
9178 save those articles instead." | |
9179 (interactive "P") | |
9180 (let ((gnus-default-article-saver 'gnus-summary-save-body-in-file)) | |
9181 (gnus-summary-save-article arg))) | |
9182 | |
9183 (defun gnus-summary-pipe-message (program) | |
9184 "Pipe the current article through PROGRAM." | |
9185 (interactive "sProgram: ") | |
9186 (gnus-summary-select-article) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9187 (let ((mail-header-separator "")) |
17493 | 9188 (gnus-eval-in-buffer-window gnus-article-buffer |
9189 (save-restriction | |
9190 (widen) | |
9191 (let ((start (window-start)) | |
9192 buffer-read-only) | |
9193 (message-pipe-buffer-body program) | |
9194 (set-window-start (get-buffer-window (current-buffer)) start)))))) | |
9195 | |
9196 (defun gnus-get-split-value (methods) | |
9197 "Return a value based on the split METHODS." | |
9198 (let (split-name method result match) | |
9199 (when methods | |
9200 (save-excursion | |
9201 (set-buffer gnus-original-article-buffer) | |
9202 (save-restriction | |
9203 (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
|
9204 (while (and methods (not split-name)) |
17493 | 9205 (goto-char (point-min)) |
9206 (setq method (pop methods)) | |
9207 (setq match (car method)) | |
9208 (when (cond | |
9209 ((stringp match) | |
9210 ;; Regular expression. | |
9211 (ignore-errors | |
9212 (re-search-forward match nil t))) | |
9213 ((gnus-functionp match) | |
9214 ;; Function. | |
9215 (save-restriction | |
9216 (widen) | |
9217 (setq result (funcall match gnus-newsgroup-name)))) | |
9218 ((consp match) | |
9219 ;; Form. | |
9220 (save-restriction | |
9221 (widen) | |
9222 (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
|
9223 (setq split-name (cdr method)) |
17493 | 9224 (cond ((stringp result) |
9225 (push (expand-file-name | |
9226 result gnus-article-save-directory) | |
9227 split-name)) | |
9228 ((consp result) | |
9229 (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
|
9230 (nreverse split-name))) |
17493 | 9231 |
9232 (defun gnus-valid-move-group-p (group) | |
9233 (and (boundp group) | |
9234 (symbol-name group) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9235 (symbol-value group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9236 (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
|
9237 (symbol-name group)) 'request-accept-article t))) |
17493 | 9238 |
9239 (defun gnus-read-move-group-name (prompt default articles prefix) | |
9240 "Read a group name." | |
9241 (let* ((split-name (gnus-get-split-value gnus-move-split-methods)) | |
9242 (minibuffer-confirm-incomplete nil) ; XEmacs | |
9243 (prom | |
9244 (format "%s %s to:" | |
9245 prompt | |
9246 (if (> (length articles) 1) | |
9247 (format "these %d articles" (length articles)) | |
9248 "this article"))) | |
9249 (to-newsgroup | |
9250 (cond | |
9251 ((null split-name) | |
9252 (gnus-completing-read default prom | |
9253 gnus-active-hashtb | |
9254 'gnus-valid-move-group-p | |
9255 nil prefix | |
9256 'gnus-group-history)) | |
9257 ((= 1 (length split-name)) | |
9258 (gnus-completing-read (car split-name) prom | |
9259 gnus-active-hashtb | |
9260 'gnus-valid-move-group-p | |
9261 nil nil | |
9262 'gnus-group-history)) | |
9263 (t | |
9264 (gnus-completing-read nil prom | |
9265 (mapcar (lambda (el) (list el)) | |
9266 (nreverse split-name)) | |
9267 nil nil nil | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9268 'gnus-group-history)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9269 (to-method (gnus-server-to-method (gnus-group-method to-newsgroup)))) |
17493 | 9270 (when to-newsgroup |
9271 (if (or (string= to-newsgroup "") | |
9272 (string= to-newsgroup prefix)) | |
9273 (setq to-newsgroup default)) | |
9274 (unless to-newsgroup | |
9275 (error "No group name entered")) | |
9276 (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
|
9277 (gnus-activate-group to-newsgroup nil nil to-method) |
17493 | 9278 (if (gnus-y-or-n-p (format "No such group: %s. Create it? " |
9279 to-newsgroup)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9280 (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
|
9281 (gnus-activate-group |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9282 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
|
9283 (gnus-subscribe-group to-newsgroup)) |
17493 | 9284 (error "Couldn't create group %s" to-newsgroup))) |
9285 (error "No such group: %s" to-newsgroup))) | |
9286 to-newsgroup)) | |
9287 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9288 (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
|
9289 "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
|
9290 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
|
9291 (interactive |
31785 | 9292 (list (read-string "Save parts of type: " |
9293 (or (car gnus-summary-save-parts-type-history) | |
9294 gnus-summary-save-parts-default-mime) | |
9295 'gnus-summary-save-parts-type-history) | |
9296 (setq gnus-summary-save-parts-last-directory | |
9297 (read-file-name "Save to directory: " | |
9298 gnus-summary-save-parts-last-directory | |
9299 nil t)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9300 current-prefix-arg)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9301 (gnus-summary-iterate n |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9302 (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
|
9303 (gnus-inhibit-treatment t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9304 (gnus-summary-select-article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9305 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9306 (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
|
9307 (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
|
9308 (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
|
9309 (when handles |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9310 (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
|
9311 (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
|
9312 (mm-destroy-parts handles))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9313 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9314 (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
|
9315 (if (stringp (car handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9316 (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
|
9317 (cdr handle)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9318 (when (if reverse |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9319 (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
|
9320 (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
|
9321 (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
|
9322 (file-name-nondirectory |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9323 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9324 (mail-content-type-get |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9325 (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
|
9326 (concat gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9327 "." (number-to-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9328 (cdr gnus-article-current))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9329 dir))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9330 (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
|
9331 (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
|
9332 |
17493 | 9333 ;; Summary extract commands |
9334 | |
9335 (defun gnus-summary-insert-pseudos (pslist &optional not-view) | |
9336 (let ((buffer-read-only nil) | |
9337 (article (gnus-summary-article-number)) | |
9338 after-article b e) | |
9339 (unless (gnus-summary-goto-subject article) | |
9340 (error "No such article: %d" article)) | |
9341 (gnus-summary-position-point) | |
9342 ;; If all commands are to be bunched up on one line, we collect | |
9343 ;; them here. | |
9344 (unless gnus-view-pseudos-separately | |
9345 (let ((ps (setq pslist (sort pslist 'gnus-pseudos<))) | |
9346 files action) | |
9347 (while ps | |
9348 (setq action (cdr (assq 'action (car ps)))) | |
9349 (setq files (list (cdr (assq 'name (car ps))))) | |
9350 (while (and ps (cdr ps) | |
9351 (string= (or action "1") | |
9352 (or (cdr (assq 'action (cadr ps))) "2"))) | |
9353 (push (cdr (assq 'name (cadr ps))) files) | |
9354 (setcdr ps (cddr ps))) | |
9355 (when files | |
9356 (when (not (string-match "%s" action)) | |
9357 (push " " files)) | |
9358 (push " " files) | |
9359 (when (assq 'execute (car ps)) | |
9360 (setcdr (assq 'execute (car ps)) | |
9361 (funcall (if (string-match "%s" action) | |
9362 'format 'concat) | |
9363 action | |
9364 (mapconcat | |
9365 (lambda (f) | |
9366 (if (equal f " ") | |
9367 f | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9368 (mm-quote-arg f))) |
17493 | 9369 files " "))))) |
9370 (setq ps (cdr ps))))) | |
9371 (if (and gnus-view-pseudos (not not-view)) | |
9372 (while pslist | |
9373 (when (assq 'execute (car pslist)) | |
9374 (gnus-execute-command (cdr (assq 'execute (car pslist))) | |
9375 (eq gnus-view-pseudos 'not-confirm))) | |
9376 (setq pslist (cdr pslist))) | |
9377 (save-excursion | |
9378 (while pslist | |
9379 (setq after-article (or (cdr (assq 'article (car pslist))) | |
9380 (gnus-summary-article-number))) | |
9381 (gnus-summary-goto-subject after-article) | |
9382 (forward-line 1) | |
9383 (setq b (point)) | |
9384 (insert " " (file-name-nondirectory | |
9385 (cdr (assq 'name (car pslist)))) | |
9386 ": " (or (cdr (assq 'execute (car pslist))) "") "\n") | |
9387 (setq e (point)) | |
9388 (forward-line -1) ; back to `b' | |
9389 (gnus-add-text-properties | |
9390 b (1- e) (list 'gnus-number gnus-reffed-article-number | |
9391 gnus-mouse-face-prop gnus-mouse-face)) | |
9392 (gnus-data-enter | |
9393 after-article gnus-reffed-article-number | |
9394 gnus-unread-mark b (car pslist) 0 (- e b)) | |
9395 (push gnus-reffed-article-number gnus-newsgroup-unreads) | |
9396 (setq gnus-reffed-article-number (1- gnus-reffed-article-number)) | |
9397 (setq pslist (cdr pslist))))))) | |
9398 | |
9399 (defun gnus-pseudos< (p1 p2) | |
9400 (let ((c1 (cdr (assq 'action p1))) | |
9401 (c2 (cdr (assq 'action p2)))) | |
9402 (and c1 c2 (string< c1 c2)))) | |
9403 | |
9404 (defun gnus-request-pseudo-article (props) | |
9405 (cond ((assq 'execute props) | |
9406 (gnus-execute-command (cdr (assq 'execute props))))) | |
9407 (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
|
9408 (gnus-run-hooks 'gnus-mark-article-hook))) |
17493 | 9409 |
9410 (defun gnus-execute-command (command &optional automatic) | |
9411 (save-excursion | |
9412 (gnus-article-setup-buffer) | |
9413 (set-buffer gnus-article-buffer) | |
9414 (setq buffer-read-only nil) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
9415 (let ((command (if automatic command |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
9416 (read-string "Command: " (cons command 0))))) |
17493 | 9417 (erase-buffer) |
9418 (insert "$ " command "\n\n") | |
9419 (if gnus-view-pseudo-asynchronously | |
9420 (start-process "gnus-execute" (current-buffer) shell-file-name | |
9421 shell-command-switch command) | |
9422 (call-process shell-file-name nil t nil | |
9423 shell-command-switch command))))) | |
9424 | |
9425 ;; Summary kill commands. | |
9426 | |
9427 (defun gnus-summary-edit-global-kill (article) | |
9428 "Edit the \"global\" kill file." | |
9429 (interactive (list (gnus-summary-article-number))) | |
9430 (gnus-group-edit-global-kill article)) | |
9431 | |
9432 (defun gnus-summary-edit-local-kill () | |
9433 "Edit a local kill file applied to the current newsgroup." | |
9434 (interactive) | |
9435 (setq gnus-current-headers (gnus-summary-article-header)) | |
9436 (gnus-group-edit-local-kill | |
9437 (gnus-summary-article-number) gnus-newsgroup-name)) | |
9438 | |
9439 ;;; Header reading. | |
9440 | |
9441 (defun gnus-read-header (id &optional header) | |
9442 "Read the headers of article ID and enter them into the Gnus system." | |
9443 (let ((group gnus-newsgroup-name) | |
9444 (gnus-override-method | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9445 (or |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9446 gnus-override-method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9447 (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
|
9448 (car (gnus-refer-article-methods))))) |
17493 | 9449 where) |
9450 ;; First we check to see whether the header in question is already | |
9451 ;; fetched. | |
9452 (if (stringp id) | |
9453 ;; This is a Message-ID. | |
9454 (setq header (or header (gnus-id-to-header id))) | |
9455 ;; This is an article number. | |
9456 (setq header (or header (gnus-summary-article-header id)))) | |
9457 (if (and header | |
9458 (not (gnus-summary-article-sparse-p (mail-header-number header)))) | |
9459 ;; We have found the header. | |
9460 header | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9461 ;; 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
|
9462 ;; previous entry in the thread hashtb. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9463 (when (and header |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9464 (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
|
9465 (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
|
9466 (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
|
9467 (when thread |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9468 (delq (assq header thread) thread)))) |
17493 | 9469 ;; We have to really fetch the header to this article. |
9470 (save-excursion | |
9471 (set-buffer nntp-server-buffer) | |
9472 (when (setq where (gnus-request-head id group)) | |
9473 (nnheader-fold-continuation-lines) | |
9474 (goto-char (point-max)) | |
9475 (insert ".\n") | |
9476 (goto-char (point-min)) | |
9477 (insert "211 ") | |
9478 (princ (cond | |
9479 ((numberp id) id) | |
9480 ((cdr where) (cdr where)) | |
9481 (header (mail-header-number header)) | |
9482 (t gnus-reffed-article-number)) | |
9483 (current-buffer)) | |
9484 (insert " Article retrieved.\n")) | |
9485 (if (or (not where) | |
9486 (not (setq header (car (gnus-get-newsgroup-headers nil t))))) | |
9487 () ; Malformed head. | |
9488 (unless (gnus-summary-article-sparse-p (mail-header-number header)) | |
9489 (when (and (stringp id) | |
9490 (not (string= (gnus-group-real-name group) | |
9491 (car where)))) | |
9492 ;; If we fetched by Message-ID and the article came | |
9493 ;; from a different group, we fudge some bogus article | |
9494 ;; numbers for this article. | |
9495 (mail-header-set-number header gnus-reffed-article-number)) | |
9496 (save-excursion | |
9497 (set-buffer gnus-summary-buffer) | |
9498 (decf gnus-reffed-article-number) | |
9499 (gnus-remove-header (mail-header-number header)) | |
9500 (push header gnus-newsgroup-headers) | |
9501 (setq gnus-current-headers header) | |
9502 (push (mail-header-number header) gnus-newsgroup-limit))) | |
9503 header))))) | |
9504 | |
9505 (defun gnus-remove-header (number) | |
9506 "Remove header NUMBER from `gnus-newsgroup-headers'." | |
9507 (if (and gnus-newsgroup-headers | |
9508 (= number (mail-header-number (car gnus-newsgroup-headers)))) | |
9509 (pop gnus-newsgroup-headers) | |
9510 (let ((headers gnus-newsgroup-headers)) | |
9511 (while (and (cdr headers) | |
9512 (not (= number (mail-header-number (cadr headers))))) | |
9513 (pop headers)) | |
9514 (when (cdr headers) | |
9515 (setcdr headers (cddr headers)))))) | |
9516 | |
9517 ;;; | |
9518 ;;; summary highlights | |
9519 ;;; | |
9520 | |
9521 (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
|
9522 "Highlight selected article in summary buffer." |
17493 | 9523 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>. |
9524 (when gnus-summary-selected-face | |
9525 (save-excursion | |
9526 (let* ((beg (progn (beginning-of-line) (point))) | |
9527 (end (progn (end-of-line) (point))) | |
9528 ;; Fix by Mike Dugan <dugan@bucrf16.bu.edu>. | |
9529 (from (if (get-text-property beg gnus-mouse-face-prop) | |
9530 beg | |
9531 (or (next-single-property-change | |
9532 beg gnus-mouse-face-prop nil end) | |
9533 beg))) | |
9534 (to | |
9535 (if (= from end) | |
9536 (- from 2) | |
9537 (or (next-single-property-change | |
9538 from gnus-mouse-face-prop nil end) | |
9539 end)))) | |
9540 ;; If no mouse-face prop on line we will have to = from = end, | |
9541 ;; so we highlight the entire line instead. | |
9542 (when (= (+ to 2) from) | |
9543 (setq from beg) | |
9544 (setq to end)) | |
9545 (if gnus-newsgroup-selected-overlay | |
9546 ;; Move old overlay. | |
9547 (gnus-move-overlay | |
9548 gnus-newsgroup-selected-overlay from to (current-buffer)) | |
9549 ;; Create new overlay. | |
9550 (gnus-overlay-put | |
9551 (setq gnus-newsgroup-selected-overlay (gnus-make-overlay from to)) | |
9552 'face gnus-summary-selected-face)))))) | |
9553 | |
9554 ;; New implementation by Christian Limpach <Christian.Limpach@nice.ch>. | |
9555 (defun gnus-summary-highlight-line () | |
9556 "Highlight current line according to `gnus-summary-highlight'." | |
9557 (let* ((list gnus-summary-highlight) | |
9558 (p (point)) | |
9559 (end (progn (end-of-line) (point))) | |
9560 ;; now find out where the line starts and leave point there. | |
9561 (beg (progn (beginning-of-line) (point))) | |
9562 (article (gnus-summary-article-number)) | |
9563 (score (or (cdr (assq (or article gnus-current-article) | |
9564 gnus-newsgroup-scored)) | |
9565 gnus-summary-default-score 0)) | |
9566 (mark (or (gnus-summary-article-mark) gnus-unread-mark)) | |
9567 (inhibit-read-only t)) | |
9568 ;; Eval the cars of the lists until we find a match. | |
9569 (let ((default gnus-summary-default-score)) | |
9570 (while (and list | |
9571 (not (eval (caar list)))) | |
9572 (setq list (cdr list)))) | |
9573 (let ((face (cdar list))) | |
9574 (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
|
9575 (gnus-put-text-property-excluding-characters-with-faces |
17493 | 9576 beg end 'face |
9577 (setq face (if (boundp face) (symbol-value face) face))) | |
9578 (when gnus-summary-highlight-line-function | |
9579 (funcall gnus-summary-highlight-line-function article face)))) | |
9580 (goto-char p))) | |
9581 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9582 (defun gnus-update-read-articles (group unread &optional compute) |
17493 | 9583 "Update the list of read articles in GROUP." |
9584 (let* ((active (or gnus-newsgroup-active (gnus-active group))) | |
9585 (entry (gnus-gethash group gnus-newsrc-hashtb)) | |
9586 (info (nth 2 entry)) | |
9587 (prev 1) | |
9588 (unread (sort (copy-sequence unread) '<)) | |
9589 read) | |
9590 (if (or (not info) (not active)) | |
9591 ;; There is no info on this group if it was, in fact, | |
9592 ;; killed. Gnus stores no information on killed groups, so | |
9593 ;; there's nothing to be done. | |
9594 ;; One could store the information somewhere temporarily, | |
9595 ;; perhaps... Hmmm... | |
9596 () | |
9597 ;; Remove any negative articles numbers. | |
9598 (while (and unread (< (car unread) 0)) | |
9599 (setq unread (cdr unread))) | |
9600 ;; Remove any expired article numbers | |
9601 (while (and unread (< (car unread) (car active))) | |
9602 (setq unread (cdr unread))) | |
9603 ;; Compute the ranges of read articles by looking at the list of | |
9604 ;; unread articles. | |
9605 (while unread | |
9606 (when (/= (car unread) prev) | |
9607 (push (if (= prev (1- (car unread))) prev | |
9608 (cons prev (1- (car unread)))) | |
9609 read)) | |
9610 (setq prev (1+ (car unread))) | |
9611 (setq unread (cdr unread))) | |
9612 (when (<= prev (cdr active)) | |
9613 (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
|
9614 (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
|
9615 (if compute |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9616 read |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9617 (save-excursion |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9618 (let (setmarkundo) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9619 ;; 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
|
9620 (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
|
9621 (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
|
9622 (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
|
9623 (when (or add del) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9624 (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
|
9625 (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
|
9626 (gnus-request-set-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9627 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
|
9628 (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
|
9629 (setq setmarkundo |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9630 `(gnus-request-set-mark |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9631 ,group |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9632 ',(delq nil (list |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9633 (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
|
9634 (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
|
9635 (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
|
9636 (gnus-undo-register |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9637 `(progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9638 (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
|
9639 (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
|
9640 (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
|
9641 (gnus-active ,group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9642 (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
|
9643 ,setmarkundo)))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9644 ;; 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
|
9645 (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
|
9646 ;; 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
|
9647 (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
|
9648 t)))) |
17493 | 9649 |
9650 (defun gnus-offer-save-summaries () | |
9651 "Offer to save all active summary buffers." | |
9652 (save-excursion | |
9653 (let ((buflist (buffer-list)) | |
9654 buffers bufname) | |
9655 ;; Go through all buffers and find all summaries. | |
9656 (while buflist | |
9657 (and (setq bufname (buffer-name (car buflist))) | |
9658 (string-match "Summary" bufname) | |
9659 (save-excursion | |
9660 (set-buffer bufname) | |
9661 ;; We check that this is, indeed, a summary buffer. | |
9662 (and (eq major-mode 'gnus-summary-mode) | |
9663 ;; Also make sure this isn't bogus. | |
9664 gnus-newsgroup-prepared | |
9665 ;; Also make sure that this isn't a dead summary buffer. | |
9666 (not gnus-dead-summary-mode))) | |
9667 (push bufname buffers)) | |
9668 (setq buflist (cdr buflist))) | |
9669 ;; Go through all these summary buffers and offer to save them. | |
9670 (when buffers | |
9671 (map-y-or-n-p | |
9672 "Update summary buffer %s? " | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9673 (lambda (buf) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9674 (switch-to-buffer buf) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
23363
diff
changeset
|
9675 (gnus-summary-exit)) |
17493 | 9676 buffers))))) |
9677 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9678 (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
|
9679 "Setup newsgroup default charset." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9680 (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
|
9681 (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
|
9682 (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
|
9683 (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
|
9684 (ignored-charsets |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9685 (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
|
9686 (append |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9687 (and gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9688 (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
|
9689 'ignored-charsets t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9690 (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
|
9691 elem (charsets nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9692 (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
|
9693 (when (and name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9694 (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
|
9695 (setq alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9696 charsets (cdr elem)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9697 charsets))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9698 gnus-newsgroup-ignored-charsets)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9699 (setq gnus-newsgroup-charset |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9700 (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
|
9701 (and gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9702 (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
|
9703 (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
|
9704 elem charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9705 (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
|
9706 (when (and name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9707 (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
|
9708 (setq alist nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9709 charset (cadr elem)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9710 charset))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9711 gnus-default-charset)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9712 (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
|
9713 ignored-charsets)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9714 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9715 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9716 ;;; Mime Commands |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9717 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9718 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9719 (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
|
9720 "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
|
9721 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
|
9722 treated as multipart/mixed." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9723 (interactive "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9724 (require 'gnus-art) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9725 (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
|
9726 (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
|
9727 (gnus-summary-show-article))) |
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 (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
|
9730 "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
|
9731 (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
|
9732 (gnus-with-article article |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9733 (message-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9734 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9735 (widen) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9736 (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
|
9737 (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
|
9738 (message-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9739 (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
|
9740 (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
|
9741 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9742 (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
|
9743 separator)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9744 (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
|
9745 (widen)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9746 (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
|
9747 (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
|
9748 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9749 (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
|
9750 "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
|
9751 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9752 (require 'gnus-art) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9753 (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
|
9754 (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
|
9755 (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
|
9756 (gnus-summary-show-article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9757 (gnus-summary-show-article))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9758 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9759 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9760 ;;; Generic summary marking commands |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9761 ;;; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9762 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9763 (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
|
9764 '((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
|
9765 (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
|
9766 (ticked gnus-ticked-mark "!") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9767 (dormant gnus-dormant-mark "?") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9768 (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
|
9769 "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
|
9770 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9771 (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
|
9772 (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
|
9773 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9774 (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
|
9775 (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
|
9776 (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
|
9777 (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
|
9778 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9779 (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
|
9780 (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
|
9781 (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
|
9782 (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
|
9783 (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
|
9784 (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
|
9785 (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
|
9786 (nomove "" nil nil ,keystroke))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9787 (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
|
9788 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
|
9789 (setq func (eval func)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9790 (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
|
9791 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9792 (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
|
9793 `(defun ,(intern |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9794 (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
|
9795 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
|
9796 "" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9797 (concat "-" (symbol-name way))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9798 (n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9799 ,(format |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9800 "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
|
9801 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
|
9802 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
|
9803 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
|
9804 returned." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9805 name (cadr lway)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9806 (interactive "p") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9807 (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
|
9808 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9809 (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
|
9810 "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
|
9811 (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
|
9812 (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
|
9813 (gnus-summary-show-thread) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9814 (let ((nummove |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9815 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9816 ((eq move 'next) 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9817 ((eq move 'prev) -1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9818 (t 0)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9819 (if (zerop nummove) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9820 (setq n 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9821 (when (< n 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9822 (setq n (abs n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9823 nummove (* -1 nummove)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9824 (while (and (> n 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9825 (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
|
9826 (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
|
9827 (setq n (1- n))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9828 (when (/= 0 n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9829 (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
|
9830 (gnus-summary-recenter) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9831 (gnus-summary-position-point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9832 (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
|
9833 n)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9834 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24552
diff
changeset
|
9835 (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
|
9836 |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
9837 (gnus-ems-redefine) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19912
diff
changeset
|
9838 |
17493 | 9839 (provide 'gnus-sum) |
9840 | |
9841 (run-hooks 'gnus-sum-load-hook) | |
9842 | |
9843 ;;; gnus-sum.el ends here |