(gnus-summary-toggle-header): Run
[gnus] / lisp / gnus-sum.el
1 ;;; gnus-sum.el --- summary mode commands for Gnus
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
3 ;;        Free Software Foundation, Inc.
4
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
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
29 (eval-when-compile (require 'cl))
30
31 (require 'gnus)
32 (require 'gnus-group)
33 (require 'gnus-spec)
34 (require 'gnus-range)
35 (require 'gnus-int)
36 (require 'gnus-undo)
37 (require 'gnus-util)
38 (require 'mm-decode)
39 (require 'nnoo)
40
41 (autoload 'gnus-summary-limit-include-cached "gnus-cache" nil t)
42 (autoload 'gnus-cache-write-active "gnus-cache")
43 (autoload 'gnus-mailing-list-insinuate "gnus-ml" nil t)
44 (autoload 'turn-on-gnus-mailing-list-mode "gnus-ml" nil t)
45 (autoload 'mm-uu-dissect "mm-uu")
46 (autoload 'gnus-article-outlook-deuglify-article "deuglify"
47   "Deuglify broken Outlook (Express) articles and redisplay."
48   t)
49 (autoload 'gnus-article-outlook-unwrap-lines "deuglify" nil t)
50 (autoload 'gnus-article-outlook-repair-attribution "deuglify" nil t)
51 (autoload 'gnus-article-outlook-rearrange-citation "deuglify" nil t)
52
53 (defcustom gnus-kill-summary-on-exit t
54   "*If non-nil, kill the summary buffer when you exit from it.
55 If nil, the summary will become a \"*Dead Summary*\" buffer, and
56 it will be killed sometime later."
57   :group 'gnus-summary-exit
58   :type 'boolean)
59
60 (defcustom gnus-fetch-old-headers nil
61   "*Non-nil means that Gnus will try to build threads by grabbing old headers.
62 If an unread article in the group refers to an older, already read (or
63 just marked as read) article, the old article will not normally be
64 displayed in the Summary buffer.  If this variable is non-nil, Gnus
65 will attempt to grab the headers to the old articles, and thereby
66 build complete threads.  If it has the value `some', only enough
67 headers to connect otherwise loose threads will be displayed.  This
68 variable can also be a number.  In that case, no more than that number
69 of old headers will be fetched.  If it has the value `invisible', all
70 old headers will be fetched, but none will be displayed.
71
72 The server has to support NOV for any of this to work."
73   :group 'gnus-thread
74   :type '(choice (const :tag "off" nil)
75                  (const some)
76                  number
77                  (sexp :menu-tag "other" t)))
78
79 (defcustom gnus-refer-thread-limit 200
80   "*The number of old headers to fetch when doing \\<gnus-summary-mode-map>\\[gnus-summary-refer-thread].
81 If t, fetch all the available old headers."
82   :group 'gnus-thread
83   :type '(choice number
84                  (sexp :menu-tag "other" t)))
85
86 (defcustom gnus-summary-make-false-root 'adopt
87   "*nil means that Gnus won't gather loose threads.
88 If the root of a thread has expired or been read in a previous
89 session, the information necessary to build a complete thread has been
90 lost.  Instead of having many small sub-threads from this original thread
91 scattered all over the summary buffer, Gnus can gather them.
92
93 If non-nil, Gnus will try to gather all loose sub-threads from an
94 original thread into one large thread.
95
96 If this variable is non-nil, it should be one of `none', `adopt',
97 `dummy' or `empty'.
98
99 If this variable is `none', Gnus will not make a false root, but just
100 present the sub-threads after another.
101 If this variable is `dummy', Gnus will create a dummy root that will
102 have all the sub-threads as children.
103 If this variable is `adopt', Gnus will make one of the \"children\"
104 the parent and mark all the step-children as such.
105 If this variable is `empty', the \"children\" are printed with empty
106 subject fields.  (Or rather, they will be printed with a string
107 given by the `gnus-summary-same-subject' variable.)"
108   :group 'gnus-thread
109   :type '(choice (const :tag "off" nil)
110                  (const none)
111                  (const dummy)
112                  (const adopt)
113                  (const empty)))
114
115 (defcustom gnus-summary-make-false-root-always nil
116   "Always make a false dummy root."
117   :group 'gnus-thread
118   :type 'boolean)
119
120 (defcustom gnus-summary-gather-exclude-subject "^ *$\\|^(none)$"
121   "*A regexp to match subjects to be excluded from loose thread gathering.
122 As loose thread gathering is done on subjects only, that means that
123 there can be many false gatherings performed.  By rooting out certain
124 common subjects, gathering might become saner."
125   :group 'gnus-thread
126   :type 'regexp)
127
128 (defcustom gnus-summary-gather-subject-limit nil
129   "*Maximum length of subject comparisons when gathering loose threads.
130 Use nil to compare full subjects.  Setting this variable to a low
131 number will help gather threads that have been corrupted by
132 newsreaders chopping off subject lines, but it might also mean that
133 unrelated articles that have subject that happen to begin with the
134 same few characters will be incorrectly gathered.
135
136 If this variable is `fuzzy', Gnus will use a fuzzy algorithm when
137 comparing subjects."
138   :group 'gnus-thread
139   :type '(choice (const :tag "off" nil)
140                  (const fuzzy)
141                  (sexp :menu-tag "on" t)))
142
143 (defcustom gnus-simplify-subject-functions nil
144   "List of functions taking a string argument that simplify subjects.
145 The functions are applied recursively.
146
147 Useful functions to put in this list include:
148 `gnus-simplify-subject-re', `gnus-simplify-subject-fuzzy',
149 `gnus-simplify-whitespace', and `gnus-simplify-all-whitespace'."
150   :group 'gnus-thread
151   :type '(repeat function))
152
153 (defcustom gnus-simplify-ignored-prefixes nil
154   "*Remove matches for this regexp from subject lines when simplifying fuzzily."
155   :group 'gnus-thread
156   :type '(choice (const :tag "off" nil)
157                  regexp))
158
159 (defcustom gnus-build-sparse-threads nil
160   "*If non-nil, fill in the gaps in threads.
161 If `some', only fill in the gaps that are needed to tie loose threads
162 together.  If `more', fill in all leaf nodes that Gnus can find.  If
163 non-nil and non-`some', fill in all gaps that Gnus manages to guess."
164   :group 'gnus-thread
165   :type '(choice (const :tag "off" nil)
166                  (const some)
167                  (const more)
168                  (sexp :menu-tag "all" t)))
169
170 (defcustom gnus-summary-thread-gathering-function
171   'gnus-gather-threads-by-subject
172   "*Function used for gathering loose threads.
173 There are two pre-defined functions: `gnus-gather-threads-by-subject',
174 which only takes Subjects into consideration; and
175 `gnus-gather-threads-by-references', which compared the References
176 headers of the articles to find matches."
177   :group 'gnus-thread
178   :type '(radio (function-item gnus-gather-threads-by-subject)
179                 (function-item gnus-gather-threads-by-references)
180                 (function :tag "other")))
181
182 (defcustom gnus-summary-same-subject ""
183   "*String indicating that the current article has the same subject as the previous.
184 This variable will only be used if the value of
185 `gnus-summary-make-false-root' is `empty'."
186   :group 'gnus-summary-format
187   :type 'string)
188
189 (defcustom gnus-summary-goto-unread t
190   "*If t, many commands will go to the next unread article.
191 This applies to marking commands as well as other commands that
192 \"naturally\" select the next article, like, for instance, `SPC' at
193 the end of an article.
194
195 If nil, the marking commands do NOT go to the next unread article
196 \(they go to the next article instead).  If `never', commands that
197 usually go to the next unread article, will go to the next article,
198 whether it is read or not."
199   :group 'gnus-summary-marks
200   :link '(custom-manual "(gnus)Setting Marks")
201   :type '(choice (const :tag "off" nil)
202                  (const never)
203                  (sexp :menu-tag "on" t)))
204
205 (defcustom gnus-summary-default-score 0
206   "*Default article score level.
207 All scores generated by the score files will be added to this score.
208 If this variable is nil, scoring will be disabled."
209   :group 'gnus-score-default
210   :type '(choice (const :tag "disable")
211                  integer))
212
213 (defcustom gnus-summary-default-high-score 0
214   "*Default threshold for a high scored article.
215 An article will be highlighted as high scored if its score is greater
216 than this score."
217   :group 'gnus-score-default
218   :type 'integer)
219
220 (defcustom gnus-summary-default-low-score 0
221   "*Default threshold for a low scored article.
222 An article will be highlighted as low scored if its score is smaller
223 than this score."
224   :group 'gnus-score-default
225   :type 'integer)
226
227 (defcustom gnus-summary-zcore-fuzz 0
228   "*Fuzziness factor for the zcore in the summary buffer.
229 Articles with scores closer than this to `gnus-summary-default-score'
230 will not be marked."
231   :group 'gnus-summary-format
232   :type 'integer)
233
234 (defcustom gnus-simplify-subject-fuzzy-regexp nil
235   "*Strings to be removed when doing fuzzy matches.
236 This can either be a regular expression or list of regular expressions
237 that will be removed from subject strings if fuzzy subject
238 simplification is selected."
239   :group 'gnus-thread
240   :type '(repeat regexp))
241
242 (defcustom gnus-show-threads t
243   "*If non-nil, display threads in summary mode."
244   :group 'gnus-thread
245   :type 'boolean)
246
247 (defcustom gnus-thread-hide-subtree nil
248   "*If non-nil, hide all threads initially.
249 This can be a predicate specifier which says which threads to hide.
250 If threads are hidden, you have to run the command
251 `gnus-summary-show-thread' by hand or use `gnus-select-article-hook'
252 to expose hidden threads."
253   :group 'gnus-thread
254   :type 'boolean)
255
256 (defcustom gnus-thread-hide-killed t
257   "*If non-nil, hide killed threads automatically."
258   :group 'gnus-thread
259   :type 'boolean)
260
261 (defcustom gnus-thread-ignore-subject t
262   "*If non-nil, which is the default, ignore subjects and do all threading based on the Reference header.
263 If nil, articles that have different subjects from their parents will
264 start separate threads."
265   :group 'gnus-thread
266   :type 'boolean)
267
268 (defcustom gnus-thread-operation-ignore-subject t
269   "*If non-nil, subjects will be ignored when doing thread commands.
270 This affects commands like `gnus-summary-kill-thread' and
271 `gnus-summary-lower-thread'.
272
273 If this variable is nil, articles in the same thread with different
274 subjects will not be included in the operation in question.  If this
275 variable is `fuzzy', only articles that have subjects that are fuzzily
276 equal will be included."
277   :group 'gnus-thread
278   :type '(choice (const :tag "off" nil)
279                  (const fuzzy)
280                  (sexp :tag "on" t)))
281
282 (defcustom gnus-thread-indent-level 4
283   "*Number that says how much each sub-thread should be indented."
284   :group 'gnus-thread
285   :type 'integer)
286
287 (defcustom gnus-auto-extend-newsgroup t
288   "*If non-nil, extend newsgroup forward and backward when requested."
289   :group 'gnus-summary-choose
290   :type 'boolean)
291
292 (defcustom gnus-auto-select-first t
293   "*If non-nil, select the article under point.
294 Which article this is is controlled by the `gnus-auto-select-subject'
295 variable.
296
297 If you want to prevent automatic selection of articles in some
298 newsgroups, set the variable to nil in `gnus-select-group-hook'."
299   :group 'gnus-group-select
300   :type '(choice (const :tag "none" nil)
301                  (sexp :menu-tag "first" t)))
302
303 (defcustom gnus-auto-select-subject 'unread
304   "*Says what subject to place under point when entering a group.
305
306 This variable can either be the symbols `first' (place point on the
307 first subject), `unread' (place point on the subject line of the first
308 unread article), `best' (place point on the subject line of the
309 higest-scored article), `unseen' (place point on the subject line of
310 the first unseen article), 'unseen-or-unread' (place point on the subject
311 line of the first unseen article or, if all article have been seen, on the
312 subject line of the first unread article), or a function to be called to
313 place point on some subject line."
314   :group 'gnus-group-select
315   :type '(choice (const best)
316                  (const unread)
317                  (const first)
318                  (const unseen)
319                  (const unseen-or-unread)))
320
321 (defcustom gnus-auto-select-next t
322   "*If non-nil, offer to go to the next group from the end of the previous.
323 If the value is t and the next newsgroup is empty, Gnus will exit
324 summary mode and go back to group mode.  If the value is neither nil
325 nor t, Gnus will select the following unread newsgroup.  In
326 particular, if the value is the symbol `quietly', the next unread
327 newsgroup will be selected without any confirmation, and if it is
328 `almost-quietly', the next group will be selected without any
329 confirmation if you are located on the last article in the group.
330 Finally, if this variable is `slightly-quietly', the `\\<gnus-summary-mode-map>\\[gnus-summary-catchup-and-goto-next-group]' command
331 will go to the next group without confirmation."
332   :group 'gnus-summary-maneuvering
333   :type '(choice (const :tag "off" nil)
334                  (const quietly)
335                  (const almost-quietly)
336                  (const slightly-quietly)
337                  (sexp :menu-tag "on" t)))
338
339 (defcustom gnus-auto-select-same nil
340   "*If non-nil, select the next article with the same subject.
341 If there are no more articles with the same subject, go to
342 the first unread article."
343   :group 'gnus-summary-maneuvering
344   :type 'boolean)
345
346 (defcustom gnus-summary-check-current nil
347   "*If non-nil, consider the current article when moving.
348 The \"unread\" movement commands will stay on the same line if the
349 current article is unread."
350   :group 'gnus-summary-maneuvering
351   :type 'boolean)
352
353 (defcustom gnus-auto-center-summary t
354   "*If non-nil, always center the current summary buffer.
355 In particular, if `vertical' do only vertical recentering.  If non-nil
356 and non-`vertical', do both horizontal and vertical recentering."
357   :group 'gnus-summary-maneuvering
358   :type '(choice (const :tag "none" nil)
359                  (const vertical)
360                  (integer :tag "height")
361                  (sexp :menu-tag "both" t)))
362
363 (defvar gnus-auto-center-group t
364   "*If non-nil, always center the group buffer.")
365
366 (defcustom gnus-show-all-headers nil
367   "*If non-nil, don't hide any headers."
368   :group 'gnus-article-hiding
369   :group 'gnus-article-headers
370   :type 'boolean)
371
372 (defcustom gnus-summary-ignore-duplicates nil
373   "*If non-nil, ignore articles with identical Message-ID headers."
374   :group 'gnus-summary
375   :type 'boolean)
376
377 (defcustom gnus-single-article-buffer t
378   "*If non-nil, display all articles in the same buffer.
379 If nil, each group will get its own article buffer."
380   :group 'gnus-article-various
381   :type 'boolean)
382
383 (defcustom gnus-break-pages t
384   "*If non-nil, do page breaking on articles.
385 The page delimiter is specified by the `gnus-page-delimiter'
386 variable."
387   :group 'gnus-article-various
388   :type 'boolean)
389
390 (defcustom gnus-move-split-methods nil
391   "*Variable used to suggest where articles are to be moved to.
392 It uses the same syntax as the `gnus-split-methods' variable.
393 However, whereas `gnus-split-methods' specifies file names as targets,
394 this variable specifies group names."
395   :group 'gnus-summary-mail
396   :type '(repeat (choice (list :value (fun) function)
397                          (cons :value ("" "") regexp (repeat string))
398                          (sexp :value nil))))
399
400 (defcustom gnus-unread-mark ?           ;Whitespace
401   "*Mark used for unread articles."
402   :group 'gnus-summary-marks
403   :type 'character)
404
405 (defcustom gnus-ticked-mark ?!
406   "*Mark used for ticked articles."
407   :group 'gnus-summary-marks
408   :type 'character)
409
410 (defcustom gnus-dormant-mark ??
411   "*Mark used for dormant articles."
412   :group 'gnus-summary-marks
413   :type 'character)
414
415 (defcustom gnus-del-mark ?r
416   "*Mark used for del'd articles."
417   :group 'gnus-summary-marks
418   :type 'character)
419
420 (defcustom gnus-read-mark ?R
421   "*Mark used for read articles."
422   :group 'gnus-summary-marks
423   :type 'character)
424
425 (defcustom gnus-expirable-mark ?E
426   "*Mark used for expirable articles."
427   :group 'gnus-summary-marks
428   :type 'character)
429
430 (defcustom gnus-killed-mark ?K
431   "*Mark used for killed articles."
432   :group 'gnus-summary-marks
433   :type 'character)
434
435 (defcustom gnus-spam-mark ?$
436   "*Mark used for spam articles."
437   :group 'gnus-summary-marks
438   :type 'character)
439
440 (defcustom gnus-souped-mark ?F
441   "*Mark used for souped articles."
442   :group 'gnus-summary-marks
443   :type 'character)
444
445 (defcustom gnus-kill-file-mark ?X
446   "*Mark used for articles killed by kill files."
447   :group 'gnus-summary-marks
448   :type 'character)
449
450 (defcustom gnus-low-score-mark ?Y
451   "*Mark used for articles with a low score."
452   :group 'gnus-summary-marks
453   :type 'character)
454
455 (defcustom gnus-catchup-mark ?C
456   "*Mark used for articles that are caught up."
457   :group 'gnus-summary-marks
458   :type 'character)
459
460 (defcustom gnus-replied-mark ?A
461   "*Mark used for articles that have been replied to."
462   :group 'gnus-summary-marks
463   :type 'character)
464
465 (defcustom gnus-forwarded-mark ?F
466   "*Mark used for articles that have been forwarded."
467   :group 'gnus-summary-marks
468   :type 'character)
469
470 (defcustom gnus-recent-mark ?N
471   "*Mark used for articles that are recent."
472   :group 'gnus-summary-marks
473   :type 'character)
474
475 (defcustom gnus-cached-mark ?*
476   "*Mark used for articles that are in the cache."
477   :group 'gnus-summary-marks
478   :type 'character)
479
480 (defcustom gnus-saved-mark ?S
481   "*Mark used for articles that have been saved."
482   :group 'gnus-summary-marks
483   :type 'character)
484
485 (defcustom gnus-unseen-mark ?.
486   "*Mark used for articles that haven't been seen."
487   :group 'gnus-summary-marks
488   :type 'character)
489
490 (defcustom gnus-no-mark ?               ;Whitespace
491   "*Mark used for articles that have no other secondary mark."
492   :group 'gnus-summary-marks
493   :type 'character)
494
495 (defcustom gnus-ancient-mark ?O
496   "*Mark used for ancient articles."
497   :group 'gnus-summary-marks
498   :type 'character)
499
500 (defcustom gnus-sparse-mark ?Q
501   "*Mark used for sparsely reffed articles."
502   :group 'gnus-summary-marks
503   :type 'character)
504
505 (defcustom gnus-canceled-mark ?G
506   "*Mark used for canceled articles."
507   :group 'gnus-summary-marks
508   :type 'character)
509
510 (defcustom gnus-duplicate-mark ?M
511   "*Mark used for duplicate articles."
512   :group 'gnus-summary-marks
513   :type 'character)
514
515 (defcustom gnus-undownloaded-mark ?-
516   "*Mark used for articles that weren't downloaded."
517   :group 'gnus-summary-marks
518   :type 'character)
519
520 (defcustom gnus-downloaded-mark ?+
521   "*Mark used for articles that were downloaded."
522   :group 'gnus-summary-marks
523   :type 'character)
524
525 (defcustom gnus-downloadable-mark ?%
526   "*Mark used for articles that are to be downloaded."
527   :group 'gnus-summary-marks
528   :type 'character)
529
530 (defcustom gnus-unsendable-mark ?=
531   "*Mark used for articles that won't be sent."
532   :group 'gnus-summary-marks
533   :type 'character)
534
535 (defcustom gnus-score-over-mark ?+
536   "*Score mark used for articles with high scores."
537   :group 'gnus-summary-marks
538   :type 'character)
539
540 (defcustom gnus-score-below-mark ?-
541   "*Score mark used for articles with low scores."
542   :group 'gnus-summary-marks
543   :type 'character)
544
545 (defcustom gnus-empty-thread-mark ?     ;Whitespace
546   "*There is no thread under the article."
547   :group 'gnus-summary-marks
548   :type 'character)
549
550 (defcustom gnus-not-empty-thread-mark ?=
551   "*There is a thread under the article."
552   :group 'gnus-summary-marks
553   :type 'character)
554
555 (defcustom gnus-view-pseudo-asynchronously nil
556   "*If non-nil, Gnus will view pseudo-articles asynchronously."
557   :group 'gnus-extract-view
558   :type 'boolean)
559
560 (defcustom gnus-auto-expirable-marks
561   (list gnus-killed-mark gnus-del-mark gnus-catchup-mark
562         gnus-low-score-mark gnus-ancient-mark gnus-read-mark
563         gnus-souped-mark gnus-duplicate-mark)
564   "*The list of marks converted into expiration if a group is auto-expirable."
565   :version "21.1"
566   :group 'gnus-summary
567   :type '(repeat character))
568
569 (defcustom gnus-inhibit-user-auto-expire t
570   "*If non-nil, user marking commands will not mark an article as expirable, even if the group has auto-expire turned on."
571   :version "21.1"
572   :group 'gnus-summary
573   :type 'boolean)
574
575 (defcustom gnus-view-pseudos nil
576   "*If `automatic', pseudo-articles will be viewed automatically.
577 If `not-confirm', pseudos will be viewed automatically, and the user
578 will not be asked to confirm the command."
579   :group 'gnus-extract-view
580   :type '(choice (const :tag "off" nil)
581                  (const automatic)
582                  (const not-confirm)))
583
584 (defcustom gnus-view-pseudos-separately t
585   "*If non-nil, one pseudo-article will be created for each file to be viewed.
586 If nil, all files that use the same viewing command will be given as a
587 list of parameters to that command."
588   :group 'gnus-extract-view
589   :type 'boolean)
590
591 (defcustom gnus-insert-pseudo-articles t
592   "*If non-nil, insert pseudo-articles when decoding articles."
593   :group 'gnus-extract-view
594   :type 'boolean)
595
596 (defcustom gnus-summary-dummy-line-format
597   "   %(:                             :%) %S\n"
598   "*The format specification for the dummy roots in the summary buffer.
599 It works along the same lines as a normal formatting string,
600 with some simple extensions.
601
602 %S  The subject
603
604 General format specifiers can also be used.
605 See `(gnus)Formatting Variables'."
606   :link '(custom-manual "(gnus)Formatting Variables")
607   :group 'gnus-threading
608   :type 'string)
609
610 (defcustom gnus-summary-mode-line-format "Gnus: %g [%A] %Z"
611   "*The format specification for the summary mode line.
612 It works along the same lines as a normal formatting string,
613 with some simple extensions:
614
615 %G  Group name
616 %p  Unprefixed group name
617 %A  Current article number
618 %z  Current article score
619 %V  Gnus version
620 %U  Number of unread articles in the group
621 %e  Number of unselected articles in the group
622 %Z  A string with unread/unselected article counts
623 %g  Shortish group name
624 %S  Subject of the current article
625 %u  User-defined spec
626 %s  Current score file name
627 %d  Number of dormant articles
628 %r  Number of articles that have been marked as read in this session
629 %E  Number of articles expunged by the score files"
630   :group 'gnus-summary-format
631   :type 'string)
632
633 (defcustom gnus-list-identifiers nil
634   "Regexp that matches list identifiers to be removed from subject.
635 This can also be a list of regexps."
636   :version "21.1"
637   :group 'gnus-summary-format
638   :group 'gnus-article-hiding
639   :type '(choice (const :tag "none" nil)
640                  (regexp :value ".*")
641                  (repeat :value (".*") regexp)))
642
643 (defcustom gnus-summary-mark-below 0
644   "*Mark all articles with a score below this variable as read.
645 This variable is local to each summary buffer and usually set by the
646 score file."
647   :group 'gnus-score-default
648   :type 'integer)
649
650 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number)
651   "*List of functions used for sorting articles in the summary buffer.
652
653 Each function takes two articles and returns non-nil if the first
654 article should be sorted before the other.  If you use more than one
655 function, the primary sort function should be the last.  You should
656 probably always include `gnus-article-sort-by-number' in the list of
657 sorting functions -- preferably first.  Also note that sorting by date
658 is often much slower than sorting by number, and the sorting order is
659 very similar.  (Sorting by date means sorting by the time the message
660 was sent, sorting by number means sorting by arrival time.)
661
662 Ready-made functions include `gnus-article-sort-by-number',
663 `gnus-article-sort-by-author', `gnus-article-sort-by-subject',
664 `gnus-article-sort-by-date', `gnus-article-sort-by-random'
665 and `gnus-article-sort-by-score'.
666
667 When threading is turned on, the variable `gnus-thread-sort-functions'
668 controls how articles are sorted."
669   :group 'gnus-summary-sort
670   :type '(repeat (choice (function-item gnus-article-sort-by-number)
671                          (function-item gnus-article-sort-by-author)
672                          (function-item gnus-article-sort-by-subject)
673                          (function-item gnus-article-sort-by-date)
674                          (function-item gnus-article-sort-by-score)
675                          (function-item gnus-article-sort-by-random)
676                          (function :tag "other"))))
677
678 (defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number)
679   "*List of functions used for sorting threads in the summary buffer.
680 By default, threads are sorted by article number.
681
682 Each function takes two threads and returns non-nil if the first
683 thread should be sorted before the other.  If you use more than one
684 function, the primary sort function should be the last.  You should
685 probably always include `gnus-thread-sort-by-number' in the list of
686 sorting functions -- preferably first.  Also note that sorting by date
687 is often much slower than sorting by number, and the sorting order is
688 very similar.  (Sorting by date means sorting by the time the message
689 was sent, sorting by number means sorting by arrival time.)
690
691 Ready-made functions include `gnus-thread-sort-by-number',
692 `gnus-thread-sort-by-author', `gnus-thread-sort-by-subject',
693 `gnus-thread-sort-by-date', `gnus-thread-sort-by-score',
694 `gnus-thread-sort-by-most-recent-number',
695 `gnus-thread-sort-by-most-recent-date',
696 `gnus-thread-sort-by-random', and
697 `gnus-thread-sort-by-total-score' (see `gnus-thread-score-function').
698
699 When threading is turned off, the variable
700 `gnus-article-sort-functions' controls how articles are sorted."
701   :group 'gnus-summary-sort
702   :type '(repeat (choice (function-item gnus-thread-sort-by-number)
703                          (function-item gnus-thread-sort-by-author)
704                          (function-item gnus-thread-sort-by-subject)
705                          (function-item gnus-thread-sort-by-date)
706                          (function-item gnus-thread-sort-by-score)
707                          (function-item gnus-thread-sort-by-total-score)
708                          (function-item gnus-thread-sort-by-random)
709                          (function :tag "other"))))
710
711 (defcustom gnus-thread-score-function '+
712   "*Function used for calculating the total score of a thread.
713
714 The function is called with the scores of the article and each
715 subthread and should then return the score of the thread.
716
717 Some functions you can use are `+', `max', or `min'."
718   :group 'gnus-summary-sort
719   :type 'function)
720
721 (defcustom gnus-summary-expunge-below nil
722   "All articles that have a score less than this variable will be expunged.
723 This variable is local to the summary buffers."
724   :group 'gnus-score-default
725   :type '(choice (const :tag "off" nil)
726                  integer))
727
728 (defcustom gnus-thread-expunge-below nil
729   "All threads that have a total score less than this variable will be expunged.
730 See `gnus-thread-score-function' for en explanation of what a
731 \"thread score\" is.
732
733 This variable is local to the summary buffers."
734   :group 'gnus-threading
735   :group 'gnus-score-default
736   :type '(choice (const :tag "off" nil)
737                  integer))
738
739 (defcustom gnus-summary-mode-hook nil
740   "*A hook for Gnus summary mode.
741 This hook is run before any variables are set in the summary buffer."
742   :options '(turn-on-gnus-mailing-list-mode gnus-pick-mode)
743   :group 'gnus-summary-various
744   :type 'hook)
745
746 ;; Extracted from gnus-xmas-redefine in order to preserve user settings
747 (when (featurep 'xemacs)
748   (add-hook 'gnus-summary-mode-hook 'gnus-xmas-summary-menu-add)
749   (add-hook 'gnus-summary-mode-hook 'gnus-xmas-setup-summary-toolbar)
750   (add-hook 'gnus-summary-mode-hook
751             'gnus-xmas-switch-horizontal-scrollbar-off))
752
753 (defcustom gnus-summary-menu-hook nil
754   "*Hook run after the creation of the summary mode menu."
755   :group 'gnus-summary-visual
756   :type 'hook)
757
758 (defcustom gnus-summary-exit-hook nil
759   "*A hook called on exit from the summary buffer.
760 It will be called with point in the group buffer."
761   :group 'gnus-summary-exit
762   :type 'hook)
763
764 (defcustom gnus-summary-prepare-hook nil
765   "*A hook called after the summary buffer has been generated.
766 If you want to modify the summary buffer, you can use this hook."
767   :group 'gnus-summary-various
768   :type 'hook)
769
770 (defcustom gnus-summary-prepared-hook nil
771   "*A hook called as the last thing after the summary buffer has been generated."
772   :group 'gnus-summary-various
773   :type 'hook)
774
775 (defcustom gnus-summary-generate-hook nil
776   "*A hook run just before generating the summary buffer.
777 This hook is commonly used to customize threading variables and the
778 like."
779   :group 'gnus-summary-various
780   :type 'hook)
781
782 (defcustom gnus-select-group-hook nil
783   "*A hook called when a newsgroup is selected.
784
785 If you'd like to simplify subjects like the
786 `gnus-summary-next-same-subject' command does, you can use the
787 following hook:
788
789  (add-hook gnus-select-group-hook
790            (lambda ()
791              (mapcar (lambda (header)
792                        (mail-header-set-subject
793                         header
794                         (gnus-simplify-subject
795                          (mail-header-subject header) 're-only)))
796                      gnus-newsgroup-headers)))"
797   :group 'gnus-group-select
798   :type 'hook)
799
800 (defcustom gnus-select-article-hook nil
801   "*A hook called when an article is selected."
802   :group 'gnus-summary-choose
803   :options '(gnus-agent-fetch-selected-article)
804   :type 'hook)
805
806 (defcustom gnus-visual-mark-article-hook
807   (list 'gnus-highlight-selected-summary)
808   "*Hook run after selecting an article in the summary buffer.
809 It is meant to be used for highlighting the article in some way.  It
810 is not run if `gnus-visual' is nil."
811   :group 'gnus-summary-visual
812   :type 'hook)
813
814 (defcustom gnus-parse-headers-hook nil
815   "*A hook called before parsing the headers."
816   :group 'gnus-various
817   :type 'hook)
818
819 (defcustom gnus-exit-group-hook nil
820   "*A hook called when exiting summary mode.
821 This hook is not called from the non-updating exit commands like `Q'."
822   :group 'gnus-various
823   :type 'hook)
824
825 (defcustom gnus-summary-update-hook
826   (list 'gnus-summary-highlight-line)
827   "*A hook called when a summary line is changed.
828 The hook will not be called if `gnus-visual' is nil.
829
830 The default function `gnus-summary-highlight-line' will
831 highlight the line according to the `gnus-summary-highlight'
832 variable."
833   :group 'gnus-summary-visual
834   :type 'hook)
835
836 (defcustom gnus-mark-article-hook '(gnus-summary-mark-read-and-unread-as-read)
837   "*A hook called when an article is selected for the first time.
838 The hook is intended to mark an article as read (or unread)
839 automatically when it is selected."
840   :group 'gnus-summary-choose
841   :type 'hook)
842
843 (defcustom gnus-group-no-more-groups-hook nil
844   "*A hook run when returning to group mode having no more (unread) groups."
845   :group 'gnus-group-select
846   :type 'hook)
847
848 (defcustom gnus-ps-print-hook nil
849   "*A hook run before ps-printing something from Gnus."
850   :group 'gnus-summary
851   :type 'hook)
852
853 (defcustom gnus-summary-article-move-hook nil
854   "*A hook called after an article is moved, copied, respooled, or crossposted."
855   :group 'gnus-summary
856   :type 'hook)
857
858 (defcustom gnus-summary-article-delete-hook nil
859   "*A hook called after an article is deleted."
860   :group 'gnus-summary
861   :type 'hook)
862
863 (defcustom gnus-summary-article-expire-hook nil
864   "*A hook called after an article is expired."
865   :group 'gnus-summary
866   :type 'hook)
867
868 (defcustom gnus-summary-display-arrow
869   (and (fboundp 'display-graphic-p)
870        (display-graphic-p))
871   "*If non-nil, display an arrow highlighting the current article."
872   :version "21.1"
873   :group 'gnus-summary
874   :type 'boolean)
875
876 (defcustom gnus-summary-selected-face 'gnus-summary-selected-face
877   "Face used for highlighting the current article in the summary buffer."
878   :group 'gnus-summary-visual
879   :type 'face)
880
881 (defvar gnus-tmp-downloaded nil)
882
883 (defcustom gnus-summary-highlight
884   '(((eq mark gnus-canceled-mark)
885      . gnus-summary-cancelled-face)
886     ((and uncached (> score default-high))
887      . gnus-summary-high-undownloaded-face)
888     ((and uncached (< score default-low))
889      . gnus-summary-low-undownloaded-face)
890     (uncached
891      . gnus-summary-normal-undownloaded-face)
892     ((and (> score default-high)
893           (or (eq mark gnus-dormant-mark)
894               (eq mark gnus-ticked-mark)))
895      . gnus-summary-high-ticked-face)
896     ((and (< score default-low)
897           (or (eq mark gnus-dormant-mark)
898               (eq mark gnus-ticked-mark)))
899      . gnus-summary-low-ticked-face)
900     ((or (eq mark gnus-dormant-mark)
901          (eq mark gnus-ticked-mark))
902      . gnus-summary-normal-ticked-face)
903     ((and (> score default-high) (eq mark gnus-ancient-mark))
904      . gnus-summary-high-ancient-face)
905     ((and (< score default-low) (eq mark gnus-ancient-mark))
906      . gnus-summary-low-ancient-face)
907     ((eq mark gnus-ancient-mark)
908      . gnus-summary-normal-ancient-face)
909     ((and (> score default-high) (eq mark gnus-unread-mark))
910      . gnus-summary-high-unread-face)
911     ((and (< score default-low) (eq mark gnus-unread-mark))
912      . gnus-summary-low-unread-face)
913     ((eq mark gnus-unread-mark)
914      . gnus-summary-normal-unread-face)
915     ((> score default-high)
916      . gnus-summary-high-read-face)
917     ((< score default-low)
918      . gnus-summary-low-read-face)
919     (t
920      . gnus-summary-normal-read-face))
921   "*Controls the highlighting of summary buffer lines.
922
923 A list of (FORM . FACE) pairs.  When deciding how a a particular
924 summary line should be displayed, each form is evaluated.  The content
925 of the face field after the first true form is used.  You can change
926 how those summary lines are displayed, by editing the face field.
927
928 You can use the following variables in the FORM field.
929
930 score:        The article's score
931 default:      The default article score.
932 default-high: The default score for high scored articles.
933 default-low:  The default score for low scored articles.
934 below:        The score below which articles are automatically marked as read.
935 mark:         The articles mark."
936   :group 'gnus-summary-visual
937   :type '(repeat (cons (sexp :tag "Form" nil)
938                        face)))
939
940 (defcustom gnus-alter-header-function nil
941   "Function called to allow alteration of article header structures.
942 The function is called with one parameter, the article header vector,
943 which it may alter in any way."
944   :type '(choice (const :tag "None" nil)
945                  function)
946   :group 'gnus-summary)
947
948 (defvar gnus-decode-encoded-word-function 'mail-decode-encoded-word-string
949   "Variable that says which function should be used to decode a string with encoded words.")
950
951 (defcustom gnus-extra-headers '(To Newsgroups)
952   "*Extra headers to parse."
953   :version "21.1"
954   :group 'gnus-summary
955   :type '(repeat symbol))
956
957 (defcustom gnus-ignored-from-addresses
958   (and user-mail-address (regexp-quote user-mail-address))
959   "*Regexp of From headers that may be suppressed in favor of To headers."
960   :version "21.1"
961   :group 'gnus-summary
962   :type 'regexp)
963
964 (defcustom gnus-newsgroup-ignored-charsets '(unknown-8bit x-unknown)
965   "List of charsets that should be ignored.
966 When these charsets are used in the \"charset\" parameter, the
967 default charset will be used instead."
968   :version "21.1"
969   :type '(repeat symbol)
970   :group 'gnus-charset)
971
972 (gnus-define-group-parameter
973  ignored-charsets
974  :type list
975  :function-document
976  "Return the ignored charsets of GROUP."
977  :variable gnus-group-ignored-charsets-alist
978  :variable-default
979  '(("alt\\.chinese\\.text" iso-8859-1))
980  :variable-document
981  "Alist of regexps (to match group names) and charsets that should be ignored.
982 When these charsets are used in the \"charset\" parameter, the
983 default charset will be used instead."
984  :variable-group gnus-charset
985  :variable-type '(repeat (cons (regexp :tag "Group")
986                                (repeat symbol)))
987  :parameter-type '(choice :tag "Ignored charsets"
988                           :value nil
989                           (repeat (symbol)))
990  :parameter-document       "\
991 List of charsets that should be ignored.
992
993 When these charsets are used in the \"charset\" parameter, the
994 default charset will be used instead.")
995
996 (defcustom gnus-group-highlight-words-alist nil
997   "Alist of group regexps and highlight regexps.
998 This variable uses the same syntax as `gnus-emphasis-alist'."
999   :version "21.1"
1000   :type '(repeat (cons (regexp :tag "Group")
1001                        (repeat (list (regexp :tag "Highlight regexp")
1002                                      (number :tag "Group for entire word" 0)
1003                                      (number :tag "Group for displayed part" 0)
1004                                      (symbol :tag "Face"
1005                                              gnus-emphasis-highlight-words)))))
1006   :group 'gnus-summary-visual)
1007
1008 (defcustom gnus-summary-show-article-charset-alist
1009   nil
1010   "Alist of number and charset.
1011 The article will be shown with the charset corresponding to the
1012 numbered argument.
1013 For example: ((1 . cn-gb-2312) (2 . big5))."
1014   :version "21.1"
1015   :type '(repeat (cons (number :tag "Argument" 1)
1016                        (symbol :tag "Charset")))
1017   :group 'gnus-charset)
1018
1019 (defcustom gnus-preserve-marks t
1020   "Whether marks are preserved when moving, copying and respooling messages."
1021   :version "21.1"
1022   :type 'boolean
1023   :group 'gnus-summary-marks)
1024
1025 (defcustom gnus-alter-articles-to-read-function nil
1026   "Function to be called to alter the list of articles to be selected."
1027   :type '(choice (const nil) function)
1028   :group 'gnus-summary)
1029
1030 (defcustom gnus-orphan-score nil
1031   "*All orphans get this score added.  Set in the score file."
1032   :group 'gnus-score-default
1033   :type '(choice (const nil)
1034                  integer))
1035
1036 (defcustom gnus-summary-save-parts-default-mime "image/.*"
1037   "*A regexp to match MIME parts when saving multiple parts of a
1038 message with `gnus-summary-save-parts' (\\<gnus-summary-mode-map>\\[gnus-summary-save-parts]).
1039 This regexp will be used by default when prompting the user for which
1040 type of files to save."
1041   :group 'gnus-summary
1042   :type 'regexp)
1043
1044 (defcustom gnus-read-all-available-headers nil
1045   "Whether Gnus should parse all headers made available to it.
1046 This is mostly relevant for slow backends where the user may
1047 wish to widen the summary buffer to include all headers
1048 that were fetched.  Say, for nnultimate groups."
1049   :group 'gnus-summary
1050   :type '(choice boolean regexp))
1051
1052 (defcustom gnus-summary-muttprint-program "muttprint"
1053   "Command (and optional arguments) used to run Muttprint."
1054   :version "21.3"
1055   :group 'gnus-summary
1056   :type 'string)
1057
1058 (defcustom gnus-article-loose-mime nil
1059   "If non-nil, don't require MIME-Version header.
1060 Some brain-damaged MUA/MTA, e.g. Lotus Domino 5.0.6 clients, does not
1061 supply the MIME-Version header or deliberately strip it From the mail.
1062 Set it to non-nil, Gnus will treat some articles as MIME even if
1063 the MIME-Version header is missed."
1064   :version "21.3"
1065   :type 'boolean
1066   :group 'gnus-article)
1067
1068 (defcustom gnus-article-emulate-mime t
1069   "If non-nil, use MIME emulation for uuencode and the like.
1070 This means that Gnus will search message bodies for text that look
1071 like uuencoded bits, yEncoded bits, and so on, and present that using
1072 the normal Gnus MIME machinery."
1073   :type 'boolean
1074   :group 'gnus-article)
1075
1076 ;;; Internal variables
1077
1078 (defvar gnus-summary-display-cache nil)
1079 (defvar gnus-article-mime-handles nil)
1080 (defvar gnus-article-decoded-p nil)
1081 (defvar gnus-article-charset nil)
1082 (defvar gnus-article-ignored-charsets nil)
1083 (defvar gnus-scores-exclude-files nil)
1084 (defvar gnus-page-broken nil)
1085
1086 (defvar gnus-original-article nil)
1087 (defvar gnus-article-internal-prepare-hook nil)
1088 (defvar gnus-newsgroup-process-stack nil)
1089
1090 (defvar gnus-thread-indent-array nil)
1091 (defvar gnus-thread-indent-array-level gnus-thread-indent-level)
1092 (defvar gnus-sort-gathered-threads-function 'gnus-thread-sort-by-number
1093   "Function called to sort the articles within a thread after it has been gathered together.")
1094
1095 (defvar gnus-summary-save-parts-type-history nil)
1096 (defvar gnus-summary-save-parts-last-directory nil)
1097
1098 ;; Avoid highlighting in kill files.
1099 (defvar gnus-summary-inhibit-highlight nil)
1100 (defvar gnus-newsgroup-selected-overlay nil)
1101 (defvar gnus-inhibit-limiting nil)
1102 (defvar gnus-newsgroup-adaptive-score-file nil)
1103 (defvar gnus-current-score-file nil)
1104 (defvar gnus-current-move-group nil)
1105 (defvar gnus-current-copy-group nil)
1106 (defvar gnus-current-crosspost-group nil)
1107 (defvar gnus-newsgroup-display nil)
1108
1109 (defvar gnus-newsgroup-dependencies nil)
1110 (defvar gnus-newsgroup-adaptive nil)
1111 (defvar gnus-summary-display-article-function nil)
1112 (defvar gnus-summary-highlight-line-function nil
1113   "Function called after highlighting a summary line.")
1114
1115 (defvar gnus-summary-line-format-alist
1116   `((?N ,(macroexpand '(mail-header-number gnus-tmp-header)) ?d)
1117     (?S ,(macroexpand '(mail-header-subject gnus-tmp-header)) ?s)
1118     (?s gnus-tmp-subject-or-nil ?s)
1119     (?n gnus-tmp-name ?s)
1120     (?A (car (cdr (funcall gnus-extract-address-components gnus-tmp-from)))
1121         ?s)
1122     (?a (or (car (funcall gnus-extract-address-components gnus-tmp-from))
1123             gnus-tmp-from) ?s)
1124     (?F gnus-tmp-from ?s)
1125     (?x ,(macroexpand '(mail-header-xref gnus-tmp-header)) ?s)
1126     (?D ,(macroexpand '(mail-header-date gnus-tmp-header)) ?s)
1127     (?d (gnus-dd-mmm (mail-header-date gnus-tmp-header)) ?s)
1128     (?o (gnus-date-iso8601 (mail-header-date gnus-tmp-header)) ?s)
1129     (?M ,(macroexpand '(mail-header-id gnus-tmp-header)) ?s)
1130     (?r ,(macroexpand '(mail-header-references gnus-tmp-header)) ?s)
1131     (?c (or (mail-header-chars gnus-tmp-header) 0) ?d)
1132     (?k (gnus-summary-line-message-size gnus-tmp-header) ?s)
1133     (?L gnus-tmp-lines ?s)
1134     (?O gnus-tmp-downloaded ?c)
1135     (?I gnus-tmp-indentation ?s)
1136     (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s)
1137     (?R gnus-tmp-replied ?c)
1138     (?\[ gnus-tmp-opening-bracket ?c)
1139     (?\] gnus-tmp-closing-bracket ?c)
1140     (?\> (make-string gnus-tmp-level ? ) ?s)
1141     (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s)
1142     (?i gnus-tmp-score ?d)
1143     (?z gnus-tmp-score-char ?c)
1144     (?l (bbb-grouplens-score gnus-tmp-header) ?s)
1145     (?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d)
1146     (?U gnus-tmp-unread ?c)
1147     (?f (gnus-summary-from-or-to-or-newsgroups gnus-tmp-header gnus-tmp-from)
1148         ?s)
1149     (?t (gnus-summary-number-of-articles-in-thread
1150          (and (boundp 'thread) (car thread)) gnus-tmp-level)
1151         ?d)
1152     (?e (gnus-summary-number-of-articles-in-thread
1153          (and (boundp 'thread) (car thread)) gnus-tmp-level t)
1154         ?c)
1155     (?u gnus-tmp-user-defined ?s)
1156     (?P (gnus-pick-line-number) ?d)
1157     (?B gnus-tmp-thread-tree-header-string ?s)
1158     (user-date (gnus-user-date
1159                 ,(macroexpand '(mail-header-date gnus-tmp-header))) ?s))
1160   "An alist of format specifications that can appear in summary lines.
1161 These are paired with what variables they correspond with, along with
1162 the type of the variable (string, integer, character, etc).")
1163
1164 (defvar gnus-summary-dummy-line-format-alist
1165   `((?S gnus-tmp-subject ?s)
1166     (?N gnus-tmp-number ?d)
1167     (?u gnus-tmp-user-defined ?s)))
1168
1169 (defvar gnus-summary-mode-line-format-alist
1170   `((?G gnus-tmp-group-name ?s)
1171     (?g (gnus-short-group-name gnus-tmp-group-name) ?s)
1172     (?p (gnus-group-real-name gnus-tmp-group-name) ?s)
1173     (?A gnus-tmp-article-number ?d)
1174     (?Z gnus-tmp-unread-and-unselected ?s)
1175     (?V gnus-version ?s)
1176     (?U gnus-tmp-unread-and-unticked ?d)
1177     (?S gnus-tmp-subject ?s)
1178     (?e gnus-tmp-unselected ?d)
1179     (?u gnus-tmp-user-defined ?s)
1180     (?d (length gnus-newsgroup-dormant) ?d)
1181     (?t (length gnus-newsgroup-marked) ?d)
1182     (?h (length gnus-newsgroup-spam-marked) ?d)
1183     (?r (length gnus-newsgroup-reads) ?d)
1184     (?z (gnus-summary-article-score gnus-tmp-article-number) ?d)
1185     (?E gnus-newsgroup-expunged-tally ?d)
1186     (?s (gnus-current-score-file-nondirectory) ?s)))
1187
1188 (defvar gnus-last-search-regexp nil
1189   "Default regexp for article search command.")
1190
1191 (defvar gnus-last-shell-command nil
1192   "Default shell command on article.")
1193
1194 (defvar gnus-newsgroup-agentized nil
1195   "Locally bound in each summary buffer to indicate whether the server has been agentized.")
1196 (defvar gnus-newsgroup-begin nil)
1197 (defvar gnus-newsgroup-end nil)
1198 (defvar gnus-newsgroup-last-rmail nil)
1199 (defvar gnus-newsgroup-last-mail nil)
1200 (defvar gnus-newsgroup-last-folder nil)
1201 (defvar gnus-newsgroup-last-file nil)
1202 (defvar gnus-newsgroup-auto-expire nil)
1203 (defvar gnus-newsgroup-active nil)
1204
1205 (defvar gnus-newsgroup-data nil)
1206 (defvar gnus-newsgroup-data-reverse nil)
1207 (defvar gnus-newsgroup-limit nil)
1208 (defvar gnus-newsgroup-limits nil)
1209
1210 (defvar gnus-newsgroup-unreads nil
1211   "Sorted list of unread articles in the current newsgroup.")
1212
1213 (defvar gnus-newsgroup-unselected nil
1214   "Sorted list of unselected unread articles in the current newsgroup.")
1215
1216 (defvar gnus-newsgroup-reads nil
1217   "Alist of read articles and article marks in the current newsgroup.")
1218
1219 (defvar gnus-newsgroup-expunged-tally nil)
1220
1221 (defvar gnus-newsgroup-marked nil
1222   "Sorted list of ticked articles in the current newsgroup (a subset of unread art).")
1223
1224 (defvar gnus-newsgroup-spam-marked nil
1225   "List of ranges of articles that have been marked as spam.")
1226
1227 (defvar gnus-newsgroup-killed nil
1228   "List of ranges of articles that have been through the scoring process.")
1229
1230 (defvar gnus-newsgroup-cached nil
1231   "Sorted list of articles that come from the article cache.")
1232
1233 (defvar gnus-newsgroup-saved nil
1234   "List of articles that have been saved.")
1235
1236 (defvar gnus-newsgroup-kill-headers nil)
1237
1238 (defvar gnus-newsgroup-replied nil
1239   "List of articles that have been replied to in the current newsgroup.")
1240
1241 (defvar gnus-newsgroup-forwarded nil
1242   "List of articles that have been forwarded in the current newsgroup.")
1243
1244 (defvar gnus-newsgroup-recent nil
1245   "List of articles that have are recent in the current newsgroup.")
1246
1247 (defvar gnus-newsgroup-expirable nil
1248   "Sorted list of articles in the current newsgroup that can be expired.")
1249
1250 (defvar gnus-newsgroup-processable nil
1251   "List of articles in the current newsgroup that can be processed.")
1252
1253 (defvar gnus-newsgroup-downloadable nil
1254   "Sorted list of articles in the current newsgroup that can be processed.")
1255
1256 (defvar gnus-newsgroup-unfetched nil
1257   "Sorted list of articles in the current newsgroup whose headers have not been fetched into the agent.")
1258
1259 (defvar gnus-newsgroup-undownloaded nil
1260   "List of articles in the current newsgroup that haven't been downloaded.")
1261
1262 (defvar gnus-newsgroup-unsendable nil
1263   "List of articles in the current newsgroup that won't be sent.")
1264
1265 (defvar gnus-newsgroup-bookmarks nil
1266   "List of articles in the current newsgroup that have bookmarks.")
1267
1268 (defvar gnus-newsgroup-dormant nil
1269   "Sorted list of dormant articles in the current newsgroup.")
1270
1271 (defvar gnus-newsgroup-unseen nil
1272   "List of unseen articles in the current newsgroup.")
1273
1274 (defvar gnus-newsgroup-seen nil
1275   "Range of seen articles in the current newsgroup.")
1276
1277 (defvar gnus-newsgroup-articles nil
1278   "List of articles in the current newsgroup.")
1279
1280 (defvar gnus-newsgroup-scored nil
1281   "List of scored articles in the current newsgroup.")
1282
1283 (defvar gnus-newsgroup-headers nil
1284   "List of article headers in the current newsgroup.")
1285
1286 (defvar gnus-newsgroup-threads nil)
1287
1288 (defvar gnus-newsgroup-prepared nil
1289   "Whether the current group has been prepared properly.")
1290
1291 (defvar gnus-newsgroup-ancient nil
1292   "List of `gnus-fetch-old-headers' articles in the current newsgroup.")
1293
1294 (defvar gnus-newsgroup-sparse nil)
1295
1296 (defvar gnus-current-article nil)
1297 (defvar gnus-article-current nil)
1298 (defvar gnus-current-headers nil)
1299 (defvar gnus-have-all-headers nil)
1300 (defvar gnus-last-article nil)
1301 (defvar gnus-newsgroup-history nil)
1302 (defvar gnus-newsgroup-charset nil)
1303 (defvar gnus-newsgroup-ephemeral-charset nil)
1304 (defvar gnus-newsgroup-ephemeral-ignored-charsets nil)
1305
1306 (defvar gnus-article-before-search nil)
1307
1308 (defconst gnus-summary-local-variables
1309   '(gnus-newsgroup-name
1310     gnus-newsgroup-begin gnus-newsgroup-end
1311     gnus-newsgroup-last-rmail gnus-newsgroup-last-mail
1312     gnus-newsgroup-last-folder gnus-newsgroup-last-file
1313     gnus-newsgroup-auto-expire gnus-newsgroup-unreads
1314     gnus-newsgroup-unselected gnus-newsgroup-marked
1315     gnus-newsgroup-spam-marked
1316     gnus-newsgroup-reads gnus-newsgroup-saved
1317     gnus-newsgroup-replied gnus-newsgroup-forwarded
1318     gnus-newsgroup-recent
1319     gnus-newsgroup-expirable
1320     gnus-newsgroup-processable gnus-newsgroup-killed
1321     gnus-newsgroup-downloadable gnus-newsgroup-undownloaded
1322     gnus-newsgroup-unfetched
1323     gnus-newsgroup-unsendable gnus-newsgroup-unseen
1324     gnus-newsgroup-seen gnus-newsgroup-articles
1325     gnus-newsgroup-bookmarks gnus-newsgroup-dormant
1326     gnus-newsgroup-headers gnus-newsgroup-threads
1327     gnus-newsgroup-prepared gnus-summary-highlight-line-function
1328     gnus-current-article gnus-current-headers gnus-have-all-headers
1329     gnus-last-article gnus-article-internal-prepare-hook
1330     gnus-newsgroup-dependencies gnus-newsgroup-selected-overlay
1331     gnus-newsgroup-scored gnus-newsgroup-kill-headers
1332     gnus-thread-expunge-below
1333     gnus-score-alist gnus-current-score-file
1334     (gnus-summary-expunge-below . global)
1335     (gnus-summary-mark-below . global)
1336     (gnus-orphan-score . global)
1337     gnus-newsgroup-active gnus-scores-exclude-files
1338     gnus-newsgroup-history gnus-newsgroup-ancient
1339     gnus-newsgroup-sparse gnus-newsgroup-process-stack
1340     (gnus-newsgroup-adaptive . gnus-use-adaptive-scoring)
1341     gnus-newsgroup-adaptive-score-file (gnus-reffed-article-number . -1)
1342     (gnus-newsgroup-expunged-tally . 0)
1343     gnus-cache-removable-articles gnus-newsgroup-cached
1344     gnus-newsgroup-data gnus-newsgroup-data-reverse
1345     gnus-newsgroup-limit gnus-newsgroup-limits
1346     gnus-newsgroup-charset gnus-newsgroup-display)
1347   "Variables that are buffer-local to the summary buffers.")
1348
1349 (defvar gnus-newsgroup-variables nil
1350   "A list of variables that have separate values in different newsgroups.
1351 A list of newsgroup (summary buffer) local variables, or cons of
1352 variables and their default values (when the default values are not
1353 nil), that should be made global while the summary buffer is active.
1354 These variables can be used to set variables in the group parameters
1355 while still allowing them to affect operations done in other
1356 buffers. For example:
1357
1358 \(setq gnus-newsgroup-variables
1359      '(message-use-followup-to
1360        (gnus-visible-headers .
1361          \"^From:\\\\|^Newsgroups:\\\\|^Subject:\\\\|^Date:\\\\|^To:\")))
1362 ")
1363
1364 ;; Byte-compiler warning.
1365 ;(eval-when-compile (defvar gnus-article-mode-map))
1366 (eval-when-compile
1367   (let ((features (cons 'gnus-sum features)))
1368     (require 'gnus)
1369     (require 'gnus-agent)
1370     (require 'gnus-art)))
1371
1372 ;; MIME stuff.
1373
1374 (defvar gnus-decode-encoded-word-methods
1375   '(mail-decode-encoded-word-string)
1376   "List of methods used to decode encoded words.
1377
1378 This variable is a list of FUNCTION or (REGEXP . FUNCTION).  If item
1379 is FUNCTION, FUNCTION will be apply to all newsgroups.  If item is a
1380 \(REGEXP . FUNCTION), FUNCTION will be only apply to thes newsgroups
1381 whose names match REGEXP.
1382
1383 For example:
1384 \((\"chinese\" . gnus-decode-encoded-word-string-by-guess)
1385  mail-decode-encoded-word-string
1386  (\"chinese\" . rfc1843-decode-string))")
1387
1388 (defvar gnus-decode-encoded-word-methods-cache nil)
1389
1390 (defun gnus-multi-decode-encoded-word-string (string)
1391   "Apply the functions from `gnus-encoded-word-methods' that match."
1392   (unless (and gnus-decode-encoded-word-methods-cache
1393                (eq gnus-newsgroup-name
1394                    (car gnus-decode-encoded-word-methods-cache)))
1395     (setq gnus-decode-encoded-word-methods-cache (list gnus-newsgroup-name))
1396     (mapcar (lambda (x)
1397               (if (symbolp x)
1398                   (nconc gnus-decode-encoded-word-methods-cache (list x))
1399                 (if (and gnus-newsgroup-name
1400                          (string-match (car x) gnus-newsgroup-name))
1401                     (nconc gnus-decode-encoded-word-methods-cache
1402                            (list (cdr x))))))
1403             gnus-decode-encoded-word-methods))
1404   (let ((xlist gnus-decode-encoded-word-methods-cache))
1405     (pop xlist)
1406     (while xlist
1407       (setq string (funcall (pop xlist) string))))
1408   string)
1409
1410 ;; Subject simplification.
1411
1412 (defun gnus-simplify-whitespace (str)
1413   "Remove excessive whitespace from STR."
1414   ;; Multiple spaces.
1415   (while (string-match "[ \t][ \t]+" str)
1416     (setq str (concat (substring str 0 (match-beginning 0))
1417                         " "
1418                         (substring str (match-end 0)))))
1419   ;; Leading spaces.
1420   (when (string-match "^[ \t]+" str)
1421     (setq str (substring str (match-end 0))))
1422   ;; Trailing spaces.
1423   (when (string-match "[ \t]+$" str)
1424     (setq str (substring str 0 (match-beginning 0))))
1425   str)
1426
1427 (defun gnus-simplify-all-whitespace (str)
1428   "Remove all whitespace from STR."
1429   (while (string-match "[ \t\n]+" str)
1430     (setq str (replace-match "" nil nil str)))
1431   str)
1432
1433 (defsubst gnus-simplify-subject-re (subject)
1434   "Remove \"Re:\" from subject lines."
1435   (if (string-match message-subject-re-regexp subject)
1436       (substring subject (match-end 0))
1437     subject))
1438
1439 (defun gnus-simplify-subject (subject &optional re-only)
1440   "Remove `Re:' and words in parentheses.
1441 If RE-ONLY is non-nil, strip leading `Re:'s only."
1442   (let ((case-fold-search t))           ;Ignore case.
1443     ;; Remove `Re:', `Re^N:', `Re(n)', and `Re[n]:'.
1444     (when (string-match "\\`\\(re\\([[(^][0-9]+[])]?\\)?:[ \t]*\\)+" subject)
1445       (setq subject (substring subject (match-end 0))))
1446     ;; Remove uninteresting prefixes.
1447     (when (and (not re-only)
1448                gnus-simplify-ignored-prefixes
1449                (string-match gnus-simplify-ignored-prefixes subject))
1450       (setq subject (substring subject (match-end 0))))
1451     ;; Remove words in parentheses from end.
1452     (unless re-only
1453       (while (string-match "[ \t\n]*([^()]*)[ \t\n]*\\'" subject)
1454         (setq subject (substring subject 0 (match-beginning 0)))))
1455     ;; Return subject string.
1456     subject))
1457
1458 ;; Remove any leading "re:"s, any trailing paren phrases, and simplify
1459 ;; all whitespace.
1460 (defsubst gnus-simplify-buffer-fuzzy-step (regexp &optional newtext)
1461   (goto-char (point-min))
1462   (while (re-search-forward regexp nil t)
1463     (replace-match (or newtext ""))))
1464
1465 (defun gnus-simplify-buffer-fuzzy ()
1466   "Simplify string in the buffer fuzzily.
1467 The string in the accessible portion of the current buffer is simplified.
1468 It is assumed to be a single-line subject.
1469 Whitespace is generally cleaned up, and miscellaneous leading/trailing
1470 matter is removed.  Additional things can be deleted by setting
1471 `gnus-simplify-subject-fuzzy-regexp'."
1472   (let ((case-fold-search t)
1473         (modified-tick))
1474     (gnus-simplify-buffer-fuzzy-step "\t" " ")
1475
1476     (while (not (eq modified-tick (buffer-modified-tick)))
1477       (setq modified-tick (buffer-modified-tick))
1478       (cond
1479        ((listp gnus-simplify-subject-fuzzy-regexp)
1480         (mapcar 'gnus-simplify-buffer-fuzzy-step
1481                 gnus-simplify-subject-fuzzy-regexp))
1482        (gnus-simplify-subject-fuzzy-regexp
1483         (gnus-simplify-buffer-fuzzy-step gnus-simplify-subject-fuzzy-regexp)))
1484       (gnus-simplify-buffer-fuzzy-step "^ *\\[[-+?*!][-+?*!]\\] *")
1485       (gnus-simplify-buffer-fuzzy-step
1486        "^ *\\(re\\|fw\\|fwd\\)[[{(^0-9]*[])}]?[:;] *")
1487       (gnus-simplify-buffer-fuzzy-step "^[[].*:\\( .*\\)[]]$" "\\1"))
1488
1489     (gnus-simplify-buffer-fuzzy-step " *[[{(][^()\n]*[]})] *$")
1490     (gnus-simplify-buffer-fuzzy-step "  +" " ")
1491     (gnus-simplify-buffer-fuzzy-step " $")
1492     (gnus-simplify-buffer-fuzzy-step "^ +")))
1493
1494 (defun gnus-simplify-subject-fuzzy (subject)
1495   "Simplify a subject string fuzzily.
1496 See `gnus-simplify-buffer-fuzzy' for details."
1497   (save-excursion
1498     (gnus-set-work-buffer)
1499     (let ((case-fold-search t))
1500       ;; Remove uninteresting prefixes.
1501       (when (and gnus-simplify-ignored-prefixes
1502                  (string-match gnus-simplify-ignored-prefixes subject))
1503         (setq subject (substring subject (match-end 0))))
1504       (insert subject)
1505       (inline (gnus-simplify-buffer-fuzzy))
1506       (buffer-string))))
1507
1508 (defsubst gnus-simplify-subject-fully (subject)
1509   "Simplify a subject string according to `gnus-summary-gather-subject-limit'."
1510   (cond
1511    (gnus-simplify-subject-functions
1512     (gnus-map-function gnus-simplify-subject-functions subject))
1513    ((null gnus-summary-gather-subject-limit)
1514     (gnus-simplify-subject-re subject))
1515    ((eq gnus-summary-gather-subject-limit 'fuzzy)
1516     (gnus-simplify-subject-fuzzy subject))
1517    ((numberp gnus-summary-gather-subject-limit)
1518     (gnus-limit-string (gnus-simplify-subject-re subject)
1519                        gnus-summary-gather-subject-limit))
1520    (t
1521     subject)))
1522
1523 (defsubst gnus-subject-equal (s1 s2 &optional simple-first)
1524   "Check whether two subjects are equal.
1525 If optional argument SIMPLE-FIRST is t, first argument is already
1526 simplified."
1527   (cond
1528    ((null simple-first)
1529     (equal (gnus-simplify-subject-fully s1)
1530            (gnus-simplify-subject-fully s2)))
1531    (t
1532     (equal s1
1533            (gnus-simplify-subject-fully s2)))))
1534
1535 (defun gnus-summary-bubble-group ()
1536   "Increase the score of the current group.
1537 This is a handy function to add to `gnus-summary-exit-hook' to
1538 increase the score of each group you read."
1539   (gnus-group-add-score gnus-newsgroup-name))
1540
1541 \f
1542 ;;;
1543 ;;; Gnus summary mode
1544 ;;;
1545
1546 (put 'gnus-summary-mode 'mode-class 'special)
1547
1548 (defvar gnus-article-commands-menu)
1549
1550 ;; Non-orthogonal keys
1551
1552 (gnus-define-keys gnus-summary-mode-map
1553   " " gnus-summary-next-page
1554   "\177" gnus-summary-prev-page
1555   [delete] gnus-summary-prev-page
1556   [backspace] gnus-summary-prev-page
1557   "\r" gnus-summary-scroll-up
1558   "\M-\r" gnus-summary-scroll-down
1559   "n" gnus-summary-next-unread-article
1560   "p" gnus-summary-prev-unread-article
1561   "N" gnus-summary-next-article
1562   "P" gnus-summary-prev-article
1563   "\M-\C-n" gnus-summary-next-same-subject
1564   "\M-\C-p" gnus-summary-prev-same-subject
1565   "\M-n" gnus-summary-next-unread-subject
1566   "\M-p" gnus-summary-prev-unread-subject
1567   "." gnus-summary-first-unread-article
1568   "," gnus-summary-best-unread-article
1569   "\M-s" gnus-summary-search-article-forward
1570   "\M-r" gnus-summary-search-article-backward
1571   "<" gnus-summary-beginning-of-article
1572   ">" gnus-summary-end-of-article
1573   "j" gnus-summary-goto-article
1574   "^" gnus-summary-refer-parent-article
1575   "\M-^" gnus-summary-refer-article
1576   "u" gnus-summary-tick-article-forward
1577   "!" gnus-summary-tick-article-forward
1578   "U" gnus-summary-tick-article-backward
1579   "d" gnus-summary-mark-as-read-forward
1580   "D" gnus-summary-mark-as-read-backward
1581   "E" gnus-summary-mark-as-expirable
1582   "\M-u" gnus-summary-clear-mark-forward
1583   "\M-U" gnus-summary-clear-mark-backward
1584   "k" gnus-summary-kill-same-subject-and-select
1585   "\C-k" gnus-summary-kill-same-subject
1586   "\M-\C-k" gnus-summary-kill-thread
1587   "\M-\C-l" gnus-summary-lower-thread
1588   "e" gnus-summary-edit-article
1589   "#" gnus-summary-mark-as-processable
1590   "\M-#" gnus-summary-unmark-as-processable
1591   "\M-\C-t" gnus-summary-toggle-threads
1592   "\M-\C-s" gnus-summary-show-thread
1593   "\M-\C-h" gnus-summary-hide-thread
1594   "\M-\C-f" gnus-summary-next-thread
1595   "\M-\C-b" gnus-summary-prev-thread
1596   [(meta down)] gnus-summary-next-thread
1597   [(meta up)] gnus-summary-prev-thread
1598   "\M-\C-u" gnus-summary-up-thread
1599   "\M-\C-d" gnus-summary-down-thread
1600   "&" gnus-summary-execute-command
1601   "c" gnus-summary-catchup-and-exit
1602   "\C-w" gnus-summary-mark-region-as-read
1603   "\C-t" gnus-summary-toggle-truncation
1604   "?" gnus-summary-mark-as-dormant
1605   "\C-c\M-\C-s" gnus-summary-limit-include-expunged
1606   "\C-c\C-s\C-n" gnus-summary-sort-by-number
1607   "\C-c\C-s\C-l" gnus-summary-sort-by-lines
1608   "\C-c\C-s\C-c" gnus-summary-sort-by-chars
1609   "\C-c\C-s\C-a" gnus-summary-sort-by-author
1610   "\C-c\C-s\C-s" gnus-summary-sort-by-subject
1611   "\C-c\C-s\C-d" gnus-summary-sort-by-date
1612   "\C-c\C-s\C-i" gnus-summary-sort-by-score
1613   "\C-c\C-s\C-o" gnus-summary-sort-by-original
1614   "\C-c\C-s\C-r" gnus-summary-sort-by-random
1615   "=" gnus-summary-expand-window
1616   "\C-x\C-s" gnus-summary-reselect-current-group
1617   "\M-g" gnus-summary-rescan-group
1618   "w" gnus-summary-stop-page-breaking
1619   "\C-c\C-r" gnus-summary-caesar-message
1620   "f" gnus-summary-followup
1621   "F" gnus-summary-followup-with-original
1622   "C" gnus-summary-cancel-article
1623   "r" gnus-summary-reply
1624   "R" gnus-summary-reply-with-original
1625   "\C-c\C-f" gnus-summary-mail-forward
1626   "o" gnus-summary-save-article
1627   "\C-o" gnus-summary-save-article-mail
1628   "|" gnus-summary-pipe-output
1629   "\M-k" gnus-summary-edit-local-kill
1630   "\M-K" gnus-summary-edit-global-kill
1631   ;; "V" gnus-version
1632   "\C-c\C-d" gnus-summary-describe-group
1633   "q" gnus-summary-exit
1634   "Q" gnus-summary-exit-no-update
1635   "\C-c\C-i" gnus-info-find-node
1636   gnus-mouse-2 gnus-mouse-pick-article
1637   "m" gnus-summary-mail-other-window
1638   "a" gnus-summary-post-news
1639   "i" gnus-summary-news-other-window
1640   "x" gnus-summary-limit-to-unread
1641   "s" gnus-summary-isearch-article
1642   "t" gnus-summary-toggle-header
1643   "g" gnus-summary-show-article
1644   "l" gnus-summary-goto-last-article
1645   "\C-c\C-v\C-v" gnus-uu-decode-uu-view
1646   "\C-d" gnus-summary-enter-digest-group
1647   "\M-\C-d" gnus-summary-read-document
1648   "\M-\C-e" gnus-summary-edit-parameters
1649   "\M-\C-a" gnus-summary-customize-parameters
1650   "\C-c\C-b" gnus-bug
1651   "*" gnus-cache-enter-article
1652   "\M-*" gnus-cache-remove-article
1653   "\M-&" gnus-summary-universal-argument
1654   "\C-l" gnus-recenter
1655   "I" gnus-summary-increase-score
1656   "L" gnus-summary-lower-score
1657   "\M-i" gnus-symbolic-argument
1658   "h" gnus-summary-select-article-buffer
1659
1660   "b" gnus-article-view-part
1661   "\M-t" gnus-summary-toggle-display-buttonized
1662
1663   "V" gnus-summary-score-map
1664   "X" gnus-uu-extract-map
1665   "S" gnus-summary-send-map)
1666
1667 ;; Sort of orthogonal keymap
1668 (gnus-define-keys (gnus-summary-mark-map "M" gnus-summary-mode-map)
1669   "t" gnus-summary-tick-article-forward
1670   "!" gnus-summary-tick-article-forward
1671   "d" gnus-summary-mark-as-read-forward
1672   "r" gnus-summary-mark-as-read-forward
1673   "c" gnus-summary-clear-mark-forward
1674   " " gnus-summary-clear-mark-forward
1675   "e" gnus-summary-mark-as-expirable
1676   "x" gnus-summary-mark-as-expirable
1677   "?" gnus-summary-mark-as-dormant
1678   "b" gnus-summary-set-bookmark
1679   "B" gnus-summary-remove-bookmark
1680   "#" gnus-summary-mark-as-processable
1681   "\M-#" gnus-summary-unmark-as-processable
1682   "S" gnus-summary-limit-include-expunged
1683   "C" gnus-summary-catchup
1684   "H" gnus-summary-catchup-to-here
1685   "h" gnus-summary-catchup-from-here
1686   "\C-c" gnus-summary-catchup-all
1687   "k" gnus-summary-kill-same-subject-and-select
1688   "K" gnus-summary-kill-same-subject
1689   "P" gnus-uu-mark-map)
1690
1691 (gnus-define-keys (gnus-summary-mscore-map "V" gnus-summary-mark-map)
1692   "c" gnus-summary-clear-above
1693   "u" gnus-summary-tick-above
1694   "m" gnus-summary-mark-above
1695   "k" gnus-summary-kill-below)
1696
1697 (gnus-define-keys (gnus-summary-limit-map "/" gnus-summary-mode-map)
1698   "/" gnus-summary-limit-to-subject
1699   "n" gnus-summary-limit-to-articles
1700   "w" gnus-summary-pop-limit
1701   "s" gnus-summary-limit-to-subject
1702   "a" gnus-summary-limit-to-author
1703   "u" gnus-summary-limit-to-unread
1704   "m" gnus-summary-limit-to-marks
1705   "M" gnus-summary-limit-exclude-marks
1706   "v" gnus-summary-limit-to-score
1707   "*" gnus-summary-limit-include-cached
1708   "D" gnus-summary-limit-include-dormant
1709   "T" gnus-summary-limit-include-thread
1710   "d" gnus-summary-limit-exclude-dormant
1711   "t" gnus-summary-limit-to-age
1712   "." gnus-summary-limit-to-unseen
1713   "x" gnus-summary-limit-to-extra
1714   "p" gnus-summary-limit-to-display-predicate
1715   "E" gnus-summary-limit-include-expunged
1716   "c" gnus-summary-limit-exclude-childless-dormant
1717   "C" gnus-summary-limit-mark-excluded-as-read
1718   "o" gnus-summary-insert-old-articles
1719   "N" gnus-summary-insert-new-articles)
1720
1721 (gnus-define-keys (gnus-summary-goto-map "G" gnus-summary-mode-map)
1722   "n" gnus-summary-next-unread-article
1723   "p" gnus-summary-prev-unread-article
1724   "N" gnus-summary-next-article
1725   "P" gnus-summary-prev-article
1726   "\C-n" gnus-summary-next-same-subject
1727   "\C-p" gnus-summary-prev-same-subject
1728   "\M-n" gnus-summary-next-unread-subject
1729   "\M-p" gnus-summary-prev-unread-subject
1730   "f" gnus-summary-first-unread-article
1731   "b" gnus-summary-best-unread-article
1732   "j" gnus-summary-goto-article
1733   "g" gnus-summary-goto-subject
1734   "l" gnus-summary-goto-last-article
1735   "o" gnus-summary-pop-article)
1736
1737 (gnus-define-keys (gnus-summary-thread-map "T" gnus-summary-mode-map)
1738   "k" gnus-summary-kill-thread
1739   "l" gnus-summary-lower-thread
1740   "i" gnus-summary-raise-thread
1741   "T" gnus-summary-toggle-threads
1742   "t" gnus-summary-rethread-current
1743   "^" gnus-summary-reparent-thread
1744   "s" gnus-summary-show-thread
1745   "S" gnus-summary-show-all-threads
1746   "h" gnus-summary-hide-thread
1747   "H" gnus-summary-hide-all-threads
1748   "n" gnus-summary-next-thread
1749   "p" gnus-summary-prev-thread
1750   "u" gnus-summary-up-thread
1751   "o" gnus-summary-top-thread
1752   "d" gnus-summary-down-thread
1753   "#" gnus-uu-mark-thread
1754   "\M-#" gnus-uu-unmark-thread)
1755
1756 (gnus-define-keys (gnus-summary-buffer-map "Y" gnus-summary-mode-map)
1757   "g" gnus-summary-prepare
1758   "c" gnus-summary-insert-cached-articles
1759   "d" gnus-summary-insert-dormant-articles)
1760
1761 (gnus-define-keys (gnus-summary-exit-map "Z" gnus-summary-mode-map)
1762   "c" gnus-summary-catchup-and-exit
1763   "C" gnus-summary-catchup-all-and-exit
1764   "E" gnus-summary-exit-no-update
1765   "Q" gnus-summary-exit
1766   "Z" gnus-summary-exit
1767   "n" gnus-summary-catchup-and-goto-next-group
1768   "R" gnus-summary-reselect-current-group
1769   "G" gnus-summary-rescan-group
1770   "N" gnus-summary-next-group
1771   "s" gnus-summary-save-newsrc
1772   "P" gnus-summary-prev-group)
1773
1774 (gnus-define-keys (gnus-summary-article-map "A" gnus-summary-mode-map)
1775   " " gnus-summary-next-page
1776   "n" gnus-summary-next-page
1777   "\177" gnus-summary-prev-page
1778   [delete] gnus-summary-prev-page
1779   "p" gnus-summary-prev-page
1780   "\r" gnus-summary-scroll-up
1781   "\M-\r" gnus-summary-scroll-down
1782   "<" gnus-summary-beginning-of-article
1783   ">" gnus-summary-end-of-article
1784   "b" gnus-summary-beginning-of-article
1785   "e" gnus-summary-end-of-article
1786   "^" gnus-summary-refer-parent-article
1787   "r" gnus-summary-refer-parent-article
1788   "D" gnus-summary-enter-digest-group
1789   "R" gnus-summary-refer-references
1790   "T" gnus-summary-refer-thread
1791   "g" gnus-summary-show-article
1792   "s" gnus-summary-isearch-article
1793   "P" gnus-summary-print-article
1794   "M" gnus-mailing-list-insinuate
1795   "t" gnus-article-babel)
1796
1797 (gnus-define-keys (gnus-summary-wash-map "W" gnus-summary-mode-map)
1798   "b" gnus-article-add-buttons
1799   "B" gnus-article-add-buttons-to-head
1800   "o" gnus-article-treat-overstrike
1801   "e" gnus-article-emphasize
1802   "w" gnus-article-fill-cited-article
1803   "Q" gnus-article-fill-long-lines
1804   "C" gnus-article-capitalize-sentences
1805   "c" gnus-article-remove-cr
1806   "q" gnus-article-de-quoted-unreadable
1807   "6" gnus-article-de-base64-unreadable
1808   "Z" gnus-article-decode-HZ
1809   "h" gnus-article-wash-html
1810   "u" gnus-article-unsplit-urls
1811   "s" gnus-summary-force-verify-and-decrypt
1812   "f" gnus-article-display-x-face
1813   "l" gnus-summary-stop-page-breaking
1814   "r" gnus-summary-caesar-message
1815   "m" gnus-summary-morse-message
1816   "t" gnus-summary-toggle-header
1817   "g" gnus-treat-smiley
1818   "v" gnus-summary-verbose-headers
1819   "a" gnus-article-strip-headers-in-body ;; mnemonic: wash archive
1820   "p" gnus-article-verify-x-pgp-sig
1821   "d" gnus-article-treat-dumbquotes)
1822
1823 (gnus-define-keys (gnus-summary-wash-deuglify-map "Y" gnus-summary-wash-map)
1824   ;; mnemonic: deuglif*Y*
1825   "u" gnus-article-outlook-unwrap-lines
1826   "a" gnus-article-outlook-repair-attribution
1827   "c" gnus-article-outlook-rearrange-citation
1828   "f" gnus-article-outlook-deuglify-article) ;; mnemonic: full deuglify
1829
1830 (gnus-define-keys (gnus-summary-wash-hide-map "W" gnus-summary-wash-map)
1831   "a" gnus-article-hide
1832   "h" gnus-article-hide-headers
1833   "b" gnus-article-hide-boring-headers
1834   "s" gnus-article-hide-signature
1835   "c" gnus-article-hide-citation
1836   "C" gnus-article-hide-citation-in-followups
1837   "l" gnus-article-hide-list-identifiers
1838   "B" gnus-article-strip-banner
1839   "P" gnus-article-hide-pem
1840   "\C-c" gnus-article-hide-citation-maybe)
1841
1842 (gnus-define-keys (gnus-summary-wash-highlight-map "H" gnus-summary-wash-map)
1843   "a" gnus-article-highlight
1844   "h" gnus-article-highlight-headers
1845   "c" gnus-article-highlight-citation
1846   "s" gnus-article-highlight-signature)
1847
1848 (gnus-define-keys (gnus-summary-wash-header-map "G" gnus-summary-wash-map)
1849   "f" gnus-article-treat-fold-headers
1850   "u" gnus-article-treat-unfold-headers
1851   "n" gnus-article-treat-fold-newsgroups)
1852
1853 (gnus-define-keys (gnus-summary-wash-display-map "D" gnus-summary-wash-map)
1854   "x" gnus-article-display-x-face
1855   "d" gnus-article-display-face
1856   "s" gnus-treat-smiley
1857   "D" gnus-article-remove-images
1858   "f" gnus-treat-from-picon
1859   "m" gnus-treat-mail-picon
1860   "n" gnus-treat-newsgroups-picon)
1861
1862 (gnus-define-keys (gnus-summary-wash-mime-map "M" gnus-summary-wash-map)
1863   "w" gnus-article-decode-mime-words
1864   "c" gnus-article-decode-charset
1865   "v" gnus-mime-view-all-parts
1866   "b" gnus-article-view-part)
1867
1868 (gnus-define-keys (gnus-summary-wash-time-map "T" gnus-summary-wash-map)
1869   "z" gnus-article-date-ut
1870   "u" gnus-article-date-ut
1871   "l" gnus-article-date-local
1872   "p" gnus-article-date-english
1873   "e" gnus-article-date-lapsed
1874   "o" gnus-article-date-original
1875   "i" gnus-article-date-iso8601
1876   "s" gnus-article-date-user)
1877
1878 (gnus-define-keys (gnus-summary-wash-empty-map "E" gnus-summary-wash-map)
1879   "t" gnus-article-remove-trailing-blank-lines
1880   "l" gnus-article-strip-leading-blank-lines
1881   "m" gnus-article-strip-multiple-blank-lines
1882   "a" gnus-article-strip-blank-lines
1883   "A" gnus-article-strip-all-blank-lines
1884   "s" gnus-article-strip-leading-space
1885   "e" gnus-article-strip-trailing-space
1886   "w" gnus-article-remove-leading-whitespace)
1887
1888 (gnus-define-keys (gnus-summary-help-map "H" gnus-summary-mode-map)
1889   "v" gnus-version
1890   "f" gnus-summary-fetch-faq
1891   "d" gnus-summary-describe-group
1892   "h" gnus-summary-describe-briefly
1893   "i" gnus-info-find-node
1894   "c" gnus-group-fetch-charter
1895   "C" gnus-group-fetch-control)
1896
1897 (gnus-define-keys (gnus-summary-backend-map "B" gnus-summary-mode-map)
1898   "e" gnus-summary-expire-articles
1899   "\M-\C-e" gnus-summary-expire-articles-now
1900   "\177" gnus-summary-delete-article
1901   [delete] gnus-summary-delete-article
1902   [backspace] gnus-summary-delete-article
1903   "m" gnus-summary-move-article
1904   "r" gnus-summary-respool-article
1905   "w" gnus-summary-edit-article
1906   "c" gnus-summary-copy-article
1907   "B" gnus-summary-crosspost-article
1908   "q" gnus-summary-respool-query
1909   "t" gnus-summary-respool-trace
1910   "i" gnus-summary-import-article
1911   "I" gnus-summary-create-article
1912   "p" gnus-summary-article-posted-p)
1913
1914 (gnus-define-keys (gnus-summary-save-map "O" gnus-summary-mode-map)
1915   "o" gnus-summary-save-article
1916   "m" gnus-summary-save-article-mail
1917   "F" gnus-summary-write-article-file
1918   "r" gnus-summary-save-article-rmail
1919   "f" gnus-summary-save-article-file
1920   "b" gnus-summary-save-article-body-file
1921   "h" gnus-summary-save-article-folder
1922   "v" gnus-summary-save-article-vm
1923   "p" gnus-summary-pipe-output
1924   "P" gnus-summary-muttprint
1925   "s" gnus-soup-add-article)
1926
1927 (gnus-define-keys (gnus-summary-mime-map "K" gnus-summary-mode-map)
1928   "b" gnus-summary-display-buttonized
1929   "m" gnus-summary-repair-multipart
1930   "v" gnus-article-view-part
1931   "o" gnus-article-save-part
1932   "c" gnus-article-copy-part
1933   "C" gnus-article-view-part-as-charset
1934   "e" gnus-article-view-part-externally
1935   "E" gnus-article-encrypt-body
1936   "i" gnus-article-inline-part
1937   "|" gnus-article-pipe-part)
1938
1939 (gnus-define-keys (gnus-uu-mark-map "P" gnus-summary-mark-map)
1940   "p" gnus-summary-mark-as-processable
1941   "u" gnus-summary-unmark-as-processable
1942   "U" gnus-summary-unmark-all-processable
1943   "v" gnus-uu-mark-over
1944   "s" gnus-uu-mark-series
1945   "r" gnus-uu-mark-region
1946   "g" gnus-uu-unmark-region
1947   "R" gnus-uu-mark-by-regexp
1948   "G" gnus-uu-unmark-by-regexp
1949   "t" gnus-uu-mark-thread
1950   "T" gnus-uu-unmark-thread
1951   "a" gnus-uu-mark-all
1952   "b" gnus-uu-mark-buffer
1953   "S" gnus-uu-mark-sparse
1954   "k" gnus-summary-kill-process-mark
1955   "y" gnus-summary-yank-process-mark
1956   "w" gnus-summary-save-process-mark
1957   "i" gnus-uu-invert-processable)
1958
1959 (gnus-define-keys (gnus-uu-extract-map "X" gnus-summary-mode-map)
1960   ;;"x" gnus-uu-extract-any
1961   "m" gnus-summary-save-parts
1962   "u" gnus-uu-decode-uu
1963   "U" gnus-uu-decode-uu-and-save
1964   "s" gnus-uu-decode-unshar
1965   "S" gnus-uu-decode-unshar-and-save
1966   "o" gnus-uu-decode-save
1967   "O" gnus-uu-decode-save
1968   "b" gnus-uu-decode-binhex
1969   "B" gnus-uu-decode-binhex
1970   "p" gnus-uu-decode-postscript
1971   "P" gnus-uu-decode-postscript-and-save)
1972
1973 (gnus-define-keys
1974     (gnus-uu-extract-view-map "v" gnus-uu-extract-map)
1975   "u" gnus-uu-decode-uu-view
1976   "U" gnus-uu-decode-uu-and-save-view
1977   "s" gnus-uu-decode-unshar-view
1978   "S" gnus-uu-decode-unshar-and-save-view
1979   "o" gnus-uu-decode-save-view
1980   "O" gnus-uu-decode-save-view
1981   "b" gnus-uu-decode-binhex-view
1982   "B" gnus-uu-decode-binhex-view
1983   "p" gnus-uu-decode-postscript-view
1984   "P" gnus-uu-decode-postscript-and-save-view)
1985
1986 (defvar gnus-article-post-menu nil)
1987
1988 (defconst gnus-summary-menu-maxlen 20)
1989
1990 (defun gnus-summary-menu-split (menu)
1991   ;; If we have lots of elements, divide them into groups of 20
1992   ;; and make a pane (or submenu) for each one.
1993   (if (> (length menu) (/ (* gnus-summary-menu-maxlen 3) 2))
1994       (let ((menu menu) sublists next
1995             (i 1))
1996         (while menu
1997           ;; Pull off the next gnus-summary-menu-maxlen elements
1998           ;; and make them the next element of sublist.
1999           (setq next (nthcdr gnus-summary-menu-maxlen menu))
2000           (if next
2001               (setcdr (nthcdr (1- gnus-summary-menu-maxlen) menu)
2002                       nil))
2003           (setq sublists (cons (cons (format "%s ... %s" (aref (car menu) 0)
2004                                              (aref (car (last menu)) 0)) menu)
2005                                sublists))
2006           (setq i (1+ i))
2007           (setq menu next))
2008         (nreverse sublists))
2009     ;; Few elements--put them all in one pane.
2010     menu))
2011
2012 (defun gnus-summary-make-menu-bar ()
2013   (gnus-turn-off-edit-menu 'summary)
2014
2015   (unless (boundp 'gnus-summary-misc-menu)
2016
2017     (easy-menu-define
2018       gnus-summary-kill-menu gnus-summary-mode-map ""
2019       (cons
2020        "Score"
2021        (nconc
2022         (list
2023          ["Customize" gnus-score-customize t])
2024         (gnus-make-score-map 'increase)
2025         (gnus-make-score-map 'lower)
2026         '(("Mark"
2027            ["Kill below" gnus-summary-kill-below t]
2028            ["Mark above" gnus-summary-mark-above t]
2029            ["Tick above" gnus-summary-tick-above t]
2030            ["Clear above" gnus-summary-clear-above t])
2031           ["Current score" gnus-summary-current-score t]
2032           ["Set score" gnus-summary-set-score t]
2033           ["Switch current score file..." gnus-score-change-score-file t]
2034           ["Set mark below..." gnus-score-set-mark-below t]
2035           ["Set expunge below..." gnus-score-set-expunge-below t]
2036           ["Edit current score file" gnus-score-edit-current-scores t]
2037           ["Edit score file" gnus-score-edit-file t]
2038           ["Trace score" gnus-score-find-trace t]
2039           ["Find words" gnus-score-find-favourite-words t]
2040           ["Rescore buffer" gnus-summary-rescore t]
2041           ["Increase score..." gnus-summary-increase-score t]
2042           ["Lower score..." gnus-summary-lower-score t]))))
2043
2044     ;; Define both the Article menu in the summary buffer and the
2045     ;; equivalent Commands menu in the article buffer here for
2046     ;; consistency.
2047     (let ((innards
2048            `(("Hide"
2049               ["All" gnus-article-hide t]
2050               ["Headers" gnus-article-hide-headers t]
2051               ["Signature" gnus-article-hide-signature t]
2052               ["Citation" gnus-article-hide-citation t]
2053               ["List identifiers" gnus-article-hide-list-identifiers t]
2054               ["Banner" gnus-article-strip-banner t]
2055               ["Boring headers" gnus-article-hide-boring-headers t])
2056              ("Highlight"
2057               ["All" gnus-article-highlight t]
2058               ["Headers" gnus-article-highlight-headers t]
2059               ["Signature" gnus-article-highlight-signature t]
2060               ["Citation" gnus-article-highlight-citation t])
2061              ("MIME"
2062               ["Words" gnus-article-decode-mime-words t]
2063               ["Charset" gnus-article-decode-charset t]
2064               ["QP" gnus-article-de-quoted-unreadable t]
2065               ["Base64" gnus-article-de-base64-unreadable t]
2066               ["View MIME buttons" gnus-summary-display-buttonized t]
2067               ["View all" gnus-mime-view-all-parts t]
2068               ["Verify and Decrypt" gnus-summary-force-verify-and-decrypt t]
2069               ["Encrypt body" gnus-article-encrypt-body t]
2070               ["Extract all parts" gnus-summary-save-parts t]
2071               ("Multipart"
2072                ["Repair multipart" gnus-summary-repair-multipart t]
2073                ["Add buttons" gnus-summary-display-buttonized t]
2074                ["Pipe part" gnus-article-pipe-part t]
2075                ["Inline part" gnus-article-inline-part t]
2076                ["Encrypt body" gnus-article-encrypt-body t]
2077                ["View part externally" gnus-article-view-part-externally t]
2078                ["View part with charset" gnus-article-view-part-as-charset t]
2079                ["Copy part" gnus-article-copy-part t]
2080                ["Save part" gnus-article-save-part t]
2081                ["View part" gnus-article-view-part t]))
2082              ("Date"
2083               ["Local" gnus-article-date-local t]
2084               ["ISO8601" gnus-article-date-iso8601 t]
2085               ["UT" gnus-article-date-ut t]
2086               ["Original" gnus-article-date-original t]
2087               ["Lapsed" gnus-article-date-lapsed t]
2088               ["User-defined" gnus-article-date-user t])
2089              ("Display"
2090               ["Remove images" gnus-article-remove-images t]
2091               ["Toggle smiley" gnus-treat-smiley t]
2092               ["Show X-Face" gnus-article-display-x-face t]
2093               ["Show picons in From" gnus-treat-from-picon t]
2094               ["Show picons in mail headers" gnus-treat-mail-picon t]
2095               ["Show picons in news headers" gnus-treat-newsgroups-picon t]
2096               ("View as different encoding"
2097                ,@(gnus-summary-menu-split
2098                   (mapcar
2099                    (lambda (cs)
2100                      ;; Since easymenu under FSF Emacs doesn't allow lambda
2101                      ;; forms for menu commands, we should provide intern'ed
2102                      ;; function symbols.
2103                      (let ((command (intern (format "\
2104 gnus-summary-show-article-from-menu-as-charset-%s" cs))))
2105                        (fset command
2106                              `(lambda ()
2107                                 (interactive)
2108                                 (let ((gnus-summary-show-article-charset-alist
2109                                        '((1 . ,cs))))
2110                                   (gnus-summary-show-article 1))))
2111                        `[,(symbol-name cs) ,command t]))
2112                    (sort (if (fboundp 'coding-system-list)
2113                              (coding-system-list)
2114                            (mapcar 'car mm-mime-mule-charset-alist))
2115                          'string<)))))
2116              ("Washing"
2117               ("Remove Blanks"
2118                ["Leading" gnus-article-strip-leading-blank-lines t]
2119                ["Multiple" gnus-article-strip-multiple-blank-lines t]
2120                ["Trailing" gnus-article-remove-trailing-blank-lines t]
2121                ["All of the above" gnus-article-strip-blank-lines t]
2122                ["All" gnus-article-strip-all-blank-lines t]
2123                ["Leading space" gnus-article-strip-leading-space t]
2124                ["Trailing space" gnus-article-strip-trailing-space t]
2125                ["Leading space in headers"
2126                 gnus-article-remove-leading-whitespace t])
2127               ["Overstrike" gnus-article-treat-overstrike t]
2128               ["Dumb quotes" gnus-article-treat-dumbquotes t]
2129               ["Emphasis" gnus-article-emphasize t]
2130               ["Word wrap" gnus-article-fill-cited-article t]
2131               ["Fill long lines" gnus-article-fill-long-lines t]
2132               ["Capitalize sentences" gnus-article-capitalize-sentences t]
2133               ["CR" gnus-article-remove-cr t]
2134               ["Quoted-Printable" gnus-article-de-quoted-unreadable t]
2135               ["Base64" gnus-article-de-base64-unreadable t]
2136               ["Rot 13" gnus-summary-caesar-message
2137                ,@(if (featurep 'xemacs) '(t)
2138                    '(:help "\"Caesar rotate\" article by 13"))]
2139               ["Morse decode" gnus-summary-morse-message t]
2140               ["Unix pipe..." gnus-summary-pipe-message t]
2141               ["Add buttons" gnus-article-add-buttons t]
2142               ["Add buttons to head" gnus-article-add-buttons-to-head t]
2143               ["Stop page breaking" gnus-summary-stop-page-breaking t]
2144               ["Verbose header" gnus-summary-verbose-headers t]
2145               ["Toggle header" gnus-summary-toggle-header t]
2146               ["Unfold headers" gnus-article-treat-unfold-headers t]
2147               ["Fold newsgroups" gnus-article-treat-fold-newsgroups t]
2148               ["Html" gnus-article-wash-html t]
2149               ["URLs" gnus-article-unsplit-urls t]
2150               ["Verify X-PGP-Sig" gnus-article-verify-x-pgp-sig t]
2151               ["HZ" gnus-article-decode-HZ t]
2152               ("(Outlook) Deuglify"
2153                ["Unwrap lines" gnus-article-outlook-unwrap-lines t]
2154                ["Repair attribution" gnus-article-outlook-repair-attribution t]
2155                ["Rearrange citation" gnus-article-outlook-rearrange-citation t]
2156                ["Full (Outlook) deuglify"
2157                 gnus-article-outlook-deuglify-article t])
2158               )
2159              ("Output"
2160               ["Save in default format" gnus-summary-save-article
2161                ,@(if (featurep 'xemacs) '(t)
2162                    '(:help "Save article using default method"))]
2163               ["Save in file" gnus-summary-save-article-file
2164                ,@(if (featurep 'xemacs) '(t)
2165                    '(:help "Save article in file"))]
2166               ["Save in Unix mail format" gnus-summary-save-article-mail t]
2167               ["Save in MH folder" gnus-summary-save-article-folder t]
2168               ["Save in VM folder" gnus-summary-save-article-vm t]
2169               ["Save in RMAIL mbox" gnus-summary-save-article-rmail t]
2170               ["Save body in file" gnus-summary-save-article-body-file t]
2171               ["Pipe through a filter" gnus-summary-pipe-output t]
2172               ["Add to SOUP packet" gnus-soup-add-article t]
2173               ["Print with Muttprint" gnus-summary-muttprint t]
2174               ["Print" gnus-summary-print-article t])
2175              ("Backend"
2176               ["Respool article..." gnus-summary-respool-article t]
2177               ["Move article..." gnus-summary-move-article
2178                (gnus-check-backend-function
2179                 'request-move-article gnus-newsgroup-name)]
2180               ["Copy article..." gnus-summary-copy-article t]
2181               ["Crosspost article..." gnus-summary-crosspost-article
2182                (gnus-check-backend-function
2183                 'request-replace-article gnus-newsgroup-name)]
2184               ["Import file..." gnus-summary-import-article t]
2185               ["Create article..." gnus-summary-create-article t]
2186               ["Check if posted" gnus-summary-article-posted-p t]
2187               ["Edit article" gnus-summary-edit-article
2188                (not (gnus-group-read-only-p))]
2189               ["Delete article" gnus-summary-delete-article
2190                (gnus-check-backend-function
2191                 'request-expire-articles gnus-newsgroup-name)]
2192               ["Query respool" gnus-summary-respool-query t]
2193               ["Trace respool" gnus-summary-respool-trace t]
2194               ["Delete expirable articles" gnus-summary-expire-articles-now
2195                (gnus-check-backend-function
2196                 'request-expire-articles gnus-newsgroup-name)])
2197              ("Extract"
2198               ["Uudecode" gnus-uu-decode-uu
2199                ,@(if (featurep 'xemacs) '(t)
2200                    '(:help "Decode uuencoded article(s)"))]
2201               ["Uudecode and save" gnus-uu-decode-uu-and-save t]
2202               ["Unshar" gnus-uu-decode-unshar t]
2203               ["Unshar and save" gnus-uu-decode-unshar-and-save t]
2204               ["Save" gnus-uu-decode-save t]
2205               ["Binhex" gnus-uu-decode-binhex t]
2206               ["Postscript" gnus-uu-decode-postscript t]
2207               ["All MIME parts" gnus-summary-save-parts t])
2208              ("Cache"
2209               ["Enter article" gnus-cache-enter-article t]
2210               ["Remove article" gnus-cache-remove-article t])
2211              ["Translate" gnus-article-babel t]
2212              ["Select article buffer" gnus-summary-select-article-buffer t]
2213              ["Enter digest buffer" gnus-summary-enter-digest-group t]
2214              ["Isearch article..." gnus-summary-isearch-article t]
2215              ["Beginning of the article" gnus-summary-beginning-of-article t]
2216              ["End of the article" gnus-summary-end-of-article t]
2217              ["Fetch parent of article" gnus-summary-refer-parent-article t]
2218              ["Fetch referenced articles" gnus-summary-refer-references t]
2219              ["Fetch current thread" gnus-summary-refer-thread t]
2220              ["Fetch article with id..." gnus-summary-refer-article t]
2221              ["Setup Mailing List Params" gnus-mailing-list-insinuate t]
2222              ["Redisplay" gnus-summary-show-article t]
2223              ["Raw article" gnus-summary-show-raw-article :keys "C-u g"])))
2224       (easy-menu-define
2225         gnus-summary-article-menu gnus-summary-mode-map ""
2226         (cons "Article" innards))
2227
2228       (if (not (keymapp gnus-summary-article-menu))
2229           (easy-menu-define
2230             gnus-article-commands-menu gnus-article-mode-map ""
2231             (cons "Commands" innards))
2232         ;; in Emacs, don't share menu.
2233         (setq gnus-article-commands-menu
2234               (copy-keymap gnus-summary-article-menu))
2235         (define-key gnus-article-mode-map [menu-bar commands]
2236           (cons "Commands" gnus-article-commands-menu))))
2237
2238     (easy-menu-define
2239       gnus-summary-thread-menu gnus-summary-mode-map ""
2240       '("Threads"
2241         ["Find all messages in thread" gnus-summary-refer-thread t]
2242         ["Toggle threading" gnus-summary-toggle-threads t]
2243         ["Hide threads" gnus-summary-hide-all-threads t]
2244         ["Show threads" gnus-summary-show-all-threads t]
2245         ["Hide thread" gnus-summary-hide-thread t]
2246         ["Show thread" gnus-summary-show-thread t]
2247         ["Go to next thread" gnus-summary-next-thread t]
2248         ["Go to previous thread" gnus-summary-prev-thread t]
2249         ["Go down thread" gnus-summary-down-thread t]
2250         ["Go up thread" gnus-summary-up-thread t]
2251         ["Top of thread" gnus-summary-top-thread t]
2252         ["Mark thread as read" gnus-summary-kill-thread t]
2253         ["Lower thread score" gnus-summary-lower-thread t]
2254         ["Raise thread score" gnus-summary-raise-thread t]
2255         ["Rethread current" gnus-summary-rethread-current t]))
2256
2257     (easy-menu-define
2258       gnus-summary-post-menu gnus-summary-mode-map ""
2259       `("Post"
2260         ["Send a message (mail or news)" gnus-summary-post-news
2261          ,@(if (featurep 'xemacs) '(t)
2262              '(:help "Post an article"))]
2263         ["Followup" gnus-summary-followup
2264          ,@(if (featurep 'xemacs) '(t)
2265              '(:help "Post followup to this article"))]
2266         ["Followup and yank" gnus-summary-followup-with-original
2267          ,@(if (featurep 'xemacs) '(t)
2268              '(:help "Post followup to this article, quoting its contents"))]
2269         ["Supersede article" gnus-summary-supersede-article t]
2270         ["Cancel article" gnus-summary-cancel-article
2271          ,@(if (featurep 'xemacs) '(t)
2272              '(:help "Cancel an article you posted"))]
2273         ["Reply" gnus-summary-reply t]
2274         ["Reply and yank" gnus-summary-reply-with-original t]
2275         ["Wide reply" gnus-summary-wide-reply t]
2276         ["Wide reply and yank" gnus-summary-wide-reply-with-original
2277          ,@(if (featurep 'xemacs) '(t)
2278              '(:help "Mail a reply, quoting this article"))]
2279         ["Very wide reply" gnus-summary-very-wide-reply t]
2280         ["Very wide reply and yank" gnus-summary-very-wide-reply-with-original
2281          ,@(if (featurep 'xemacs) '(t)
2282              '(:help "Mail a very wide reply, quoting this article"))]
2283         ["Mail forward" gnus-summary-mail-forward t]
2284         ["Post forward" gnus-summary-post-forward t]
2285         ["Digest and mail" gnus-uu-digest-mail-forward t]
2286         ["Digest and post" gnus-uu-digest-post-forward t]
2287         ["Resend message" gnus-summary-resend-message t]
2288         ["Resend message edit" gnus-summary-resend-message-edit t]
2289         ["Send bounced mail" gnus-summary-resend-bounced-mail t]
2290         ["Send a mail" gnus-summary-mail-other-window t]
2291         ["Create a local message" gnus-summary-news-other-window t]
2292         ["Uuencode and post" gnus-uu-post-news
2293          ,@(if (featurep 'xemacs) '(t)
2294              '(:help "Post a uuencoded article"))]
2295         ["Followup via news" gnus-summary-followup-to-mail t]
2296         ["Followup via news and yank"