1 ;;; gnus-sum.el --- summary mode commands for Gnus
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006, 2007 Free Software Foundation, Inc.
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 ;; Boston, MA 02110-1301, USA.
32 (defvar tool-bar-mode))
45 (autoload 'gnus-summary-limit-include-cached "gnus-cache" nil t)
46 (autoload 'gnus-cache-write-active "gnus-cache")
47 (autoload 'gnus-mailing-list-insinuate "gnus-ml" nil t)
48 (autoload 'turn-on-gnus-mailing-list-mode "gnus-ml" nil t)
49 (autoload 'gnus-pick-line-number "gnus-salt" nil t)
50 (autoload 'mm-uu-dissect "mm-uu")
51 (autoload 'gnus-article-outlook-deuglify-article "deuglify"
52 "Deuglify broken Outlook (Express) articles and redisplay."
54 (autoload 'gnus-article-outlook-unwrap-lines "deuglify" nil t)
55 (autoload 'gnus-article-outlook-repair-attribution "deuglify" nil t)
56 (autoload 'gnus-article-outlook-rearrange-citation "deuglify" nil t)
58 (defcustom gnus-kill-summary-on-exit t
59 "*If non-nil, kill the summary buffer when you exit from it.
60 If nil, the summary will become a \"*Dead Summary*\" buffer, and
61 it will be killed sometime later."
62 :group 'gnus-summary-exit
65 (defcustom gnus-fetch-old-headers nil
66 "*Non-nil means that Gnus will try to build threads by grabbing old headers.
67 If an unread article in the group refers to an older, already
68 read (or just marked as read) article, the old article will not
69 normally be displayed in the Summary buffer. If this variable is
70 t, Gnus will attempt to grab the headers to the old articles, and
71 thereby build complete threads. If it has the value `some', all
72 old headers will be fetched but only enough headers to connect
73 otherwise loose threads will be displayed. This variable can
74 also be a number. In that case, no more than that number of old
75 headers will be fetched. If it has the value `invisible', all
76 old headers will be fetched, but none will be displayed.
78 The server has to support NOV for any of this to work.
80 This feature can seriously impact performance it ignores all
81 locally cached header entries."
83 :type '(choice (const :tag "off" nil)
88 (sexp :menu-tag "other" t)))
90 (defcustom gnus-refer-thread-limit 500
91 "*The number of old headers to fetch when doing \\<gnus-summary-mode-map>\\[gnus-summary-refer-thread].
92 If t, fetch all the available old headers."
95 (sexp :menu-tag "other" t)))
97 (defcustom gnus-summary-make-false-root 'adopt
98 "*nil means that Gnus won't gather loose threads.
99 If the root of a thread has expired or been read in a previous
100 session, the information necessary to build a complete thread has been
101 lost. Instead of having many small sub-threads from this original thread
102 scattered all over the summary buffer, Gnus can gather them.
104 If non-nil, Gnus will try to gather all loose sub-threads from an
105 original thread into one large thread.
107 If this variable is non-nil, it should be one of `none', `adopt',
110 If this variable is `none', Gnus will not make a false root, but just
111 present the sub-threads after another.
112 If this variable is `dummy', Gnus will create a dummy root that will
113 have all the sub-threads as children.
114 If this variable is `adopt', Gnus will make one of the \"children\"
115 the parent and mark all the step-children as such.
116 If this variable is `empty', the \"children\" are printed with empty
117 subject fields. (Or rather, they will be printed with a string
118 given by the `gnus-summary-same-subject' variable.)"
120 :type '(choice (const :tag "off" nil)
126 (defcustom gnus-summary-make-false-root-always nil
127 "Always make a false dummy root."
132 (defcustom gnus-summary-gather-exclude-subject "^ *$\\|^(none)$"
133 "*A regexp to match subjects to be excluded from loose thread gathering.
134 As loose thread gathering is done on subjects only, that means that
135 there can be many false gatherings performed. By rooting out certain
136 common subjects, gathering might become saner."
140 (defcustom gnus-summary-gather-subject-limit nil
141 "*Maximum length of subject comparisons when gathering loose threads.
142 Use nil to compare full subjects. Setting this variable to a low
143 number will help gather threads that have been corrupted by
144 newsreaders chopping off subject lines, but it might also mean that
145 unrelated articles that have subject that happen to begin with the
146 same few characters will be incorrectly gathered.
148 If this variable is `fuzzy', Gnus will use a fuzzy algorithm when
151 :type '(choice (const :tag "off" nil)
153 (sexp :menu-tag "on" t)))
155 (defcustom gnus-simplify-subject-functions nil
156 "List of functions taking a string argument that simplify subjects.
157 The functions are applied recursively.
159 Useful functions to put in this list include:
160 `gnus-simplify-subject-re', `gnus-simplify-subject-fuzzy',
161 `gnus-simplify-whitespace', and `gnus-simplify-all-whitespace'."
163 :type '(repeat function))
165 (defcustom gnus-simplify-ignored-prefixes nil
166 "*Remove matches for this regexp from subject lines when simplifying fuzzily."
168 :type '(choice (const :tag "off" nil)
171 (defcustom gnus-build-sparse-threads nil
172 "*If non-nil, fill in the gaps in threads.
173 If `some', only fill in the gaps that are needed to tie loose threads
174 together. If `more', fill in all leaf nodes that Gnus can find. If
175 non-nil and non-`some', fill in all gaps that Gnus manages to guess."
177 :type '(choice (const :tag "off" nil)
180 (sexp :menu-tag "all" t)))
182 (defcustom gnus-summary-thread-gathering-function
183 'gnus-gather-threads-by-subject
184 "*Function used for gathering loose threads.
185 There are two pre-defined functions: `gnus-gather-threads-by-subject',
186 which only takes Subjects into consideration; and
187 `gnus-gather-threads-by-references', which compared the References
188 headers of the articles to find matches."
190 :type '(radio (function-item gnus-gather-threads-by-subject)
191 (function-item gnus-gather-threads-by-references)
192 (function :tag "other")))
194 (defcustom gnus-summary-same-subject ""
195 "*String indicating that the current article has the same subject as the previous.
196 This variable will only be used if the value of
197 `gnus-summary-make-false-root' is `empty'."
198 :group 'gnus-summary-format
201 (defcustom gnus-summary-goto-unread t
202 "*If t, many commands will go to the next unread article.
203 This applies to marking commands as well as other commands that
204 \"naturally\" select the next article, like, for instance, `SPC' at
205 the end of an article.
207 If nil, the marking commands do NOT go to the next unread article
208 \(they go to the next article instead). If `never', commands that
209 usually go to the next unread article, will go to the next article,
210 whether it is read or not."
211 :group 'gnus-summary-marks
212 :link '(custom-manual "(gnus)Setting Marks")
213 :type '(choice (const :tag "off" nil)
215 (sexp :menu-tag "on" t)))
217 (defcustom gnus-summary-default-score 0
218 "*Default article score level.
219 All scores generated by the score files will be added to this score.
220 If this variable is nil, scoring will be disabled."
221 :group 'gnus-score-default
222 :type '(choice (const :tag "disable")
225 (defcustom gnus-summary-default-high-score 0
226 "*Default threshold for a high scored article.
227 An article will be highlighted as high scored if its score is greater
230 :group 'gnus-score-default
233 (defcustom gnus-summary-default-low-score 0
234 "*Default threshold for a low scored article.
235 An article will be highlighted as low scored if its score is smaller
238 :group 'gnus-score-default
241 (defcustom gnus-summary-zcore-fuzz 0
242 "*Fuzziness factor for the zcore in the summary buffer.
243 Articles with scores closer than this to `gnus-summary-default-score'
245 :group 'gnus-summary-format
248 (defcustom gnus-simplify-subject-fuzzy-regexp nil
249 "*Strings to be removed when doing fuzzy matches.
250 This can either be a regular expression or list of regular expressions
251 that will be removed from subject strings if fuzzy subject
252 simplification is selected."
254 :type '(repeat regexp))
256 (defcustom gnus-show-threads t
257 "*If non-nil, display threads in summary mode."
261 (defcustom gnus-thread-hide-subtree nil
262 "*If non-nil, hide all threads initially.
263 This can be a predicate specifier which says which threads to hide.
264 If threads are hidden, you have to run the command
265 `gnus-summary-show-thread' by hand or select an article."
267 :type '(radio (sexp :format "Non-nil\n"
268 :match (lambda (widget value)
269 (not (or (consp value) (functionp value))))
272 (sexp :tag "Predicate specifier")))
274 (defcustom gnus-thread-hide-killed t
275 "*If non-nil, hide killed threads automatically."
279 (defcustom gnus-thread-ignore-subject t
280 "*If non-nil, which is the default, ignore subjects and do all threading based on the Reference header.
281 If nil, articles that have different subjects from their parents will
282 start separate threads."
286 (defcustom gnus-thread-operation-ignore-subject t
287 "*If non-nil, subjects will be ignored when doing thread commands.
288 This affects commands like `gnus-summary-kill-thread' and
289 `gnus-summary-lower-thread'.
291 If this variable is nil, articles in the same thread with different
292 subjects will not be included in the operation in question. If this
293 variable is `fuzzy', only articles that have subjects that are fuzzily
294 equal will be included."
296 :type '(choice (const :tag "off" nil)
300 (defcustom gnus-thread-indent-level 4
301 "*Number that says how much each sub-thread should be indented."
305 (defcustom gnus-auto-extend-newsgroup t
306 "*If non-nil, extend newsgroup forward and backward when requested."
307 :group 'gnus-summary-choose
310 (defcustom gnus-auto-select-first t
311 "If non-nil, select an article on group entry.
312 An article is selected automatically when entering a group
313 e.g. with \\<gnus-group-mode-map>\\[gnus-group-read-group], or via `gnus-summary-next-page' or
314 `gnus-summary-catchup-and-goto-next-group'.
316 Which article is selected is controlled by the variable
317 `gnus-auto-select-subject'.
319 If you want to prevent automatic selection of articles in some
320 newsgroups, set the variable to nil in `gnus-select-group-hook'."
321 ;; Commands include...
322 ;; \\<gnus-group-mode-map>\\[gnus-group-read-group]
323 ;; \\<gnus-summary-mode-map>\\[gnus-summary-next-page]
324 ;; \\<gnus-summary-mode-map>\\[gnus-summary-catchup-and-goto-next-group]
325 :group 'gnus-group-select
326 :type '(choice (const :tag "none" nil)
327 (sexp :menu-tag "first" t)))
329 (defcustom gnus-auto-select-subject 'unread
330 "*Says what subject to place under point when entering a group.
332 This variable can either be the symbols `first' (place point on the
333 first subject), `unread' (place point on the subject line of the first
334 unread article), `best' (place point on the subject line of the
335 higest-scored article), `unseen' (place point on the subject line of
336 the first unseen article), `unseen-or-unread' (place point on the subject
337 line of the first unseen article or, if all article have been seen, on the
338 subject line of the first unread article), or a function to be called to
339 place point on some subject line."
341 :group 'gnus-group-select
342 :type '(choice (const best)
346 (const unseen-or-unread)))
348 (defcustom gnus-auto-select-next t
349 "*If non-nil, offer to go to the next group from the end of the previous.
350 If the value is t and the next newsgroup is empty, Gnus will exit
351 summary mode and go back to group mode. If the value is neither nil
352 nor t, Gnus will select the following unread newsgroup. In
353 particular, if the value is the symbol `quietly', the next unread
354 newsgroup will be selected without any confirmation, and if it is
355 `almost-quietly', the next group will be selected without any
356 confirmation if you are located on the last article in the group.
357 Finally, if this variable is `slightly-quietly', the `\\<gnus-summary-mode-map>\\[gnus-summary-catchup-and-goto-next-group]' command
358 will go to the next group without confirmation."
359 :group 'gnus-summary-maneuvering
360 :type '(choice (const :tag "off" nil)
362 (const almost-quietly)
363 (const slightly-quietly)
364 (sexp :menu-tag "on" t)))
366 (defcustom gnus-auto-select-same nil
367 "*If non-nil, select the next article with the same subject.
368 If there are no more articles with the same subject, go to
369 the first unread article."
370 :group 'gnus-summary-maneuvering
373 (defcustom gnus-auto-goto-ignores 'unfetched
374 "*Says how to handle unfetched articles when maneuvering.
376 This variable can either be the symbols nil (maneuver to any
377 article), `undownloaded' (maneuvering while unplugged ignores articles
378 that have not been fetched), `always-undownloaded' (maneuvering always
379 ignores articles that have not been fetched), `unfetched' (maneuvering
380 ignores articles whose headers have not been fetched).
382 NOTE: The list of unfetched articles will always be nil when plugged
383 and, when unplugged, a subset of the undownloaded article list."
385 :group 'gnus-summary-maneuvering
386 :type '(choice (const :tag "None" nil)
387 (const :tag "Undownloaded when unplugged" undownloaded)
388 (const :tag "Undownloaded" always-undownloaded)
389 (const :tag "Unfetched" unfetched)))
391 (defcustom gnus-summary-check-current nil
392 "*If non-nil, consider the current article when moving.
393 The \"unread\" movement commands will stay on the same line if the
394 current article is unread."
395 :group 'gnus-summary-maneuvering
398 (defcustom gnus-auto-center-summary 2
399 "*If non-nil, always center the current summary buffer.
400 In particular, if `vertical' do only vertical recentering. If non-nil
401 and non-`vertical', do both horizontal and vertical recentering."
402 :group 'gnus-summary-maneuvering
403 :type '(choice (const :tag "none" nil)
405 (integer :tag "height")
406 (sexp :menu-tag "both" t)))
408 (defvar gnus-auto-center-group t
409 "*If non-nil, always center the group buffer.")
411 (defcustom gnus-show-all-headers nil
412 "*If non-nil, don't hide any headers."
413 :group 'gnus-article-hiding
414 :group 'gnus-article-headers
417 (defcustom gnus-summary-ignore-duplicates nil
418 "*If non-nil, ignore articles with identical Message-ID headers."
422 (defcustom gnus-single-article-buffer t
423 "*If non-nil, display all articles in the same buffer.
424 If nil, each group will get its own article buffer."
425 :group 'gnus-article-various
428 (defcustom gnus-break-pages t
429 "*If non-nil, do page breaking on articles.
430 The page delimiter is specified by the `gnus-page-delimiter'
432 :group 'gnus-article-various
435 (defcustom gnus-move-split-methods nil
436 "*Variable used to suggest where articles are to be moved to.
437 It uses the same syntax as the `gnus-split-methods' variable.
438 However, whereas `gnus-split-methods' specifies file names as targets,
439 this variable specifies group names."
440 :group 'gnus-summary-mail
441 :type '(repeat (choice (list :value (fun) function)
442 (cons :value ("" "") regexp (repeat string))
445 (defcustom gnus-move-group-prefix-function 'gnus-group-real-prefix
446 "Function used to compute default prefix for article move/copy/etc prompts.
447 The function should take one argument, a group name, and return a
448 string with the suggested prefix."
449 :group 'gnus-summary-mail
452 ;; FIXME: Although the custom type is `character' for the following variables,
453 ;; using multibyte characters (Latin-1, UTF-8) doesn't work. -- rs
455 (defcustom gnus-unread-mark ? ;Whitespace
456 "*Mark used for unread articles."
457 :group 'gnus-summary-marks
460 (defcustom gnus-ticked-mark ?!
461 "*Mark used for ticked articles."
462 :group 'gnus-summary-marks
465 (defcustom gnus-dormant-mark ??
466 "*Mark used for dormant articles."
467 :group 'gnus-summary-marks
470 (defcustom gnus-del-mark ?r
471 "*Mark used for del'd articles."
472 :group 'gnus-summary-marks
475 (defcustom gnus-read-mark ?R
476 "*Mark used for read articles."
477 :group 'gnus-summary-marks
480 (defcustom gnus-expirable-mark ?E
481 "*Mark used for expirable articles."
482 :group 'gnus-summary-marks
485 (defcustom gnus-killed-mark ?K
486 "*Mark used for killed articles."
487 :group 'gnus-summary-marks
490 (defcustom gnus-spam-mark ?$
491 "*Mark used for spam articles."
493 :group 'gnus-summary-marks
496 (defcustom gnus-souped-mark ?F
497 "*Mark used for souped articles."
498 :group 'gnus-summary-marks
501 (defcustom gnus-kill-file-mark ?X
502 "*Mark used for articles killed by kill files."
503 :group 'gnus-summary-marks
506 (defcustom gnus-low-score-mark ?Y
507 "*Mark used for articles with a low score."
508 :group 'gnus-summary-marks
511 (defcustom gnus-catchup-mark ?C
512 "*Mark used for articles that are caught up."
513 :group 'gnus-summary-marks
516 (defcustom gnus-replied-mark ?A
517 "*Mark used for articles that have been replied to."
518 :group 'gnus-summary-marks
521 (defcustom gnus-forwarded-mark ?F
522 "*Mark used for articles that have been forwarded."
524 :group 'gnus-summary-marks
527 (defcustom gnus-recent-mark ?N
528 "*Mark used for articles that are recent."
530 :group 'gnus-summary-marks
533 (defcustom gnus-cached-mark ?*
534 "*Mark used for articles that are in the cache."
535 :group 'gnus-summary-marks
538 (defcustom gnus-saved-mark ?S
539 "*Mark used for articles that have been saved."
540 :group 'gnus-summary-marks
543 (defcustom gnus-unseen-mark ?.
544 "*Mark used for articles that haven't been seen."
546 :group 'gnus-summary-marks
549 (defcustom gnus-no-mark ? ;Whitespace
550 "*Mark used for articles that have no other secondary mark."
552 :group 'gnus-summary-marks
555 (defcustom gnus-ancient-mark ?O
556 "*Mark used for ancient articles."
557 :group 'gnus-summary-marks
560 (defcustom gnus-sparse-mark ?Q
561 "*Mark used for sparsely reffed articles."
562 :group 'gnus-summary-marks
565 (defcustom gnus-canceled-mark ?G
566 "*Mark used for canceled articles."
567 :group 'gnus-summary-marks
570 (defcustom gnus-duplicate-mark ?M
571 "*Mark used for duplicate articles."
572 :group 'gnus-summary-marks
575 (defcustom gnus-undownloaded-mark ?-
576 "*Mark used for articles that weren't downloaded."
578 :group 'gnus-summary-marks
581 (defcustom gnus-downloaded-mark ?+
582 "*Mark used for articles that were downloaded."
583 :group 'gnus-summary-marks
586 (defcustom gnus-downloadable-mark ?%
587 "*Mark used for articles that are to be downloaded."
588 :group 'gnus-summary-marks
591 (defcustom gnus-unsendable-mark ?=
592 "*Mark used for articles that won't be sent."
593 :group 'gnus-summary-marks
596 (defcustom gnus-score-over-mark ?+
597 "*Score mark used for articles with high scores."
598 :group 'gnus-summary-marks
601 (defcustom gnus-score-below-mark ?-
602 "*Score mark used for articles with low scores."
603 :group 'gnus-summary-marks
606 (defcustom gnus-empty-thread-mark ? ;Whitespace
607 "*There is no thread under the article."
608 :group 'gnus-summary-marks
611 (defcustom gnus-not-empty-thread-mark ?=
612 "*There is a thread under the article."
613 :group 'gnus-summary-marks
616 (defcustom gnus-view-pseudo-asynchronously nil
617 "*If non-nil, Gnus will view pseudo-articles asynchronously."
618 :group 'gnus-extract-view
621 (defcustom gnus-auto-expirable-marks
622 (list gnus-killed-mark gnus-del-mark gnus-catchup-mark
623 gnus-low-score-mark gnus-ancient-mark gnus-read-mark
624 gnus-souped-mark gnus-duplicate-mark)
625 "*The list of marks converted into expiration if a group is auto-expirable."
628 :type '(repeat character))
630 (defcustom gnus-inhibit-user-auto-expire t
631 "*If non-nil, user marking commands will not mark an article as expirable, even if the group has auto-expire turned on."
636 (defcustom gnus-view-pseudos nil
637 "*If `automatic', pseudo-articles will be viewed automatically.
638 If `not-confirm', pseudos will be viewed automatically, and the user
639 will not be asked to confirm the command."
640 :group 'gnus-extract-view
641 :type '(choice (const :tag "off" nil)
643 (const not-confirm)))
645 (defcustom gnus-view-pseudos-separately t
646 "*If non-nil, one pseudo-article will be created for each file to be viewed.
647 If nil, all files that use the same viewing command will be given as a
648 list of parameters to that command."
649 :group 'gnus-extract-view
652 (defcustom gnus-insert-pseudo-articles t
653 "*If non-nil, insert pseudo-articles when decoding articles."
654 :group 'gnus-extract-view
657 (defcustom gnus-summary-dummy-line-format
659 "*The format specification for the dummy roots in the summary buffer.
660 It works along the same lines as a normal formatting string,
661 with some simple extensions.
665 General format specifiers can also be used.
666 See `(gnus)Formatting Variables'."
667 :link '(custom-manual "(gnus)Formatting Variables")
668 :group 'gnus-threading
671 (defcustom gnus-summary-mode-line-format "Gnus: %g [%A] %Z"
672 "*The format specification for the summary mode line.
673 It works along the same lines as a normal formatting string,
674 with some simple extensions:
677 %p Unprefixed group name
678 %A Current article number
679 %z Current article score
681 %U Number of unread articles in the group
682 %e Number of unselected articles in the group
683 %Z A string with unread/unselected article counts
684 %g Shortish group name
685 %S Subject of the current article
687 %s Current score file name
688 %d Number of dormant articles
689 %r Number of articles that have been marked as read in this session
690 %E Number of articles expunged by the score files"
691 :group 'gnus-summary-format
694 (defcustom gnus-list-identifiers nil
695 "Regexp that matches list identifiers to be removed from subject.
696 This can also be a list of regexps."
698 :group 'gnus-summary-format
699 :group 'gnus-article-hiding
700 :type '(choice (const :tag "none" nil)
702 (repeat :value (".*") regexp)))
704 (defcustom gnus-summary-mark-below 0
705 "*Mark all articles with a score below this variable as read.
706 This variable is local to each summary buffer and usually set by the
708 :group 'gnus-score-default
711 (defun gnus-widget-reversible-match (widget value)
712 "Ignoring WIDGET, convert VALUE to internal form.
713 VALUE should have the form `FOO' or `(not FOO)', where FOO is an symbol."
717 (eq (length value) 2)
718 (eq (nth 0 value) 'not)
719 (symbolp (nth 1 value)))))
721 (defun gnus-widget-reversible-to-internal (widget value)
722 "Ignoring WIDGET, convert VALUE to internal form.
723 VALUE should have the form `FOO' or `(not FOO)', where FOO is an atom.
724 FOO is converted to (FOO nil) and (not FOO) is converted to (FOO t)."
728 (list (nth 1 value) t)))
730 (defun gnus-widget-reversible-to-external (widget value)
731 "Ignoring WIDGET, convert VALUE to external form.
732 VALUE should have the form `(FOO nil)' or `(FOO t)', where FOO is an atom.
733 \(FOO nil) is converted to FOO and (FOO t) is converted to (not FOO)."
736 (list 'not (nth 0 value))
739 (define-widget 'gnus-widget-reversible 'group
740 "A `group' that convert values."
741 :match 'gnus-widget-reversible-match
742 :value-to-internal 'gnus-widget-reversible-to-internal
743 :value-to-external 'gnus-widget-reversible-to-external)
745 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number)
746 "*List of functions used for sorting articles in the summary buffer.
748 Each function takes two articles and returns non-nil if the first
749 article should be sorted before the other. If you use more than one
750 function, the primary sort function should be the last. You should
751 probably always include `gnus-article-sort-by-number' in the list of
752 sorting functions -- preferably first. Also note that sorting by date
753 is often much slower than sorting by number, and the sorting order is
754 very similar. (Sorting by date means sorting by the time the message
755 was sent, sorting by number means sorting by arrival time.)
757 Each item can also be a list `(not F)' where F is a function;
758 this reverses the sort order.
760 Ready-made functions include `gnus-article-sort-by-number',
761 `gnus-article-sort-by-author', `gnus-article-sort-by-subject',
762 `gnus-article-sort-by-date', `gnus-article-sort-by-random'
763 and `gnus-article-sort-by-score'.
765 When threading is turned on, the variable `gnus-thread-sort-functions'
766 controls how articles are sorted."
767 :group 'gnus-summary-sort
768 :type '(repeat (gnus-widget-reversible
769 (choice (function-item gnus-article-sort-by-number)
770 (function-item gnus-article-sort-by-author)
771 (function-item gnus-article-sort-by-subject)
772 (function-item gnus-article-sort-by-date)
773 (function-item gnus-article-sort-by-score)
774 (function-item gnus-article-sort-by-random)
775 (function :tag "other"))
776 (boolean :tag "Reverse order"))))
779 (defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number)
780 "*List of functions used for sorting threads in the summary buffer.
781 By default, threads are sorted by article number.
783 Each function takes two threads and returns non-nil if the first
784 thread should be sorted before the other. If you use more than one
785 function, the primary sort function should be the last. You should
786 probably always include `gnus-thread-sort-by-number' in the list of
787 sorting functions -- preferably first. Also note that sorting by date
788 is often much slower than sorting by number, and the sorting order is
789 very similar. (Sorting by date means sorting by the time the message
790 was sent, sorting by number means sorting by arrival time.)
792 Each list item can also be a list `(not F)' where F is a
793 function; this specifies reversed sort order.
795 Ready-made functions include `gnus-thread-sort-by-number',
796 `gnus-thread-sort-by-author', `gnus-thread-sort-by-recipient'
797 `gnus-thread-sort-by-subject', `gnus-thread-sort-by-date',
798 `gnus-thread-sort-by-score', `gnus-thread-sort-by-most-recent-number',
799 `gnus-thread-sort-by-most-recent-date', `gnus-thread-sort-by-random',
800 and `gnus-thread-sort-by-total-score' (see
801 `gnus-thread-score-function').
803 When threading is turned off, the variable
804 `gnus-article-sort-functions' controls how articles are sorted."
805 :group 'gnus-summary-sort
807 (gnus-widget-reversible
808 (choice (function-item gnus-thread-sort-by-number)
809 (function-item gnus-thread-sort-by-author)
810 (function-item gnus-thread-sort-by-recipient)
811 (function-item gnus-thread-sort-by-subject)
812 (function-item gnus-thread-sort-by-date)
813 (function-item gnus-thread-sort-by-score)
814 (function-item gnus-thread-sort-by-most-recent-number)
815 (function-item gnus-thread-sort-by-most-recent-date)
816 (function-item gnus-thread-sort-by-random)
817 (function-item gnus-thread-sort-by-total-score)
818 (function :tag "other"))
819 (boolean :tag "Reverse order"))))
821 (defcustom gnus-thread-score-function '+
822 "*Function used for calculating the total score of a thread.
824 The function is called with the scores of the article and each
825 subthread and should then return the score of the thread.
827 Some functions you can use are `+', `max', or `min'."
828 :group 'gnus-summary-sort
831 (defcustom gnus-summary-expunge-below nil
832 "All articles that have a score less than this variable will be expunged.
833 This variable is local to the summary buffers."
834 :group 'gnus-score-default
835 :type '(choice (const :tag "off" nil)
838 (defcustom gnus-thread-expunge-below nil
839 "All threads that have a total score less than this variable will be expunged.
840 See `gnus-thread-score-function' for en explanation of what a
843 This variable is local to the summary buffers."
844 :group 'gnus-threading
845 :group 'gnus-score-default
846 :type '(choice (const :tag "off" nil)
849 (defcustom gnus-summary-mode-hook nil
850 "*A hook for Gnus summary mode.
851 This hook is run before any variables are set in the summary buffer."
852 :options '(turn-on-gnus-mailing-list-mode gnus-pick-mode)
853 :group 'gnus-summary-various
856 ;; Extracted from gnus-xmas-redefine in order to preserve user settings
857 (when (featurep 'xemacs)
858 (add-hook 'gnus-summary-mode-hook 'gnus-xmas-summary-menu-add)
859 (add-hook 'gnus-summary-mode-hook 'gnus-xmas-setup-summary-toolbar)
860 (add-hook 'gnus-summary-mode-hook
861 'gnus-xmas-switch-horizontal-scrollbar-off))
863 (defcustom gnus-summary-menu-hook nil
864 "*Hook run after the creation of the summary mode menu."
865 :group 'gnus-summary-visual
868 (defcustom gnus-summary-exit-hook nil
869 "*A hook called on exit from the summary buffer.
870 It will be called with point in the group buffer."
871 :group 'gnus-summary-exit
874 (defcustom gnus-summary-prepare-hook nil
875 "*A hook called after the summary buffer has been generated.
876 If you want to modify the summary buffer, you can use this hook."
877 :group 'gnus-summary-various
880 (defcustom gnus-summary-prepared-hook nil
881 "*A hook called as the last thing after the summary buffer has been generated."
882 :group 'gnus-summary-various
885 (defcustom gnus-summary-generate-hook nil
886 "*A hook run just before generating the summary buffer.
887 This hook is commonly used to customize threading variables and the
889 :group 'gnus-summary-various
892 (defcustom gnus-select-group-hook nil
893 "*A hook called when a newsgroup is selected.
895 If you'd like to simplify subjects like the
896 `gnus-summary-next-same-subject' command does, you can use the
899 (add-hook gnus-select-group-hook
901 (mapcar (lambda (header)
902 (mail-header-set-subject
904 (gnus-simplify-subject
905 (mail-header-subject header) 're-only)))
906 gnus-newsgroup-headers)))"
907 :group 'gnus-group-select
910 (defcustom gnus-select-article-hook nil
911 "*A hook called when an article is selected."
912 :group 'gnus-summary-choose
913 :options '(gnus-agent-fetch-selected-article)
916 (defcustom gnus-visual-mark-article-hook
917 (list 'gnus-highlight-selected-summary)
918 "*Hook run after selecting an article in the summary buffer.
919 It is meant to be used for highlighting the article in some way. It
920 is not run if `gnus-visual' is nil."
921 :group 'gnus-summary-visual
924 (defcustom gnus-parse-headers-hook nil
925 "*A hook called before parsing the headers."
929 (defcustom gnus-exit-group-hook nil
930 "*A hook called when exiting summary mode.
931 This hook is not called from the non-updating exit commands like `Q'."
935 (defcustom gnus-summary-update-hook
936 (list 'gnus-summary-highlight-line)
937 "*A hook called when a summary line is changed.
938 The hook will not be called if `gnus-visual' is nil.
940 The default function `gnus-summary-highlight-line' will
941 highlight the line according to the `gnus-summary-highlight'
943 :group 'gnus-summary-visual
946 (defcustom gnus-mark-article-hook '(gnus-summary-mark-read-and-unread-as-read)
947 "*A hook called when an article is selected for the first time.
948 The hook is intended to mark an article as read (or unread)
949 automatically when it is selected."
950 :group 'gnus-summary-choose
953 (defcustom gnus-group-no-more-groups-hook nil
954 "*A hook run when returning to group mode having no more (unread) groups."
955 :group 'gnus-group-select
958 (defcustom gnus-ps-print-hook nil
959 "*A hook run before ps-printing something from Gnus."
963 (defcustom gnus-summary-article-move-hook nil
964 "*A hook called after an article is moved, copied, respooled, or crossposted."
969 (defcustom gnus-summary-article-delete-hook nil
970 "*A hook called after an article is deleted."
975 (defcustom gnus-summary-article-expire-hook nil
976 "*A hook called after an article is expired."
981 (defcustom gnus-summary-display-arrow
982 (and (fboundp 'display-graphic-p)
984 "*If non-nil, display an arrow highlighting the current article."
989 (defcustom gnus-summary-selected-face 'gnus-summary-selected
990 "Face used for highlighting the current article in the summary buffer."
991 :group 'gnus-summary-visual
994 (defvar gnus-tmp-downloaded nil)
996 (defcustom gnus-summary-highlight
997 '(((eq mark gnus-canceled-mark)
998 . gnus-summary-cancelled)
999 ((and uncached (> score default-high))
1000 . gnus-summary-high-undownloaded)
1001 ((and uncached (< score default-low))
1002 . gnus-summary-low-undownloaded)
1004 . gnus-summary-normal-undownloaded)
1005 ((and (> score default-high)
1006 (or (eq mark gnus-dormant-mark)
1007 (eq mark gnus-ticked-mark)))
1008 . gnus-summary-high-ticked)
1009 ((and (< score default-low)
1010 (or (eq mark gnus-dormant-mark)
1011 (eq mark gnus-ticked-mark)))
1012 . gnus-summary-low-ticked)
1013 ((or (eq mark gnus-dormant-mark)
1014 (eq mark gnus-ticked-mark))
1015 . gnus-summary-normal-ticked)
1016 ((and (> score default-high) (eq mark gnus-ancient-mark))
1017 . gnus-summary-high-ancient)
1018 ((and (< score default-low) (eq mark gnus-ancient-mark))
1019 . gnus-summary-low-ancient)
1020 ((eq mark gnus-ancient-mark)
1021 . gnus-summary-normal-ancient)
1022 ((and (> score default-high) (eq mark gnus-unread-mark))
1023 . gnus-summary-high-unread)
1024 ((and (< score default-low) (eq mark gnus-unread-mark))
1025 . gnus-summary-low-unread)
1026 ((eq mark gnus-unread-mark)
1027 . gnus-summary-normal-unread)
1028 ((> score default-high)
1029 . gnus-summary-high-read)
1030 ((< score default-low)
1031 . gnus-summary-low-read)
1033 . gnus-summary-normal-read))
1034 "*Controls the highlighting of summary buffer lines.
1036 A list of (FORM . FACE) pairs. When deciding how a a particular
1037 summary line should be displayed, each form is evaluated. The content
1038 of the face field after the first true form is used. You can change
1039 how those summary lines are displayed, by editing the face field.
1041 You can use the following variables in the FORM field.
1043 score: The article's score
1044 default: The default article score.
1045 default-high: The default score for high scored articles.
1046 default-low: The default score for low scored articles.
1047 below: The score below which articles are automatically marked as read.
1048 mark: The article's mark.
1049 uncached: Non-nil if the article is uncached."
1050 :group 'gnus-summary-visual
1051 :type '(repeat (cons (sexp :tag "Form" nil)
1054 (defcustom gnus-alter-header-function nil
1055 "Function called to allow alteration of article header structures.
1056 The function is called with one parameter, the article header vector,
1057 which it may alter in any way."
1058 :type '(choice (const :tag "None" nil)
1060 :group 'gnus-summary)
1062 (defvar gnus-decode-encoded-word-function 'mail-decode-encoded-word-string
1063 "Function used to decode a string with encoded words.")
1065 (defvar gnus-decode-encoded-address-function
1066 'mail-decode-encoded-address-string
1067 "Function used to decode addresses with encoded words.")
1069 (defcustom gnus-extra-headers '(To Newsgroups)