• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/gnus/

Lines Matching +defs:gnus +defs:article +defs:display +defs:face

0 ;;; gnus-sum.el --- summary mode commands for Gnus
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
34 (require 'gnus)
35 (require 'gnus-group)
36 (require 'gnus-spec)
37 (require 'gnus-range)
38 (require 'gnus-int)
39 (require 'gnus-undo)
40 (require 'gnus-util)
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)
51 (autoload 'gnus-article-outlook-deuglify-article "deuglify"
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
62 :group 'gnus-summary-exit
65 (defcustom gnus-fetch-old-headers nil
67 If an unread article in the group refers to an older, already read (or
68 just marked as read) article, the old article will not normally be
78 :group 'gnus-thread
86 (defcustom gnus-refer-thread-limit 200
87 "*The number of old headers to fetch when doing \\<gnus-summary-mode-map>\\[gnus-summary-refer-thread].
89 :group 'gnus-thread
93 (defcustom gnus-summary-make-false-root 'adopt
114 given by the `gnus-summary-same-subject' variable.)"
115 :group 'gnus-thread
122 (defcustom gnus-summary-make-false-root-always nil
125 :group 'gnus-thread
128 (defcustom gnus-summary-gather-exclude-subject "^ *$\\|^(none)$"
133 :group 'gnus-thread
136 (defcustom gnus-summary-gather-subject-limit nil
146 :group 'gnus-thread
151 (defcustom gnus-simplify-subject-functions nil
156 `gnus-simplify-subject-re', `gnus-simplify-subject-fuzzy',
157 `gnus-simplify-whitespace', and `gnus-simplify-all-whitespace'."
158 :group 'gnus-thread
161 (defcustom gnus-simplify-ignored-prefixes nil
163 :group 'gnus-thread
167 (defcustom gnus-build-sparse-threads nil
172 :group 'gnus-thread
178 (defcustom gnus-summary-thread-gathering-function
179 'gnus-gather-threads-by-subject
181 There are two pre-defined functions: `gnus-gather-threads-by-subject',
183 `gnus-gather-threads-by-references', which compared the References
185 :group 'gnus-thread
186 :type '(radio (function-item gnus-gather-threads-by-subject)
187 (function-item gnus-gather-threads-by-references)
190 (defcustom gnus-summary-same-subject ""
191 "*String indicating that the current article has the same subject as the previous.
193 `gnus-summary-make-false-root' is `empty'."
194 :group 'gnus-summary-format
197 (defcustom gnus-summary-goto-unread t
198 "*If t, many commands will go to the next unread article.
200 \"naturally\" select the next article, like, for instance, `SPC' at
201 the end of an article.
203 If nil, the marking commands do NOT go to the next unread article
204 \(they go to the next article instead). If `never', commands that
205 usually go to the next unread article, will go to the next article,
207 :group 'gnus-summary-marks
208 :link '(custom-manual "(gnus)Setting Marks")
213 (defcustom gnus-summary-default-score 0
214 "*Default article score level.
217 :group 'gnus-score-default
221 (defcustom gnus-summary-default-high-score 0
222 "*Default threshold for a high scored article.
223 An article will be highlighted as high scored if its score is greater
226 :group 'gnus-score-default
229 (defcustom gnus-summary-default-low-score 0
230 "*Default threshold for a low scored article.
231 An article will be highlighted as low scored if its score is smaller
234 :group 'gnus-score-default
237 (defcustom gnus-summary-zcore-fuzz 0
239 Articles with scores closer than this to `gnus-summary-default-score'
241 :group 'gnus-summary-format
244 (defcustom gnus-simplify-subject-fuzzy-regexp nil
249 :group 'gnus-thread
252 (defcustom gnus-show-threads t
253 "*If non-nil, display threads in summary mode."
254 :group 'gnus-thread
257 (defcustom gnus-thread-hide-subtree nil
261 `gnus-summary-show-thread' by hand or select an article."
262 :group 'gnus-thread
270 (defcustom gnus-thread-hide-killed t
272 :group 'gnus-thread
275 (defcustom gnus-thread-ignore-subject t
279 :group 'gnus-thread
282 (defcustom gnus-thread-operation-ignore-subject t
284 This affects commands like `gnus-summary-kill-thread' and
285 `gnus-summary-lower-thread'.
291 :group 'gnus-thread
296 (defcustom gnus-thread-indent-level 4
298 :group 'gnus-thread
301 (defcustom gnus-auto-extend-newsgroup t
303 :group 'gnus-summary-choose
306 (defcustom gnus-auto-select-first t
307 "If non-nil, select an article on group entry.
308 An article is selected automatically when entering a group
309 e.g. with \\<gnus-group-mode-map>\\[gnus-group-read-group], or via `gnus-summary-next-page' or
310 `gnus-summary-catchup-and-goto-next-group'.
312 Which article is selected is controlled by the variable
313 `gnus-auto-select-subject'.
316 newsgroups, set the variable to nil in `gnus-select-group-hook'."
318 ;; \\<gnus-group-mode-map>\\[gnus-group-read-group]
319 ;; \\<gnus-summary-mode-map>\\[gnus-summary-next-page]
320 ;; \\<gnus-summary-mode-map>\\[gnus-summary-catchup-and-goto-next-group]
321 :group 'gnus-group-select
325 (defcustom gnus-auto-select-subject 'unread
330 unread article), `best' (place point on the subject line of the
331 higest-scored article), `unseen' (place point on the subject line of
332 the first unseen article), `unseen-or-unread' (place point on the subject
333 line of the first unseen article or, if all article have been seen, on the
334 subject line of the first unread article), or a function to be called to
337 :group 'gnus-group-select
344 (defcustom gnus-auto-select-next t
352 confirmation if you are located on the last article in the group.
353 Finally, if this variable is `slightly-quietly', the `\\<gnus-summary-mode-map>\\[gnus-summary-catchup-and-goto-next-group]' command
355 :group 'gnus-summary-maneuvering
362 (defcustom gnus-auto-select-same nil
363 "*If non-nil, select the next article with the same subject.
365 the first unread article."
366 :group 'gnus-summary-maneuvering
369 (defcustom gnus-auto-goto-ignores 'unfetched
373 article), `undownloaded' (maneuvering while unplugged ignores articles
379 and, when unplugged, a subset of the undownloaded article list."
381 :group 'gnus-summary-maneuvering
387 (defcustom gnus-summary-check-current nil
388 "*If non-nil, consider the current article when moving.
390 current article is unread."
391 :group 'gnus-summary-maneuvering
394 (defcustom gnus-auto-center-summary t
398 :group 'gnus-summary-maneuvering
404 (defvar gnus-auto-center-group t
407 (defcustom gnus-show-all-headers nil
409 :group 'gnus-article-hiding
410 :group 'gnus-article-headers
413 (defcustom gnus-summary-ignore-duplicates nil
415 :group 'gnus-summary
418 (defcustom gnus-single-article-buffer t
419 "*If non-nil, display all articles in the same buffer.
420 If nil, each group will get its own article buffer."
421 :group 'gnus-article-various
424 (defcustom gnus-break-pages t
426 The page delimiter is specified by the `gnus-page-delimiter'
428 :group 'gnus-article-various
431 (defcustom gnus-move-split-methods nil
433 It uses the same syntax as the `gnus-split-methods' variable.
434 However, whereas `gnus-split-methods' specifies file names as targets,
436 :group 'gnus-summary-mail
444 (defcustom gnus-unread-mark ? ;Whitespace
446 :group 'gnus-summary-marks
449 (defcustom gnus-ticked-mark ?!
451 :group 'gnus-summary-marks
454 (defcustom gnus-dormant-mark ??
456 :group 'gnus-summary-marks
459 (defcustom gnus-del-mark ?r
461 :group 'gnus-summary-marks
464 (defcustom gnus-read-mark ?R
466 :group 'gnus-summary-marks
469 (defcustom gnus-expirable-mark ?E
471 :group 'gnus-summary-marks
474 (defcustom gnus-killed-mark ?K
476 :group 'gnus-summary-marks
479 (defcustom gnus-spam-mark ?$
482 :group 'gnus-summary-marks
485 (defcustom gnus-souped-mark ?F
487 :group 'gnus-summary-marks
490 (defcustom gnus-kill-file-mark ?X
492 :group 'gnus-summary-marks
495 (defcustom gnus-low-score-mark ?Y
497 :group 'gnus-summary-marks
500 (defcustom gnus-catchup-mark ?C
502 :group 'gnus-summary-marks
505 (defcustom gnus-replied-mark ?A
507 :group 'gnus-summary-marks
510 (defcustom gnus-forwarded-mark ?F
513 :group 'gnus-summary-marks
516 (defcustom gnus-recent-mark ?N
519 :group 'gnus-summary-marks
522 (defcustom gnus-cached-mark ?*
524 :group 'gnus-summary-marks
527 (defcustom gnus-saved-mark ?S
529 :group 'gnus-summary-marks
532 (defcustom gnus-unseen-mark ?.
535 :group 'gnus-summary-marks
538 (defcustom gnus-no-mark ? ;Whitespace
541 :group 'gnus-summary-marks
544 (defcustom gnus-ancient-mark ?O
546 :group 'gnus-summary-marks
549 (defcustom gnus-sparse-mark ?Q
551 :group 'gnus-summary-marks
554 (defcustom gnus-canceled-mark ?G
556 :group 'gnus-summary-marks
559 (defcustom gnus-duplicate-mark ?M
561 :group 'gnus-summary-marks
564 (defcustom gnus-undownloaded-mark ?-
567 :group 'gnus-summary-marks
570 (defcustom gnus-downloaded-mark ?+
572 :group 'gnus-summary-marks
575 (defcustom gnus-downloadable-mark ?%
577 :group 'gnus-summary-marks
580 (defcustom gnus-unsendable-mark ?=
582 :group 'gnus-summary-marks
585 (defcustom gnus-score-over-mark ?+
587 :group 'gnus-summary-marks
590 (defcustom gnus-score-below-mark ?-
592 :group 'gnus-summary-marks
595 (defcustom gnus-empty-thread-mark ? ;Whitespace
596 "*There is no thread under the article."
597 :group 'gnus-summary-marks
600 (defcustom gnus-not-empty-thread-mark ?=
601 "*There is a thread under the article."
602 :group 'gnus-summary-marks
605 (defcustom gnus-view-pseudo-asynchronously nil
607 :group 'gnus-extract-view
610 (defcustom gnus-auto-expirable-marks
611 (list gnus-killed-mark gnus-del-mark gnus-catchup-mark
612 gnus-low-score-mark gnus-ancient-mark gnus-read-mark
613 gnus-souped-mark gnus-duplicate-mark)
616 :group 'gnus-summary
619 (defcustom gnus-inhibit-user-auto-expire t
620 "*If non-nil, user marking commands will not mark an article as expirable, even if the group has auto-expire turned on."
622 :group 'gnus-summary
625 (defcustom gnus-view-pseudos nil
629 :group 'gnus-extract-view
634 (defcustom gnus-view-pseudos-separately t
635 "*If non-nil, one pseudo-article will be created for each file to be viewed.
638 :group 'gnus-extract-view
641 (defcustom gnus-insert-pseudo-articles t
643 :group 'gnus-extract-view
646 (defcustom gnus-summary-dummy-line-format
655 See `(gnus)Formatting Variables'."
656 :link '(custom-manual "(gnus)Formatting Variables")
657 :group 'gnus-threading
660 (defcustom gnus-summary-mode-line-format "Gnus: %g [%A] %Z"
667 %A Current article number
668 %z Current article score
672 %Z A string with unread/unselected article counts
674 %S Subject of the current article
680 :group 'gnus-summary-format
683 (defcustom gnus-list-identifiers nil
687 :group 'gnus-summary-format
688 :group 'gnus-article-hiding
693 (defcustom gnus-summary-mark-below 0
697 :group 'gnus-score-default
700 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number)
704 article should be sorted before the other. If you use more than one
706 probably always include `gnus-article-sort-by-number' in the list of
712 Ready-made functions include `gnus-article-sort-by-number',
713 `gnus-article-sort-by-author', `gnus-article-sort-by-subject',
714 `gnus-article-sort-by-date', `gnus-article-sort-by-random'
715 and `gnus-article-sort-by-score'.
717 When threading is turned on, the variable `gnus-thread-sort-functions'
719 :group 'gnus-summary-sort
720 :type '(repeat (choice (function-item gnus-article-sort-by-number)
721 (function-item gnus-article-sort-by-author)
722 (function-item gnus-article-sort-by-subject)
723 (function-item gnus-article-sort-by-date)
724 (function-item gnus-article-sort-by-score)
725 (function-item gnus-article-sort-by-random)
728 (defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number)
730 By default, threads are sorted by article number.
735 probably always include `gnus-thread-sort-by-number' in the list of
741 Ready-made functions include `gnus-thread-sort-by-number',
742 `gnus-thread-sort-by-author', `gnus-thread-sort-by-subject',
743 `gnus-thread-sort-by-date', `gnus-thread-sort-by-score',
744 `gnus-thread-sort-by-most-recent-number',
745 `gnus-thread-sort-by-most-recent-date',
746 `gnus-thread-sort-by-random', and
747 `gnus-thread-sort-by-total-score' (see `gnus-thread-score-function').
750 `gnus-article-sort-functions' controls how articles are sorted."
751 :group 'gnus-summary-sort
752 :type '(repeat (choice (function-item gnus-thread-sort-by-number)
753 (function-item gnus-thread-sort-by-author)
754 (function-item gnus-thread-sort-by-subject)
755 (function-item gnus-thread-sort-by-date)
756 (function-item gnus-thread-sort-by-score)
757 (function-item gnus-thread-sort-by-total-score)
758 (function-item gnus-thread-sort-by-random)
761 (defcustom gnus-thread-score-function '+
764 The function is called with the scores of the article and each
768 :group 'gnus-summary-sort
771 (defcustom gnus-summary-expunge-below nil
774 :group 'gnus-score-default
778 (defcustom gnus-thread-expunge-below nil
780 See `gnus-thread-score-function' for en explanation of what a
784 :group 'gnus-threading
785 :group 'gnus-score-default
789 (defcustom gnus-summary-mode-hook nil
792 :options '(turn-on-gnus-mailing-list-mode gnus-pick-mode)
793 :group 'gnus-summary-various
796 ;; Extracted from gnus-xmas-redefine in order to preserve user settings
798 (add-hook 'gnus-summary-mode-hook 'gnus-xmas-summary-menu-add)
799 (add-hook 'gnus-summary-mode-hook 'gnus-xmas-setup-summary-toolbar)
800 (add-hook 'gnus-summary-mode-hook
801 'gnus-xmas-switch-horizontal-scrollbar-off))
803 (defcustom gnus-summary-menu-hook nil
805 :group 'gnus-summary-visual
808 (defcustom gnus-summary-exit-hook nil
811 :group 'gnus-summary-exit
814 (defcustom gnus-summary-prepare-hook nil
817 :group 'gnus-summary-various
820 (defcustom gnus-summary-prepared-hook nil
822 :group 'gnus-summary-various
825 (defcustom gnus-summary-generate-hook nil
829 :group 'gnus-summary-various
832 (defcustom gnus-select-group-hook nil
836 `gnus-summary-next-same-subject' command does, you can use the
839 (add-hook gnus-select-group-hook
844 (gnus-simplify-subject
846 gnus-newsgroup-headers)))"
847 :group 'gnus-group-select
850 (defcustom gnus-select-article-hook nil
851 "*A hook called when an article is selected."
852 :group 'gnus-summary-choose
853 :options '(gnus-agent-fetch-selected-article)
856 (defcustom gnus-visual-mark-article-hook
857 (list 'gnus-highlight-selected-summary)
858 "*Hook run after selecting an article in the summary buffer.
859 It is meant to be used for highlighting the article in some way. It
860 is not run if `gnus-visual' is nil."
861 :group 'gnus-summary-visual
864 (defcustom gnus-parse-headers-hook nil
866 :group 'gnus-various
869 (defcustom gnus-exit-group-hook nil
872 :group 'gnus-various
875 (defcustom gnus-summary-update-hook
876 (list 'gnus-summary-highlight-line)
878 The hook will not be called if `gnus-visual' is nil.
880 The default function `gnus-summary-highlight-line' will
881 highlight the line according to the `gnus-summary-highlight'
883 :group 'gnus-summary-visual
886 (defcustom gnus-mark-article-hook '(gnus-summary-mark-read-and-unread-as-read)
887 "*A hook called when an article is selected for the first time.
888 The hook is intended to mark an article as read (or unread)
890 :group 'gnus-summary-choose
893 (defcustom gnus-group-no-more-groups-hook nil
895 :group 'gnus-group-select
898 (defcustom gnus-ps-print-hook nil
900 :group 'gnus-summary
903 (defcustom gnus-summary-article-move-hook nil
904 "*A hook called after an article is moved, copied, respooled, or crossposted."
906 :group 'gnus-summary
909 (defcustom gnus-summary-article-delete-hook nil
910 "*A hook called after an article is deleted."
912 :group 'gnus-summary
915 (defcustom gnus-summary-article-expire-hook nil
916 "*A hook called after an article is expired."
918 :group 'gnus-summary
921 (defcustom gnus-summary-display-arrow
922 (and (fboundp 'display-graphic-p)
923 (display-graphic-p))
924 "*If non-nil, display an arrow highlighting the current article."
926 :group 'gnus-summary
929 (defcustom gnus-summary-selected-face 'gnus-summary-selected
930 "Face used for highlighting the current article in the summary buffer."
931 :group 'gnus-summary-visual
932 :type 'face)
934 (defvar gnus-tmp-downloaded nil)
936 (defcustom gnus-summary-highlight
937 '(((eq mark gnus-canceled-mark)
938 . gnus-summary-cancelled)
940 . gnus-summary-high-undownloaded)
942 . gnus-summary-low-undownloaded)
944 . gnus-summary-normal-undownloaded)
946 (or (eq mark gnus-dormant-mark)
947 (eq mark gnus-ticked-mark)))
948 . gnus-summary-high-ticked)
950 (or (eq mark gnus-dormant-mark)
951 (eq mark gnus-ticked-mark)))
952 . gnus-summary-low-ticked)
953 ((or (eq mark gnus-dormant-mark)
954 (eq mark gnus-ticked-mark))
955 . gnus-summary-normal-ticked)
956 ((and (> score default-high) (eq mark gnus-ancient-mark))
957 . gnus-summary-high-ancient)
958 ((and (< score default-low) (eq mark gnus-ancient-mark))
959 . gnus-summary-low-ancient)
960 ((eq mark gnus-ancient-mark)
961 . gnus-summary-normal-ancient)
962 ((and (> score default-high) (eq mark gnus-unread-mark))
963 . gnus-summary-high-unread)
964 ((and (< score default-low) (eq mark gnus-unread-mark))
965 . gnus-summary-low-unread)
966 ((eq mark gnus-unread-mark)
967 . gnus-summary-normal-unread)
969 . gnus-summary-high-read)
971 . gnus-summary-low-read)
973 . gnus-summary-normal-read))
978 of the face field after the first true form is used. You can change
979 how those summary lines are displayed, by editing the face field.
983 score: The article's score
984 default: The default article score.
988 mark: The article's mark.
989 uncached: Non-nil if the article is uncached."
990 :group 'gnus-summary-visual
992 face)))
994 (defcustom gnus-alter-header-function nil
995 "Function called to allow alteration of article header structures.
996 The function is called with one parameter, the article header vector,
1000 :group 'gnus-summary)
1002 (defvar gnus-decode-encoded-word-function 'mail-decode-encoded-word-string
1005 (defvar gnus-decode-encoded-address-function
1009 (defcustom gnus-extra-headers '(To Newsgroups)
1012 :group 'gnus-summary
1015 (defcustom gnus-ignored-from-addresses
1021 :group 'gnus-summary
1024 (defcustom gnus-newsgroup-ignored-charsets '(unknown-8bit x-unknown)
1030 :group 'gnus-charset)
1032 (gnus-define-group-parameter
1037 :variable gnus-group-ignored-charsets-alist
1044 :variable-group gnus-charset
1056 (defcustom gnus-group-highlight-words-alist nil
1058 This variable uses the same syntax as `gnus-emphasis-alist'."
1065 gnus-emphasis-highlight-words)))))
1066 :group 'gnus-summary-visual)
1068 (defcustom gnus-summary-show-article-charset-alist
1071 The article will be shown with the charset corresponding to the
1077 :group 'gnus-charset)
1079 (defcustom gnus-preserve-marks t
1083 :group 'gnus-summary-marks)
1085 (defcustom gnus-alter-articles-to-read-function nil
1088 :group 'gnus-summary)
1090 (defcustom gnus-orphan-score nil
1092 :group 'gnus-score-default
1096 (defcustom gnus-summary-save-parts-default-mime "image/.*"
1098 message with `gnus-summary-save-parts' (\\<gnus-summary-mode-map>\\[gnus-summary-save-parts]).
1101 :group 'gnus-summary
1104 (defcustom gnus-read-all-available-headers nil
1110 :group 'gnus-summary
1113 (defcustom gnus-summary-muttprint-program "muttprint"
1116 :group 'gnus-summary
1119 (defcustom gnus-article-loose-mime nil
1127 :group 'gnus-article-mime)
1129 (defcustom gnus-article-emulate-mime t
1136 :group 'gnus-article-mime)
1140 (defvar gnus-summary-display-cache nil)
1141 (defvar gnus-article-mime-handles nil)
1142 (defvar gnus-article-decoded-p nil)
1143 (defvar gnus-article-charset nil)
1144 (defvar gnus-article-ignored-charsets nil)
1145 (defvar gnus-scores-exclude-files nil)
1146 (defvar gnus-page-broken nil)
1148 (defvar gnus-original-article nil)
1149 (defvar gnus-article-internal-prepare-hook nil)
1150 (defvar gnus-newsgroup-process-stack nil)
1152 (defvar gnus-thread-indent-array nil)
1153 (defvar gnus-thread-indent-array-level gnus-thread-indent-level)
1154 (defvar gnus-sort-gathered-threads-function 'gnus-thread-sort-by-number
1157 (defvar gnus-summary-save-parts-type-history nil)
1158 (defvar gnus-summary-save-parts-last-directory mm-default-directory)
1161 (defvar gnus-summary-inhibit-highlight nil)
1162 (defvar gnus-newsgroup-selected-overlay nil)
1163 (defvar gnus-inhibit-limiting nil)
1164 (defvar gnus-newsgroup-adaptive-score-file nil)
1165 (defvar gnus-current-score-file nil)
1166 (defvar gnus-current-move-group nil)
1167 (defvar gnus-current-copy-group nil)
1168 (defvar gnus-current-crosspost-group nil)
1169 (defvar gnus-newsgroup-display nil)
1171 (defvar gnus-newsgroup-dependencies nil)
1172 (defvar gnus-newsgroup-adaptive nil)
1173 (defvar gnus-summary-display-article-function nil)
1174 (defvar gnus-summary-highlight-line-function nil
1177 (defvar gnus-summary-line-format-alist
1178 `((?N ,(macroexpand '(mail-header-number gnus-tmp-header)) ?d)
1179 (?S ,(macroexpand '(mail-header-subject gnus-tmp-header)) ?s)
1180 (?s gnus-tmp-subject-or-nil ?s)
1181 (?n gnus-tmp-name ?s)
1182 (?A (car (cdr (funcall gnus-extract-address-components gnus-tmp-from)))
1184 (?a (or (car (funcall gnus-extract-address-components gnus-tmp-from))
1185 gnus-tmp-from) ?s)
1186 (?F gnus-tmp-from ?s)
1187 (?x ,(macroexpand '(mail-header-xref gnus-tmp-header)) ?s)
1188 (?D ,(macroexpand '(mail-header-date gnus-tmp-header)) ?s)
1189 (?d (gnus-dd-mmm (mail-header-date gnus-tmp-header)) ?s)
1190 (?o (gnus-date-iso8601 (mail-header-date gnus-tmp-header)) ?s)
1191 (?M ,(macroexpand '(mail-header-id gnus-tmp-header)) ?s)
1192 (?r ,(macroexpand '(mail-header-references gnus-tmp-header)) ?s)
1193 (?c (or (mail-header-chars gnus-tmp-header) 0) ?d)
1194 (?k (gnus-summary-line-message-size gnus-tmp-header) ?s)
1195 (?L gnus-tmp-lines ?s)
1196 (?O gnus-tmp-downloaded ?c)
1197 (?I gnus-tmp-indentation ?s)
1198 (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s)
1199 (?R gnus-tmp-replied ?c)
1200 (?\[ gnus-tmp-opening-bracket ?c)
1201 (?\] gnus-tmp-closing-bracket ?c)
1202 (?\> (make-string gnus-tmp-level ? ) ?s)
1203 (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s)
1204 (?i gnus-tmp-score ?d)
1205 (?z gnus-tmp-score-char ?c)
1206 (?l (bbb-grouplens-score gnus-tmp-header) ?s)
1207 (?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d)
1208 (?U gnus-tmp-unread ?c)
1209 (?f (gnus-summary-from-or-to-or-newsgroups gnus-tmp-header gnus-tmp-from)
1211 (?t (gnus-summary-number-of-articles-in-thread
1212 (and (boundp 'thread) (car thread)) gnus-tmp-level)
1214 (?e (gnus-summary-number-of-articles-in-thread
1215 (and (boundp 'thread) (car thread)) gnus-tmp-level t)
1217 (?u gnus-tmp-user-defined ?s)
1218 (?P (gnus-pick-line-number) ?d)
1219 (?B gnus-tmp-thread-tree-header-string ?s)
1220 (user-date (gnus-user-date
1221 ,(macroexpand '(mail-header-date gnus-tmp-header))) ?s))
1226 (defvar gnus-summary-dummy-line-format-alist
1227 `((?S gnus-tmp-subject ?s)
1228 (?N gnus-tmp-number ?d)
1229 (?u gnus-tmp-user-defined ?s)))
1231 (defvar gnus-summary-mode-line-format-alist
1232 `((?G gnus-tmp-group-name ?s)
1233 (?g (gnus-short-group-name gnus-tmp-group-name) ?s)
1234 (?p (gnus-group-real-name gnus-tmp-group-name) ?s)
1235 (?A gnus-tmp-article-number ?d)
1236 (?Z gnus-tmp-unread-and-unselected ?s)
1237 (?V gnus-version ?s)
1238 (?U gnus-tmp-unread-and-unticked ?d)
1239 (?S gnus-tmp-subject ?s)
1240 (?e gnus-tmp-unselected ?d)
1241 (?u gnus-tmp-user-defined ?s)
1242 (?d (length gnus-newsgroup-dormant) ?d)
1243 (?t (length gnus-newsgroup-marked) ?d)
1244 (?h (length gnus-newsgroup-spam-marked) ?d)
1245 (?r (length gnus-newsgroup-reads) ?d)
1246 (?z (gnus-summary-article-score gnus-tmp-article-number) ?d)
1247 (?E gnus-newsgroup-expunged-tally ?d)
1248 (?s (gnus-current-score-file-nondirectory) ?s)))
1250 (defvar gnus-last-search-regexp nil
1251 "Default regexp for article search command.")
1253 (defvar gnus-last-shell-command nil
1254 "Default shell command on article.")
1256 (defvar gnus-newsgroup-agentized nil
1258 (defvar gnus-newsgroup-begin nil)
1259 (defvar gnus-newsgroup-end nil)
1260 (defvar gnus-newsgroup-last-rmail nil)
1261 (defvar gnus-newsgroup-last-mail nil)
1262 (defvar gnus-newsgroup-last-folder nil)
1263 (defvar gnus-newsgroup-last-file nil)
1264 (defvar gnus-newsgroup-last-directory nil)
1265 (defvar gnus-newsgroup-auto-expire nil)
1266 (defvar gnus-newsgroup-active nil)
1268 (defvar gnus-newsgroup-data nil)
1269 (defvar gnus-newsgroup-data-reverse nil)
1270 (defvar gnus-newsgroup-limit nil)
1271 (defvar gnus-newsgroup-limits nil)
1272 (defvar gnus-summary-use-undownloaded-faces nil)
1274 (defvar gnus-newsgroup-unreads nil
1277 (defvar gnus-newsgroup-unselected nil
1280 (defvar gnus-newsgroup-reads nil
1281 "Alist of read articles and article marks in the current newsgroup.")
1283 (defvar gnus-newsgroup-expunged-tally nil)
1285 (defvar gnus-newsgroup-marked nil
1288 (defvar gnus-newsgroup-spam-marked nil
1291 (defvar gnus-newsgroup-killed nil
1294 (defvar gnus-newsgroup-cached nil
1295 "Sorted list of articles that come from the article cache.")
1297 (defvar gnus-newsgroup-saved nil
1300 (defvar gnus-newsgroup-kill-headers nil)
1302 (defvar gnus-newsgroup-replied nil
1305 (defvar gnus-newsgroup-forwarded nil
1308 (defvar gnus-newsgroup-recent nil
1311 (defvar gnus-newsgroup-expirable nil
1314 (defvar gnus-newsgroup-processable nil
1317 (defvar gnus-newsgroup-downloadable nil
1320 (defvar gnus-newsgroup-unfetched nil
1324 This list will always be a subset of gnus-newsgroup-undownloaded.")
1326 (defvar gnus-newsgroup-undownloaded nil
1329 (defvar gnus-newsgroup-unsendable nil
1332 (defvar gnus-newsgroup-bookmarks nil
1335 (defvar gnus-newsgroup-dormant nil
1338 (defvar gnus-newsgroup-unseen nil
1341 (defvar gnus-newsgroup-seen nil
1344 (defvar gnus-newsgroup-articles nil
1347 (defvar gnus-newsgroup-scored nil
1350 (defvar gnus-newsgroup-headers nil
1351 "List of article headers in the current newsgroup.")
1353 (defvar gnus-newsgroup-threads nil)
1355 (defvar gnus-newsgroup-prepared nil
1358 (defvar gnus-newsgroup-ancient nil
1359 "List of `gnus-fetch-old-headers' articles in the current newsgroup.")
1361 (defvar gnus-newsgroup-sparse nil)
1363 (defvar gnus-current-article nil)
1364 (defvar gnus-article-current nil)
1365 (defvar gnus-current-headers nil)
1366 (defvar gnus-have-all-headers nil)
1367 (defvar gnus-last-article nil)
1368 (defvar gnus-newsgroup-history nil)
1369 (defvar gnus-newsgroup-charset nil)
1370 (defvar gnus-newsgroup-ephemeral-charset nil)
1371 (defvar gnus-newsgroup-ephemeral-ignored-charsets nil)
1373 (defvar gnus-article-before-search nil)
1375 (defvar gnus-summary-local-variables
1376 '(gnus-newsgroup-name
1377 gnus-newsgroup-begin gnus-newsgroup-end
1378 gnus-newsgroup-last-rmail gnus-newsgroup-last-mail
1379 gnus-newsgroup-last-folder gnus-newsgroup-last-file
1380 gnus-newsgroup-last-directory
1381 gnus-newsgroup-auto-expire gnus-newsgroup-unreads
1382 gnus-newsgroup-unselected gnus-newsgroup-marked
1383 gnus-newsgroup-spam-marked
1384 gnus-newsgroup-reads gnus-newsgroup-saved
1385 gnus-newsgroup-replied gnus-newsgroup-forwarded
1386 gnus-newsgroup-recent
1387 gnus-newsgroup-expirable
1388 gnus-newsgroup-processable gnus-newsgroup-killed
1389 gnus-newsgroup-downloadable gnus-newsgroup-undownloaded
1390 gnus-newsgroup-unfetched
1391 gnus-newsgroup-unsendable gnus-newsgroup-unseen
1392 gnus-newsgroup-seen gnus-newsgroup-articles
1393 gnus-newsgroup-bookmarks gnus-newsgroup-dormant
1394 gnus-newsgroup-headers gnus-newsgroup-threads
1395 gnus-newsgroup-prepared gnus-summary-highlight-line-function
1396 gnus-current-article gnus-current-headers gnus-have-all-headers
1397 gnus-last-article gnus-article-internal-prepare-hook
1398 gnus-newsgroup-dependencies gnus-newsgroup-selected-overlay
1399 gnus-newsgroup-scored gnus-newsgroup-kill-headers
1400 gnus-thread-expunge-below
1401 gnus-score-alist gnus-current-score-file
1402 (gnus-summary-expunge-below . global)
1403 (gnus-summary-mark-below . global)
1404 (gnus-orphan-score . global)
1405 gnus-newsgroup-active gnus-scores-exclude-files
1406 gnus-newsgroup-history gnus-newsgroup-ancient
1407 gnus-newsgroup-sparse gnus-newsgroup-process-stack
1408 (gnus-newsgroup-adaptive . gnus-use-adaptive-scoring)
1409 gnus-newsgroup-adaptive-score-file (gnus-reffed-article-number . -1)
1410 (gnus-newsgroup-expunged-tally . 0)
1411 gnus-cache-removable-articles gnus-newsgroup-cached
1412 gnus-newsgroup-data gnus-newsgroup-data-reverse
1413 gnus-newsgroup-limit gnus-newsgroup-limits
1414 gnus-newsgroup-charset gnus-newsgroup-display
1415 gnus-summary-use-undownloaded-faces)
1418 (defvar gnus-newsgroup-variables nil
1435 \(setq gnus-newsgroup-variables
1437 (gnus-visible-headers .
1443 ;; Bind features so that require will believe that gnus-sum has
1445 (let ((features (cons 'gnus-sum features)))
1446 ;; Several of the declarations in gnus-sum are needed to load the
1451 (if (boundp 'gnus-newsgroup-variables)
1453 (load "gnus-sum.el" t t t))
1454 (require 'gnus)
1455 (require 'gnus-agent)
1456 (require 'gnus-art)))
1460 (defvar gnus-decode-encoded-word-methods
1470 \((\"chinese\" . gnus-decode-encoded-word-string-by-guess)
1474 (defvar gnus-decode-encoded-word-methods-cache nil)
1476 (defun gnus-multi-decode-encoded-word-string (string)
1477 "Apply the functions from `gnus-encoded-word-methods' that match."
1478 (unless (and gnus-decode-encoded-word-methods-cache
1479 (eq gnus-newsgroup-name
1480 (car gnus-decode-encoded-word-methods-cache)))
1481 (setq gnus-decode-encoded-word-methods-cache (list gnus-newsgroup-name))
1484 (nconc gnus-decode-encoded-word-methods-cache (list x))
1485 (if (and gnus-newsgroup-name
1486 (string-match (car x) gnus-newsgroup-name))
1487 (nconc gnus-decode-encoded-word-methods-cache
1489 gnus-decode-encoded-word-methods))
1490 (let ((xlist gnus-decode-encoded-word-methods-cache))
1498 (defun gnus-simplify-whitespace (str)
1513 (defun gnus-simplify-all-whitespace (str)
1519 (defsubst gnus-simplify-subject-re (subject)
1525 (defun gnus-simplify-subject (subject &optional re-only)
1534 gnus-simplify-ignored-prefixes
1535 (string-match gnus-simplify-ignored-prefixes subject))
1546 (defsubst gnus-simplify-buffer-fuzzy-step (regexp &optional newtext)
1551 (defun gnus-simplify-buffer-fuzzy ()
1557 `gnus-simplify-subject-fuzzy-regexp'."
1560 (gnus-simplify-buffer-fuzzy-step "\t" " ")
1565 ((listp gnus-simplify-subject-fuzzy-regexp)
1566 (mapcar 'gnus-simplify-buffer-fuzzy-step
1567 gnus-simplify-subject-fuzzy-regexp))
1568 (gnus-simplify-subject-fuzzy-regexp
1569 (gnus-simplify-buffer-fuzzy-step gnus-simplify-subject-fuzzy-regexp)))
1570 (gnus-simplify-buffer-fuzzy-step "^ *\\[[-+?*!][-+?*!]\\] *")
1571 (gnus-simplify-buffer-fuzzy-step
1573 (gnus-simplify-buffer-fuzzy-step "^[[].*:\\( .*\\)[]]$" "\\1"))
1575 (gnus-simplify-buffer-fuzzy-step " *[[{(][^()\n]*[]})] *$")
1576 (gnus-simplify-buffer-fuzzy-step " +" " ")
1577 (gnus-simplify-buffer-fuzzy-step " $")
1578 (gnus-simplify-buffer-fuzzy-step "^ +")))
1580 (defun gnus-simplify-subject-fuzzy (subject)
1582 See `gnus-simplify-buffer-fuzzy' for details."
1584 (gnus-set-work-buffer)
1587 (when (and gnus-simplify-ignored-prefixes
1588 (string-match gnus-simplify-ignored-prefixes subject))
1591 (inline (gnus-simplify-buffer-fuzzy))
1594 (defsubst gnus-simplify-subject-fully (subject)
1595 "Simplify a subject string according to `gnus-summary-gather-subject-limit'."
1597 (gnus-simplify-subject-functions
1598 (gnus-map-function gnus-simplify-subject-functions subject))
1599 ((null gnus-summary-gather-subject-limit)
1600 (gnus-simplify-subject-re subject))
1601 ((eq gnus-summary-gather-subject-limit 'fuzzy)
1602 (gnus-simplify-subject-fuzzy subject))
1603 ((numberp gnus-summary-gather-subject-limit)
1604 (gnus-limit-string (gnus-simplify-subject-re subject)
1605 gnus-summary-gather-subject-limit))
1609 (defsubst gnus-subject-equal (s1 s2 &optional simple-first)
1615 (equal (gnus-simplify-subject-fully s1)
1616 (gnus-simplify-subject-fully s2)))
1619 (gnus-simplify-subject-fully s2)))))
1621 (defun gnus-summary-bubble-group ()
1623 This is a handy function to add to `gnus-summary-exit-hook' to
1625 (gnus-group-add-score gnus-newsgroup-name))
1633 (put 'gnus-summary-mode 'mode-class 'special)
1635 (defvar gnus-article-commands-menu)
1639 (gnus-define-keys gnus-summary-mode-map
1640 " " gnus-summary-next-page
1641 "\177" gnus-summary-prev-page
1642 [delete] gnus-summary-prev-page
1643 [backspace] gnus-summary-prev-page
1644 "\r" gnus-summary-scroll-up
1645 "\M-\r" gnus-summary-scroll-down
1646 "n" gnus-summary-next-unread-article
1647 "p" gnus-summary-prev-unread-article
1648 "N" gnus-summary-next-article
1649 "P" gnus-summary-prev-article
1650 "\M-\C-n" gnus-summary-next-same-subject
1651 "\M-\C-p" gnus-summary-prev-same-subject
1652 "\M-n" gnus-summary-next-unread-subject
1653 "\M-p" gnus-summary-prev-unread-subject
1654 "." gnus-summary-first-unread-article
1655 "," gnus-summary-best-unread-article
1656 "\M-s" gnus-summary-search-article-forward
1657 "\M-r" gnus-summary-search-article-backward
1658 "<" gnus-summary-beginning-of-article
1659 ">" gnus-summary-end-of-article
1660 "j" gnus-summary-goto-article
1661 "^" gnus-summary-refer-parent-article
1662 "\M-^" gnus-summary-refer-article
1663 "u" gnus-summary-tick-article-forward
1664 "!" gnus-summary-tick-article-forward
1665 "U" gnus-summary-tick-article-backward
1666 "d" gnus-summary-mark-as-read-forward
1667 "D" gnus-summary-mark-as-read-backward
1668 "E" gnus-summary-mark-as-expirable
1669 "\M-u" gnus-summary-clear-mark-forward
1670 "\M-U" gnus-summary-clear-mark-backward
1671 "k" gnus-summary-kill-same-subject-and-select
1672 "\C-k" gnus-summary-kill-same-subject
1673 "\M-\C-k" gnus-summary-kill-thread
1674 "\M-\C-l" gnus-summary-lower-thread
1675 "e" gnus-summary-edit-article
1676 "#" gnus-summary-mark-as-processable
1677 "\M-#" gnus-summary-unmark-as-processable
1678 "\M-\C-t" gnus-summary-toggle-threads
1679 "\M-\C-s" gnus-summary-show-thread
1680 "\M-\C-h" gnus-summary-hide-thread
1681 "\M-\C-f" gnus-summary-next-thread
1682 "\M-\C-b" gnus-summary-prev-thread
1683 [(meta down)] gnus-summary-next-thread
1684 [(meta up)] gnus-summary-prev-thread
1685 "\M-\C-u" gnus-summary-up-thread
1686 "\M-\C-d" gnus-summary-down-thread
1687 "&" gnus-summary-execute-command
1688 "c" gnus-summary-catchup-and-exit
1689 "\C-w" gnus-summary-mark-region-as-read
1690 "\C-t" gnus-summary-toggle-truncation
1691 "?" gnus-summary-mark-as-dormant
1692 "\C-c\M-\C-s" gnus-summary-limit-include-expunged
1693 "\C-c\C-s\C-n" gnus-summary-sort-by-number
1694 "\C-c\C-s\C-l" gnus-summary-sort-by-lines
1695 "\C-c\C-s\C-c" gnus-summary-sort-by-chars
1696 "\C-c\C-s\C-a" gnus-summary-sort-by-author
1697 "\C-c\C-s\C-s" gnus-summary-sort-by-subject
1698 "\C-c\C-s\C-d" gnus-summary-sort-by-date
1699 "\C-c\C-s\C-i" gnus-summary-sort-by-score
1700 "\C-c\C-s\C-o" gnus-summary-sort-by-original
1701 "\C-c\C-s\C-r" gnus-summary-sort-by-random
1702 "=" gnus-summary-expand-window
1703 "\C-x\C-s" gnus-summary-reselect-current-group
1704 "\M-g" gnus-summary-rescan-group
1705 "w" gnus-summary-stop-page-breaking
1706 "\C-c\C-r" gnus-summary-caesar-message
1707 "f" gnus-summary-followup
1708 "F" gnus-summary-followup-with-original
1709 "C" gnus-summary-cancel-article
1710 "r" gnus-summary-reply
1711 "R" gnus-summary-reply-with-original
1712 "\C-c\C-f" gnus-summary-mail-forward
1713 "o" gnus-summary-save-article
1714 "\C-o" gnus-summary-save-article-mail
1715 "|" gnus-summary-pipe-output
1716 "\M-k" gnus-summary-edit-local-kill
1717 "\M-K" gnus-summary-edit-global-kill
1718 ;; "V" gnus-version
1719 "\C-c\C-d" gnus-summary-describe-group
1720 "q" gnus-summary-exit
1721 "Q" gnus-summary-exit-no-update
1722 "\C-c\C-i" gnus-info-find-node
1723 gnus-mouse-2 gnus-mouse-pick-article
1724 [follow-link] mouse-face
1725 "m" gnus-summary-mail-other-window
1726 "a" gnus-summary-post-news
1727 "i" gnus-summary-news-other-window
1728 "x" gnus-summary-limit-to-unread
1729 "s" gnus-summary-isearch-article
1730 "t" gnus-summary-toggle-header
1731 "g" gnus-summary-show-article
1732 "l" gnus-summary-goto-last-article
1733 "\C-c\C-v\C-v" gnus-uu-decode-uu-view
1734 "\C-d" gnus-summary-enter-digest-group
1735 "\M-\C-d" gnus-summary-read-document
1736 "\M-\C-e" gnus-summary-edit-parameters
1737 "\M-\C-a" gnus-summary-customize-parameters
1738 "\C-c\C-b" gnus-bug
1739 "*" gnus-cache-enter-article
1740 "\M-*" gnus-cache-remove-article
1741 "\M-&" gnus-summary-universal-argument
1742 "\C-l" gnus-recenter
1743 "I" gnus-summary-increase-score
1744 "L" gnus-summary-lower-score
1745 "\M-i" gnus-symbolic-argument
1746 "h" gnus-summary-select-article-buffer
1748 "b" gnus-article-view-part
1749 "\M-t" gnus-summary-toggle-display-buttonized
1751 "V" gnus-summary-score-map
1752 "X" gnus-uu-extract-map
1753 "S" gnus-summary-send-map)
1756 (gnus-define-keys (gnus-summary-mark-map "M" gnus-summary-mode-map)
1757 "t" gnus-summary-tick-article-forward
1758 "!" gnus-summary-tick-article-forward
1759 "d" gnus-summary-mark-as-read-forward
1760 "r" gnus-summary-mark-as-read-forward
1761 "c" gnus-summary-clear-mark-forward
1762 " " gnus-summary-clear-mark-forward
1763 "e" gnus-summary-mark-as-expirable
1764 "x" gnus-summary-mark-as-expirable
1765 "?" gnus-summary-mark-as-dormant
1766 "b" gnus-summary-set-bookmark
1767 "B" gnus-summary-remove-bookmark
1768 "#" gnus-summary-mark-as-processable
1769 "\M-#" gnus-summary-unmark-as-processable
1770 "S" gnus-summary-limit-include-expunged
1771 "C" gnus-summary-catchup
1772 "H" gnus-summary-catchup-to-here
1773 "h" gnus-summary-catchup-from-here
1774 "\C-c" gnus-summary-catchup-all
1775 "k" gnus-summary-kill-same-subject-and-select
1776 "K" gnus-summary-kill-same-subject
1777 "P" gnus-uu-mark-map)
1779 (gnus-define-keys (gnus-summary-mscore-map "V" gnus-summary-mark-map)
1780 "c" gnus-summary-clear-above
1781 "u" gnus-summary-tick-above
1782 "m" gnus-summary-mark-above
1783 "k" gnus-summary-kill-below)
1785 (gnus-define-keys (gnus-summary-limit-map "/" gnus-summary-mode-map)
1786 "/" gnus-summary-limit-to-subject
1787 "n" gnus-summary-limit-to-articles
1788 "w" gnus-summary-pop-limit
1789 "s" gnus-summary-limit-to-subject
1790 "a" gnus-summary-limit-to-author
1791 "u" gnus-summary-limit-to-unread
1792 "m" gnus-summary-limit-to-marks
1793 "M" gnus-summary-limit-exclude-marks
1794 "v" gnus-summary-limit-to-score
1795 "*" gnus-summary-limit-include-cached
1796 "D" gnus-summary-limit-include-dormant
1797 "T" gnus-summary-limit-include-thread
1798 "d" gnus-summary-limit-exclude-dormant
1799 "t" gnus-summary-limit-to-age
1800 "." gnus-summary-limit-to-unseen
1801 "x" gnus-summary-limit-to-extra
1802 "p" gnus-summary-limit-to-display-predicate
1803 "E" gnus-summary-limit-include-expunged
1804 "c" gnus-summary-limit-exclude-childless-dormant
1805 "C" gnus-summary-limit-mark-excluded-as-read
1806 "o" gnus-summary-insert-old-articles
1807 "N" gnus-summary-insert-new-articles)
1809 (gnus-define-keys (gnus-summary-goto-map "G" gnus-summary-mode-map)
1810 "n" gnus-summary-next-unread-article
1811 "p" gnus-summary-prev-unread-article
1812 "N" gnus-summary-next-article
1813 "P" gnus-summary-prev-article
1814 "\C-n" gnus-summary-next-same-subject
1815 "\C-p" gnus-summary-prev-same-subject
1816 "\M-n" gnus-summary-next-unread-subject
1817 "\M-p" gnus-summary-prev-unread-subject
1818 "f" gnus-summary-first-unread-article
1819 "b" gnus-summary-best-unread-article
1820 "j" gnus-summary-goto-article
1821 "g" gnus-summary-goto-subject
1822 "l" gnus-summary-goto-last-article
1823 "o" gnus-summary-pop-article)
1825 (gnus-define-keys (gnus-summary-thread-map "T" gnus-summary-mode-map)
1826 "k" gnus-summary-kill-thread
1827 "l" gnus-summary-lower-thread
1828 "i" gnus-summary-raise-thread
1829 "T" gnus-summary-toggle-threads
1830 "t" gnus-summary-rethread-current
1831 "^" gnus-summary-reparent-thread
1832 "s" gnus-summary-show-thread
1833 "S" gnus-summary-show-all-threads
1834 "h" gnus-summary-hide-thread
1835 "H" gnus-summary-hide-all-threads
1836 "n" gnus-summary-next-thread
1837 "p" gnus-summary-prev-thread
1838 "u" gnus-summary-up-thread
1839 "o" gnus-summary-top-thread
1840 "d" gnus-summary-down-thread
1841 "#" gnus-uu-mark-thread
1842 "\M-#" gnus-uu-unmark-thread)
1844 (gnus-define-keys (gnus-summary-buffer-map "Y" gnus-summary-mode-map)
1845 "g" gnus-summary-prepare
1846 "c" gnus-summary-insert-cached-articles
1847 "d" gnus-summary-insert-dormant-articles)
1849 (gnus-define-keys (gnus-summary-exit-map "Z" gnus-summary-mode-map)
1850 "c" gnus-summary-catchup-and-exit
1851 "C" gnus-summary-catchup-all-and-exit
1852 "E" gnus-summary-exit-no-update
1853 "Q" gnus-summary-exit
1854 "Z" gnus-summary-exit
1855 "n" gnus-summary-catchup-and-goto-next-group
1856 "R" gnus-summary-reselect-current-group
1857 "G" gnus-summary-rescan-group
1858 "N" gnus-summary-next-group
1859 "s" gnus-summary-save-newsrc
1860 "P" gnus-summary-prev-group)
1862 (gnus-define-keys (gnus-summary-article-map "A" gnus-summary-mode-map)
1863 " " gnus-summary-next-page
1864 "n" gnus-summary-next-page
1865 "\177" gnus-summary-prev-page
1866 [delete] gnus-summary-prev-page
1867 "p" gnus-summary-prev-page
1868 "\r" gnus-summary-scroll-up
1869 "\M-\r" gnus-summary-scroll-down
1870 "<" gnus-summary-beginning-of-article
1871 ">" gnus-summary-end-of-article
1872 "b" gnus-summary-beginning-of-article
1873 "e" gnus-summary-end-of-article
1874 "^" gnus-summary-refer-parent-article
1875 "r" gnus-summary-refer-parent-article
1876 "D" gnus-summary-enter-digest-group
1877 "R" gnus-summary-refer-references
1878 "T" gnus-summary-refer-thread
1879 "g" gnus-summary-show-article
1880 "s" gnus-summary-isearch-article
1881 "P" gnus-summary-print-article
1882 "M" gnus-mailing-list-insinuate
1883 "t" gnus-article-babel)
1885 (gnus-define-keys (gnus-summary-wash-map "W" gnus-summary-mode-map)
1886 "b" gnus-article-add-buttons
1887 "B" gnus-article-add-buttons-to-head
1888 "o" gnus-article-treat-overstrike
1889 "e" gnus-article-emphasize
1890 "w" gnus-article-fill-cited-article
1891 "Q" gnus-article-fill-long-lines
1892 "C" gnus-article-capitalize-sentences
1893 "c" gnus-article-remove-cr
1894 "q" gnus-article-de-quoted-unreadable
1895 "6" gnus-article-de-base64-unreadable
1896 "Z" gnus-article-decode-HZ
1897 "h" gnus-article-wash-html
1898 "u" gnus-article-unsplit-urls
1899 "s" gnus-summary-force-verify-and-decrypt
1900 "f" gnus-article-display-x-face
1901 "l" gnus-summary-stop-page-breaking
1902 "r" gnus-summary-caesar-message
1903 "m" gnus-summary-morse-message
1904 "t" gnus-summary-toggle-header
1905 "g" gnus-treat-smiley
1906 "v" gnus-summary-verbose-headers
1907 "a" gnus-article-strip-headers-in-body ;; mnemonic: wash archive
1908 "p" gnus-article-verify-x-pgp-sig
1909 "d" gnus-article-treat-dumbquotes)
1911 (gnus-define-keys (gnus-summary-wash-deuglify-map "Y" gnus-summary-wash-map)
1913 "u" gnus-article-outlook-unwrap-lines
1914 "a" gnus-article-outlook-repair-attribution
1915 "c" gnus-article-outlook-rearrange-citation
1916 "f" gnus-article-outlook-deuglify-article) ;; mnemonic: full deuglify
1918 (gnus-define-keys (gnus-summary-wash-hide-map "W" gnus-summary-wash-map)
1919 "a" gnus-article-hide
1920 "h" gnus-article-hide-headers
1921 "b" gnus-article-hide-boring-headers
1922 "s" gnus-article-hide-signature
1923 "c" gnus-article-hide-citation
1924 "C" gnus-article-hide-citation-in-followups
1925 "l" gnus-article-hide-list-identifiers
1926 "B" gnus-article-strip-banner
1927 "P" gnus-article-hide-pem
1928 "\C-c" gnus-article-hide-citation-maybe)
1930 (gnus-define-keys (gnus-summary-wash-highlight-map "H" gnus-summary-wash-map)
1931 "a" gnus-article-highlight
1932 "h" gnus-article-highlight-headers
1933 "c" gnus-article-highlight-citation
1934 "s" gnus-article-highlight-signature)
1936 (gnus-define-keys (gnus-summary-wash-header-map "G" gnus-summary-wash-map)
1937 "f" gnus-article-treat-fold-headers
1938 "u" gnus-article-treat-unfold-headers
1939 "n" gnus-article-treat-fold-newsgroups)
1941 (gnus-define-keys (gnus-summary-wash-display-map "D" gnus-summary-wash-map)
1942 "x" gnus-article-display-x-face
1943 "d" gnus-article-display-face
1944 "s" gnus-treat-smiley
1945 "D" gnus-article-remove-images
1946 "f" gnus-treat-from-picon
1947 "m" gnus-treat-mail-picon
1948 "n" gnus-treat-newsgroups-picon)
1950 (gnus-define-keys (gnus-summary-wash-mime-map "M" gnus-summary-wash-map)
1951 "w" gnus-article-decode-mime-words
1952 "c" gnus-article-decode-charset
1953 "v" gnus-mime-view-all-parts
1954 "b" gnus-article-view-part)
1956 (gnus-define-keys (gnus-summary-wash-time-map "T" gnus-summary-wash-map)
1957 "z" gnus-article-date-ut
1958 "u" gnus-article-date-ut
1959 "l" gnus-article-date-local
1960 "p" gnus-article-date-english
1961 "e" gnus-article-date-lapsed
1962 "o" gnus-article-date-original
1963 "i" gnus-article-date-iso8601
1964 "s" gnus-article-date-user)
1966 (gnus-define-keys (gnus-summary-wash-empty-map "E" gnus-summary-wash-map)
1967 "t" gnus-article-remove-trailing-blank-lines
1968 "l" gnus-article-strip-leading-blank-lines
1969 "m" gnus-article-strip-multiple-blank-lines
1970 "a" gnus-article-strip-blank-lines
1971 "A" gnus-article-strip-all-blank-lines
1972 "s" gnus-article-strip-leading-space
1973 "e" gnus-article-strip-trailing-space
1974 "w" gnus-article-remove-leading-whitespace)
1976 (gnus-define-keys (gnus-summary-help-map "H" gnus-summary-mode-map)
1977 "v" gnus-version
1978 "f" gnus-summary-fetch-faq
1979 "d" gnus-summary-describe-group
1980 "h" gnus-summary-describe-briefly
1981 "i" gnus-info-find-node
1982 "c" gnus-group-fetch-charter
1983 "C" gnus-group-fetch-control)
1985 (gnus-define-keys (gnus-summary-backend-map "B" gnus-summary-mode-map)
1986 "e" gnus-summary-expire-articles
1987 "\M-\C-e" gnus-summary-expire-articles-now
1988 "\177" gnus-summary-delete-article
1989 [delete] gnus-summary-delete-article
1990 [backspace] gnus-summary-delete-article
1991 "m" gnus-summary-move-article
1992 "r" gnus-summary-respool-article
1993 "w" gnus-summary-edit-article
1994 "c" gnus-summary-copy-article
1995 "B" gnus-summary-crosspost-article
1996 "q" gnus-summary-respool-query
1997 "t" gnus-summary-respool-trace
1998 "i" gnus-summary-import-article
1999 "I" gnus-summary-create-article
2000 "p" gnus-summary-article-posted-p)
2002 (gnus-define-keys (gnus-summary-save-map "O" gnus-summary-mode-map)
2003 "o" gnus-summary-save-article
2004 "m" gnus-summary-save-article-mail
2005 "F" gnus-summary-write-article-file
2006 "r" gnus-summary-save-article-rmail
2007 "f" gnus-summary-save-article-file
2008 "b" gnus-summary-save-article-body-file
2009 "B" gnus-summary-write-article-body-file
2010 "h" gnus-summary-save-article-folder
2011 "v" gnus-summary-save-article-vm
2012 "p" gnus-summary-pipe-output
2013 "P" gnus-summary-muttprint
2014 "s" gnus-soup-add-article)
2016 (gnus-define-keys (gnus-summary-mime-map "K" gnus-summary-mode-map)
2017 "b" gnus-summary-display-buttonized
2018 "m" gnus-summary-repair-multipart
2019 "v" gnus-article-view-part
2020 "o" gnus-article-save-part
2021 "c" gnus-article-copy-part
2022 "C" gnus-article-view-part-as-charset
2023 "e" gnus-article-view-part-externally
2024 "E" gnus-article-encrypt-body
2025 "i" gnus-article-inline-part
2026 "|" gnus-article-pipe-part)
2028 (gnus-define-keys (gnus-uu-mark-map "P" gnus-summary-mark-map)
2029 "p" gnus-summary-mark-as-processable
2030 "u" gnus-summary-unmark-as-processable
2031 "U" gnus-summary-unmark-all-processable
2032 "v" gnus-uu-mark-over
2033 "s" gnus-uu-mark-series
2034 "r" gnus-uu-mark-region
2035 "g" gnus-uu-unmark-region
2036 "R" gnus-uu-mark-by-regexp
2037 "G" gnus-uu-unmark-by-regexp
2038 "t" gnus-uu-mark-thread
2039 "T" gnus-uu-unmark-thread
2040 "a" gnus-uu-mark-all
2041 "b" gnus-uu-mark-buffer
2042 "S" gnus-uu-mark-sparse
2043 "k" gnus-summary-kill-process-mark
2044 "y" gnus-summary-yank-process-mark
2045 "w" gnus-summary-save-process-mark
2046 "i" gnus-uu-invert-processable)
2048 (gnus-define-keys (gnus-uu-extract-map "X" gnus-summary-mode-map)
2049 ;;"x" gnus-uu-extract-any
2050 "m" gnus-summary-save-parts
2051 "u" gnus-uu-decode-uu
2052 "U" gnus-uu-decode-uu-and-save
2053 "s" gnus-uu-decode-unshar
2054 "S" gnus-uu-decode-unshar-and-save
2055 "o" gnus-uu-decode-save
2056 "O" gnus-uu-decode-save
2057 "b" gnus-uu-decode-binhex
2058 "B" gnus-uu-decode-binhex
2059 "p" gnus-uu-decode-postscript
2060 "P" gnus-uu-decode-postscript-and-save)
2062 (gnus-define-keys
2063 (gnus-uu-extract-view-map "v" gnus-uu-extract-map)
2064 "u" gnus-uu-decode-uu-view
2065 "U" gnus-uu-decode-uu-and-save-view
2066 "s" gnus-uu-decode-unshar-view
2067 "S" gnus-uu-decode-unshar-and-save-view
2068 "o" gnus-uu-decode-save-view
2069 "O" gnus-uu-decode-save-view
2070 "b" gnus-uu-decode-binhex-view
2071 "B" gnus-uu-decode-binhex-view
2072 "p" gnus-uu-decode-postscript-view
2073 "P" gnus-uu-decode-postscript-and-save-view)
2075 (defvar gnus-article-post-menu nil)
2077 (defconst gnus-summary-menu-maxlen 20)
2079 (defun gnus-summary-menu-split (menu)
2082 (if (> (length menu) (/ (* gnus-summary-menu-maxlen 3) 2))
2086 ;; Pull off the next gnus-summary-menu-maxlen elements
2088 (setq next (nthcdr gnus-summary-menu-maxlen menu))
2090 (setcdr (nthcdr (1- gnus-summary-menu-maxlen) menu)
2101 (defun gnus-summary-make-menu-bar ()
2102 (gnus-turn-off-edit-menu 'summary)
2104 (unless (boundp 'gnus-summary-misc-menu)
2107 gnus-summary-kill-menu gnus-summary-mode-map ""
2112 ["Customize" gnus-score-customize t])
2113 (gnus-make-score-map 'increase)
2114 (gnus-make-score-map 'lower)
2116 ["Kill below" gnus-summary-kill-below t]
2117 ["Mark above" gnus-summary-mark-above t]
2118 ["Tick above" gnus-summary-tick-above t]
2119 ["Clear above" gnus-summary-clear-above t])
2120 ["Current score" gnus-summary-current-score t]
2121 ["Set score" gnus-summary-set-score t]
2122 ["Switch current score file..." gnus-score-change-score-file t]
2123 ["Set mark below..." gnus-score-set-mark-below t]
2124 ["Set expunge below..." gnus-score-set-expunge-below t]
2125 ["Edit current score file" gnus-score-edit-current-scores t]
2126 ["Edit score file" gnus-score-edit-file t]
2127 ["Trace score" gnus-score-find-trace t]
2128 ["Find words" gnus-score-find-favourite-words t]
2129 ["Rescore buffer" gnus-summary-rescore t]
2130 ["Increase score..." gnus-summary-increase-score t]
2131 ["Lower score..." gnus-summary-lower-score t]))))
2134 ;; equivalent Commands menu in the article buffer here for
2138 ["All" gnus-article-hide t]
2139 ["Headers" gnus-article-hide-headers t]
2140 ["Signature" gnus-article-hide-signature t]
2141 ["Citation" gnus-article-hide-citation t]
2142 ["List identifiers" gnus-article-hide-list-identifiers t]
2143 ["Banner" gnus-article-strip-banner t]
2144 ["Boring headers" gnus-article-hide-boring-headers t])
2146 ["All" gnus-article-highlight t]
2147 ["Headers" gnus-article-highlight-headers t]
2148 ["Signature" gnus-article-highlight-signature t]
2149 ["Citation" gnus-article-highlight-citation t])
2151 ["Words" gnus-article-decode-mime-words t]
2152 ["Charset" gnus-article-decode-charset t]
2153 ["QP" gnus-article-de-quoted-unreadable t]
2154 ["Base64" gnus-article-de-base64-unreadable t]
2155 ["View MIME buttons" gnus-summary-display-buttonized t]
2156 ["View all" gnus-mime-view-all-parts t]
2157 ["Verify and Decrypt" gnus-summary-force-verify-and-decrypt t]
2158 ["Encrypt body" gnus-article-encrypt-body
2159 :active (not (gnus-group-read-only-p))
2162 ["Extract all parts..." gnus-summary-save-parts t]
2164 ["Repair multipart" gnus-summary-repair-multipart t]
2165 ["Pipe part..." gnus-article-pipe-part t]
2166 ["Inline part" gnus-article-inline-part t]
2167 ["Encrypt body" gnus-article-encrypt-body
2168 :active (not (gnus-group-read-only-p))
2171 ["View part externally" gnus-article-view-part-externally t]
2172 ["View part with charset..." gnus-article-view-part-as-charset t]
2173 ["Copy part" gnus-article-copy-part t]
2174 ["Save part..." gnus-article-save-part t]
2175 ["View part" gnus-article-view-part t]))
2177 ["Local" gnus-article-date-local t]
2178 ["ISO8601" gnus-article-date-iso8601 t]
2179 ["UT" gnus-article-date-ut t]
2180 ["Original" gnus-article-date-original t]
2181 ["Lapsed" gnus-article-date-lapsed t]
2182 ["User-defined" gnus-article-date-user t])
2184 ["Remove images" gnus-article-remove-images t]
2185 ["Toggle smiley" gnus-treat-smiley t]
2186 ["Show X-Face" gnus-article-display-x-face t]
2187 ["Show picons in From" gnus-treat-from-picon t]
2188 ["Show picons in mail headers" gnus-treat-mail-picon t]
2189 ["Show picons in news headers" gnus-treat-newsgroups-picon t]
2191 ,@(gnus-summary-menu-split
2198 gnus-summary-show-article-from-menu-as-charset-%s" cs))))
2202 (let ((gnus-summary-show-article-charset-alist
2204 (gnus-summary-show-article 1))))
2212 ["Leading" gnus-article-strip-leading-blank-lines t]
2213 ["Multiple" gnus-article-strip-multiple-blank-lines t]
2214 ["Trailing" gnus-article-remove-trailing-blank-lines t]
2215 ["All of the above" gnus-article-strip-blank-lines t]
2216 ["All" gnus-article-strip-all-blank-lines t]
2217 ["Leading space" gnus-article-strip-leading-space t]
2218 ["Trailing space" gnus-article-strip-trailing-space t]
2220 gnus-article-remove-leading-whitespace t])
2221 ["Overstrike" gnus-article-treat-overstrike t]
2222 ["Dumb quotes" gnus-article-treat-dumbquotes t]
2223 ["Emphasis" gnus-article-emphasize t]
2224 ["Word wrap" gnus-article-fill-cited-article t]
2225 ["Fill long lines" gnus-article-fill-long-lines t]
2226 ["Capitalize sentences" gnus-article-capitalize-sentences t]
2227 ["Remove CR" gnus-article-remove-cr t]
2228 ["Quoted-Printable" gnus-article-de-quoted-unreadable t]
2229 ["Base64" gnus-article-de-base64-unreadable t]
2230 ["Rot 13" gnus-summary-caesar-message
2232 '(:help "\"Caesar rotate\" article by 13"))]
2233 ["Morse decode" gnus-summary-morse-message t]
2234 ["Unix pipe..." gnus-summary-pipe-message t]
2235 ["Add buttons" gnus-article-add-buttons t]
2236 ["Add buttons to head" gnus-article-add-buttons-to-head t]
2237 ["Stop page breaking" gnus-summary-stop-page-breaking t]
2238 ["Verbose header" gnus-summary-verbose-headers t]
2239 ["Toggle header" gnus-summary-toggle-header t]
2240 ["Unfold headers" gnus-article-treat-unfold-headers t]
2241 ["Fold newsgroups" gnus-article-treat-fold-newsgroups t]
2242 ["Html" gnus-article-wash-html t]
2243 ["Unsplit URLs" gnus-article-unsplit-urls t]
2244 ["Verify X-PGP-Sig" gnus-article-verify-x-pgp-sig t]
2245 ["Decode HZ" gnus-article-decode-HZ t]
2247 ["Unwrap lines" gnus-article-outlook-unwrap-lines t]
2248 ["Repair attribution" gnus-article-outlook-repair-attribution t]
2249 ["Rearrange citation" gnus-article-outlook-rearrange-citation t]
2251 gnus-article-outlook-deuglify-article t])
2254 ["Save in default format..." gnus-summary-save-article
2256 '(:help "Save article using default method"))]
2257 ["Save in file..." gnus-summary-save-article-file
2259 '(:help "Save article in file"))]
2260 ["Save in Unix mail format..." gnus-summary-save-article-mail t]
2261 ["Save in MH folder..." gnus-summary-save-article-folder t]
2262 ["Save in VM folder..." gnus-summary-save-article-vm t]
2263 ["Save in RMAIL mbox..." gnus-summary-save-article-rmail t]
2264 ["Save body in file..." gnus-summary-save-article-body-file t]
2265 ["Pipe through a filter..." gnus-summary-pipe-output t]
2266 ["Add to SOUP packet" gnus-soup-add-article t]
2267 ["Print with Muttprint..." gnus-summary-muttprint t]
2268 ["Print" gnus-summary-print-article
2274 ["Respool article..." gnus-summary-respool-article t]
2275 ["Move article..." gnus-summary-move-article
2276 (gnus-check-backend-function
2277 'request-move-article gnus-newsgroup-name)]
2278 ["Copy article..." gnus-summary-copy-article t]
2279 ["Crosspost article..." gnus-summary-crosspost-article
2280 (gnus-check-backend-function
2281 'request-replace-article gnus-newsgroup-name)]
2282 ["Import file..." gnus-summary-import-article
2283 (gnus-check-backend-function
2284 'request-accept-article gnus-newsgroup-name)]
2285 ["Create article..." gnus-summary-create-article
2286 (gnus-check-backend-function
2287 'request-accept-article gnus-newsgroup-name)]
2288 ["Check if posted" gnus-summary-article-posted-p t]
2289 ["Edit article" gnus-summary-edit-article
2290 (not (gnus-group-read-only-p))]
2291 ["Delete article" gnus-summary-delete-article
2292 (gnus-check-backend-function
2293 'request-expire-articles gnus-newsgroup-name)]
2294 ["Query respool" gnus-summary-respool-query t]
2295 ["Trace respool" gnus-summary-respool-trace t]
2296 ["Delete expirable articles" gnus-summary-expire-articles-now
2297 (gnus-check-backend-function
2298 'request-expire-articles gnus-newsgroup-name)])
2300 ["Uudecode" gnus-uu-decode-uu
2302 '(:help "Decode uuencoded article(s)"))]
2303 ["Uudecode and save" gnus-uu-decode-uu-and-save t]
2304 ["Unshar" gnus-uu-decode-unshar t]
2305 ["Unshar and save" gnus-uu-decode-unshar-and-save t]
2306 ["Save" gnus-uu-decode-save t]
2307 ["Binhex" gnus-uu-decode-binhex t]
2308 ["Postscript" gnus-uu-decode-postscript t]
2309 ["All MIME parts" gnus-summary-save-parts t])
2311 ["Enter article" gnus-cache-enter-article t]
2312 ["Remove article" gnus-cache-remove-article t])
2313 ["Translate" gnus-article-babel t]
2314 ["Select article buffer" gnus-summary-select-article-buffer t]
2315 ["Enter digest buffer" gnus-summary-enter-digest-group t]
2316 ["Isearch article..." gnus-summary-isearch-article t]
2317 ["Beginning of the article" gnus-summary-beginning-of-article t]
2318 ["End of the article" gnus-summary-end-of-article t]
2319 ["Fetch parent of article" gnus-summary-refer-parent-article t]
2320 ["Fetch referenced articles" gnus-summary-refer-references t]
2321 ["Fetch current thread" gnus-summary-refer-thread t]
2322 ["Fetch article with id..." gnus-summary-refer-article t]
2323 ["Setup Mailing List Params" gnus-mailing-list-insinuate t]
2324 ["Redisplay" gnus-summary-show-article t]
2325 ["Raw article" gnus-summary-show-raw-article :keys "C-u g"])))
2327 gnus-summary-article-menu gnus-summary-mode-map ""
2330 (if (not (keymapp gnus-summary-article-menu))
2332 gnus-article-commands-menu gnus-article-mode-map ""
2335 (setq gnus-article-commands-menu
2336 (copy-keymap gnus-summary-article-menu))
2337 (define-key gnus-article-mode-map [menu-bar commands]
2338 (cons "Commands" gnus-article-commands-menu))))
2341 gnus-summary-thread-menu gnus-summary-mode-map ""
2343 ["Find all messages in thread" gnus-summary-refer-thread t]
2344 ["Toggle threading" gnus-summary-toggle-threads t]
2345 ["Hide threads" gnus-summary-hide-all-threads t]
2346 ["Show threads" gnus-summary-show-all-threads t]
2347 ["Hide thread" gnus-summary-hide-thread t]
2348 ["Show thread" gnus-summary-show-thread t]
2349 ["Go to next thread" gnus-summary-next-thread t]
2350 ["Go to previous thread" gnus-summary-prev-thread t]
2351 ["Go down thread" gnus-summary-down-thread t]
2352 ["Go up thread" gnus-summary-up-thread t]
2353 ["Top of thread" gnus-summary-top-thread t]
2354 ["Mark thread as read" gnus-summary-kill-thread t]
2355 ["Lower thread score" gnus-summary-lower-thread t]
2356 ["Raise thread score" gnus-summary-raise-thread t]
2357 ["Rethread current" gnus-summary-rethread-current t]))
2360 gnus-summary-post-menu gnus-summary-mode-map ""
2362 ["Send a message (mail or news)" gnus-summary-post-news
2365 ["Followup" gnus-summary-followup
2367 '(:help "Post followup to this article"))]
2368 ["Followup and yank" gnus-summary-followup-with-original
2370 '(:help "Post followup to this article, quoting its contents"))]
2371 ["Supersede article" gnus-summary-supersede-article t]
2372 ["Cancel article" gnus-summary-cancel-article
2374 '(:help "Cancel an article you posted"))]
2375 ["Reply" gnus-summary-reply t]
2376 ["Reply and yank" gnus-summary-reply-with-original t]
2377 ["Wide reply" gnus-summary-wide-reply t]
2378 ["Wide reply and yank" gnus-summary-wide-reply-with-original
2380 '(:help "Mail a reply, quoting this article"))]
2381 ["Very wide reply" gnus-summary-very-wide-reply t]
2382 ["Very wide reply and yank" gnus-summary-very-wide-reply-with-original
2384 '(:help "Mail a very wide reply, quoting this article"))]
2385 ["Mail forward" gnus-summary-mail-forward t]
2386 ["Post forward" gnus-summary-post-forward t]
2387 ["Digest and mail" gnus-uu-digest-mail-forward t]
2388 ["Digest and post" gnus-uu-digest-post-forward t]
2389 ["Resend message" gnus-summary-resend-message t]
2390 ["Resend message edit" gnus-summary-resend-message-edit t]
2391 ["Send bounced mail" gnus-summary-resend-bounced-mail t]
2392 ["Send a mail" gnus-summary-mail-other-window t]
2393 ["Create a local message" gnus-summary-news-other-window t]
2394 ["Uuencode and post" gnus-uu-post-news
2396 '(:help "Post a uuencoded article"))]
2397 ["Followup via news" gnus-summary-followup-to-mail t]
2399 gnus-summary-followup-to-mail-with-original t]
2401 ;;["Send" gnus-summary-send-draft t]
2402 ;;["Send bounced" gnus-resend-bounced-mail t])
2406 ((not (keymapp gnus-summary-post-menu))
2407 (setq gnus-article-post-menu gnus-summary-post-menu))
2408 ((not gnus-article-post-menu)
2410 (setq gnus-article-post-menu
2411 (copy-keymap gnus-summary-post-menu))))
2412 (define-key gnus-article-mode-map [menu-bar post]
2413 (cons "Post" gnus-article-post-menu))
2416 gnus-summary-misc-menu gnus-summary-mode-map ""
2419 ["Mark as read" gnus-summary-mark-as-read-forward t]
2421 gnus-summary-kill-same-subject-and-select t]
2422 ["Mark same subject" gnus-summary-kill-same-subject t]
2423 ["Catchup" gnus-summary-catchup
2426 ["Catchup all" gnus-summary-catchup-all t]
2427 ["Catchup to here" gnus-summary-catchup-to-here t]
2428 ["Catchup from here" gnus-summary-catchup-from-here t]
2429 ["Catchup region" gnus-summary-mark-region-as-read
2430 (gnus-mark-active-p)]
2431 ["Mark excluded" gnus-summary-limit-mark-excluded-as-read t])
2433 ["Tick" gnus-summary-tick-article-forward t]
2434 ["Mark as dormant" gnus-summary-mark-as-dormant t]
2435 ["Remove marks" gnus-summary-clear-mark-forward t]
2436 ["Set expirable mark" gnus-summary-mark-as-expirable t]
2437 ["Set bookmark" gnus-summary-set-bookmark t]
2438 ["Remove bookmark" gnus-summary-remove-bookmark t])
2440 ["Marks..." gnus-summary-limit-to-marks t]
2441 ["Subject..." gnus-summary-limit-to-subject t]
2442 ["Author..." gnus-summary-limit-to-author t]
2443 ["Age..." gnus-summary-limit-to-age t]
2444 ["Extra..." gnus-summary-limit-to-extra t]
2445 ["Score..." gnus-summary-limit-to-score t]
2446 ["Display Predicate" gnus-summary-limit-to-display-predicate t]
2447 ["Unread" gnus-summary-limit-to-unread t]
2448 ["Unseen" gnus-summary-limit-to-unseen t]
2449 ["Non-dormant" gnus-summary-limit-exclude-dormant t]
2450 ["Next or process marked articles" gnus-summary-limit-to-articles t]
2451 ["Pop limit" gnus-summary-pop-limit t]
2452 ["Show dormant" gnus-summary-limit-include-dormant t]
2454 gnus-summary-limit-exclude-childless-dormant t]
2455 ;;["Hide thread" gnus-summary-limit-exclude-thread t]
2456 ["Hide marked" gnus-summary-limit-exclude-marks t]
2457 ["Show expunged" gnus-summary-limit-include-expunged t])
2459 ["Set mark" gnus-summary-mark-as-processable t]
2460 ["Remove mark" gnus-summary-unmark-as-processable t]
2461 ["Remove all marks" gnus-summary-unmark-all-processable t]
2462 ["Mark above" gnus-uu-mark-over t]
2463 ["Mark series" gnus-uu-mark-series t]
2464 ["Mark region" gnus-uu-mark-region (gnus-mark-active-p)]
2465 ["Unmark region" gnus-uu-unmark-region (gnus-mark-active-p)]
2466 ["Mark by regexp..." gnus-uu-mark-by-regexp t]
2467 ["Unmark by regexp..." gnus-uu-unmark-by-regexp t]
2468 ["Mark all" gnus-uu-mark-all t]
2469 ["Mark buffer" gnus-uu-mark-buffer t]
2470 ["Mark sparse" gnus-uu-mark-sparse t]
2471 ["Mark thread" gnus-uu-mark-thread t]
2472 ["Unmark thread" gnus-uu-unmark-thread t]
2474 ["Kill" gnus-summary-kill-process-mark t]
2475 ["Yank" gnus-summary-yank-process-mark
2476 gnus-newsgroup-process-stack]
2477 ["Save" gnus-summary-save-process-mark t]
2478 ["Run command on marked..." gnus-summary-universal-argument t]))
2479 ("Scroll article"
2480 ["Page forward" gnus-summary-next-page
2482 '(:help "Show next page of article"))]
2483 ["Page backward" gnus-summary-prev-page
2485 '(:help "Show previous page of article"))]
2486 ["Line forward" gnus-summary-scroll-up t])
2488 ["Next unread article" gnus-summary-next-unread-article t]
2489 ["Previous unread article" gnus-summary-prev-unread-article t]
2490 ["Next article" gnus-summary-next-article t]
2491 ["Previous article" gnus-summary-prev-article t]
2492 ["Next unread subject" gnus-summary-next-unread-subject t]
2493 ["Previous unread subject" gnus-summary-prev-unread-subject t]
2494 ["Next article same subject" gnus-summary-next-same-subject t]
2495 ["Previous article same subject" gnus-summary-prev-same-subject t]
2496 ["First unread article" gnus-summary-first-unread-article t]
2497 ["Best unread article" gnus-summary-best-unread-article t]
2498 ["Go to subject number..." gnus-summary-goto-subject t]
2499 ["Go to article number..." gnus-summary-goto-article t]
2500 ["Go to the last article" gnus-summary-goto-last-article t]
2501 ["Pop article off history" gnus-summary-pop-article t])
2503 ["Sort by number" gnus-summary-sort-by-number t]
2504 ["Sort by author" gnus-summary-sort-by-author t]
2505 ["Sort by subject" gnus-summary-sort-by-subject t]
2506 ["Sort by date" gnus-summary-sort-by-date t]
2507 ["Sort by score" gnus-summary-sort-by-score t]
2508 ["Sort by lines" gnus-summary-sort-by-lines t]
2509 ["Sort by characters" gnus-summary-sort-by-chars t]
2510 ["Randomize" gnus-summary-sort-by-random t]
2511 ["Original sort" gnus-summary-sort-by-original t])
2513 ["Fetch group FAQ" gnus-summary-fetch-faq t]
2514 ["Describe group" gnus-summary-describe-group t]
2515 ["Fetch charter" gnus-group-fetch-charter
2518 ["Fetch control message" gnus-group-fetch-control
2521 ["Read manual" gnus-info-find-node t])
2523 ["Pick and read" gnus-pick-mode t]
2524 ["Binary" gnus-binary-mode t])
2526 ["Regenerate" gnus-summary-prepare t]
2527 ["Insert cached articles" gnus-summary-insert-cached-articles t]
2528 ["Insert dormant articles" gnus-summary-insert-dormant-articles t]
2529 ["Toggle threading" gnus-summary-toggle-threads t])
2530 ["See old articles" gnus-summary-insert-old-articles t]
2531 ["See new articles" gnus-summary-insert-new-articles t]
2532 ["Filter articles..." gnus-summary-execute-command t]
2533 ["Run command on articles..." gnus-summary-universal-argument t]
2534 ["Search articles forward..." gnus-summary-search-article-forward t]
2535 ["Search articles backward..." gnus-summary-search-article-backward t]
2536 ["Toggle line truncation" gnus-summary-toggle-truncation t]
2537 ["Expand window" gnus-summary-expand-window t]
2538 ["Expire expirable articles" gnus-summary-expire-articles
2539 (gnus-check-backend-function
2540 'request-expire-articles gnus-newsgroup-name)]
2541 ["Edit local kill file" gnus-summary-edit-local-kill t]
2542 ["Edit main kill file" gnus-summary-edit-global-kill t]
2543 ["Edit group parameters" gnus-summary-edit-parameters t]
2544 ["Customize group parameters" gnus-summary-customize-parameters t]
2545 ["Send a bug report" gnus-bug t]
2547 ["Catchup and exit" gnus-summary-catchup-and-exit
2550 ["Catchup all and exit" gnus-summary-catchup-all-and-exit t]
2551 ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t]
2552 ["Exit group" gnus-summary-exit
2555 ["Exit group without updating" gnus-summary-exit-no-update t]
2556 ["Exit and goto next group" gnus-summary-next-group t]
2557 ["Exit and goto prev group" gnus-summary-prev-group t]
2558 ["Reselect group" gnus-summary-reselect-current-group t]
2559 ["Rescan group" gnus-summary-rescan-group t]
2560 ["Update dribble" gnus-summary-save-newsrc t])))
2562 (gnus-run-hooks 'gnus-summary-menu-hook)))
2564 (defvar gnus-summary-tool-bar-map nil)
2566 ;; Note: The :set function in the `gnus-summary-tool-bar*' variables will only
2569 (defun gnus-summary-tool-bar-update (&optional symbol value)
2572 (setq-default gnus-summary-tool-bar-map nil)
2576 (when (gnus-buffer-live-p gnus-summary-buffer)
2577 (with-current-buffer gnus-summary-buffer
2578 (gnus-summary-make-tool-bar))))
2580 (defcustom gnus-summary-tool-bar (if (eq gmm-tool-bar-style 'gnome)
2581 'gnus-summary-tool-bar-gnome
2582 'gnus-summary-tool-bar-retro)
2587 default key map is `gnus-summary-mode-map'.
2589 Pre-defined symbols include `gnus-summary-tool-bar-gnome' and
2590 `gnus-summary-tool-bar-retro'."
2591 :type '(choice (const :tag "GNOME style" gnus-summary-tool-bar-gnome)
2592 (const :tag "Retro look" gnus-summary-tool-bar-retro)
2597 :set 'gnus-summary-tool-bar-update
2598 :group 'gnus-summary)
2600 (defcustom gnus-summary-tool-bar-gnome
2601 '((gnus-summary-post-news "mail/compose" nil)
2602 (gnus-summary-insert-new-articles "mail/inbox" nil
2603 :visible (or (not gnus-agent)
2604 gnus-plugged))
2605 (gnus-summary-reply-with-original "mail/reply")
2606 (gnus-summary-reply "mail/reply" nil :visible nil)
2607 (gnus-summary-followup-with-original "mail/reply-all")
2608 (gnus-summary-followup "mail/reply-all" nil :visible nil)
2609 (gnus-summary-mail-forward "mail/forward")
2610 (gnus-summary-save-article "mail/save")
2611 (gnus-summary-search-article-forward "search" nil :visible nil)
2612 (gnus-summary-print-article "print")
2613 (gnus-summary-tick-article-forward "flag-followup" nil :visible nil)
2615 (gnus-summary-save-newsrc "save" nil :visible nil)
2616 ;; (gnus-summary-show-article "stock_message-display" nil :visible nil)
2617 (gnus-summary-prev-article "left-arrow")
2618 (gnus-summary-next-article "right-arrow")
2619 (gnus-summary-next-page "next-page")
2620 ;; (gnus-summary-enter-digest-group "right_arrow" nil :visible nil)
2623 ;; (gnus-summary-sort-by-author "sort-a-z" nil :visible nil)
2624 ;; (gnus-summary-sort-by-date "sort-1-9" nil :visible nil)
2625 (gnus-summary-mark-as-expirable
2627 :visible (gnus-check-backend-function 'request-expire-articles
2628 gnus-newsgroup-name))
2629 (gnus-summary-mark-as-spam
2632 (spam-group-ham-contents-p gnus-newsgroup-name))
2634 (gnus-summary-mark-as-read-forward
2637 (spam-group-spam-contents-p gnus-newsgroup-name)))
2639 (gnus-summary-exit "exit")
2641 (gnus-info-find-node "help"))
2648 :set 'gnus-summary-tool-bar-update
2649 :group 'gnus-summary)
2651 (defcustom gnus-summary-tool-bar-retro
2652 '((gnus-summary-prev-unread-article "gnus/prev-ur")
2653 (gnus-summary-next-unread-article "gnus/next-ur")
2654 (gnus-summary-post-news "gnus/post")
2655 (gnus-summary-followup-with-original "gnus/fuwo")
2656 (gnus-summary-followup "gnus/followup")
2657 (gnus-summary-reply-with-original "gnus/reply-wo")
2658 (gnus-summary-reply "gnus/reply")
2659 (gnus-summary-caesar-message "gnus/rot13")
2660 (gnus-uu-decode-uu "gnus/uu-decode")
2661 (gnus-summary-save-article-file "gnus/save-aif")
2662 (gnus-summary-save-article "gnus/save-art")
2663 (gnus-uu-post-news "gnus/uu-post")
2664 (gnus-summary-catchup "gnus/catchup")
2665 (gnus-summary-catchup-and-exit "gnus/cu-exit")
2666 (gnus-summary-exit "gnus/exit-summ")
2668 (gnus-summary-print-article "gnus/print" nil :visible nil)
2669 (gnus-summary-mark-as-expirable "gnus/close" nil :visible nil)
2670 (gnus-summary-save-newsrc "gnus/save" nil :visible nil)
2671 ;; (gnus-summary-enter-digest-group "gnus/right_arrow" nil :visible nil)
2672 (gnus-summary-search-article-forward "gnus/search" nil :visible nil)
2673 ;; (gnus-summary-insert-new-articles "gnus/paste" nil :visible nil)
2674 ;; (gnus-summary-toggle-threads "gnus/open" nil :visible nil)
2676 (gnus-info-find-node "gnus/help" nil :visible nil))
2683 :set 'gnus-summary-tool-bar-update
2684 :group 'gnus-summary)
2686 (defcustom gnus-summary-tool-bar-zap-list t
2694 :set 'gnus-summary-tool-bar-update
2695 :group 'gnus-summary)
2699 (defun gnus-summary-make-tool-bar (&optional force)
2700 "Make a summary mode tool bar from `gnus-summary-tool-bar'.
2705 (or (not gnus-summary-tool-bar-map) force))
2707 (gmm-image-load-path-for-library "gnus"
2713 (map (gmm-tool-bar-from-list gnus-summary-tool-bar
2714 gnus-summary-tool-bar-zap-list
2715 'gnus-summary-mode-map)))
2717 ;; Need to set `gnus-summary-tool-bar-map' because `gnus-article-mode'
2719 (setq gnus-summary-tool-bar-map map))))
2720 (set (make-local-variable 'tool-bar-map) gnus-summary-tool-bar-map))
2722 (defun gnus-score-set-default (var value)
2728 (defun gnus-make-score-map (type)
2734 ("article body" "body" string)
2735 ("article head" "head" string)
2782 'gnus-summary-score-entry
2789 (list 'gnus-summary-header
2792 (list 'gnus-score-delta-default
2810 (defun gnus-summary-mode (&optional group)
2814 \\<gnus-summary-mode-map>
2815 Each line in this buffer represents one article. To read an
2816 article, you can, for instance, type `\\[gnus-summary-next-page]'. To move forwards
2817 and backwards while displaying articles, type `\\[gnus-summary-next-unread-article]' and `\\[gnus-summary-prev-unread-article]',
2821 follow up an article, type `\\[gnus-summary-followup]'. To mail a reply to the author
2822 of an article, type `\\[gnus-summary-reply]'.
2825 buffer; read the info pages for more information (`\\[gnus-info-find-node]').
2829 \\{gnus-summary-mode-map}"
2832 (when (gnus-visual-p 'summary-menu 'menu)
2833 (gnus-summary-make-menu-bar)
2834 (gnus-summary-make-tool-bar))
2835 (gnus-summary-make-local-variables)
2836 (let ((gnus-summary-local-variables gnus-newsgroup-variables))
2837 (gnus-summary-make-local-variables))
2838 (gnus-make-thread-indent-array)
2839 (gnus-simplify-mode-line)
2840 (setq major-mode 'gnus-summary-mode)
2843 (use-local-map gnus-summary-mode-map)
2847 (setq selective-display t)
2848 (setq selective-display-ellipses t) ;Display `...'
2849 (gnus-summary-set-display-table)
2850 (gnus-set-default-directory)
2851 (setq gnus-newsgroup-name group)
2852 (make-local-variable 'gnus-summary-line-format)
2853 (make-local-variable 'gnus-summary-line-format-spec)
2854 (make-local-variable 'gnus-summary-dummy-line-format)
2855 (make-local-variable 'gnus-summary-dummy-line-format-spec)
2856 (make-local-variable 'gnus-summary-mark-positions)
2857 (gnus-make-local-hook 'pre-command-hook)
2858 (add-hook 'pre-command-hook 'gnus-set-global-variables nil t)
2859 (gnus-run-mode-hooks 'gnus-summary-mode-hook)
2860 (turn-on-gnus-mailing-list-mode)
2862 (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy)
2863 (gnus-update-summary-mark-positions))
2865 (defun gnus-summary-make-local-variables ()
2868 (dolist (local gnus-summary-local-variables)
2880 (defun gnus-summary-clear-local-variables ()
2881 (let ((locals gnus-summary-local-variables))
2892 (defmacro gnus-data-number (data)
2895 (defmacro gnus-data-set-number (data number)
2898 (defmacro gnus-data-mark (data)
2901 (defmacro gnus-data-set-mark (data mark)
2904 (defmacro gnus-data-pos (data)
2907 (defmacro gnus-data-set-pos (data pos)
2910 (defmacro gnus-data-header (data)
2913 (defmacro gnus-data-set-header (data header)
2916 (defmacro gnus-data-level (data)
2919 (defmacro gnus-data-unread-p (data)
2920 `(= (nth 1 ,data) gnus-unread-mark))
2922 (defmacro gnus-data-read-p (data)
2923 `(/= (nth 1 ,data) gnus-unread-mark))
2925 (defmacro gnus-data-pseudo-p (data)
2928 (defmacro gnus-data-find (number)
2929 `(assq ,number gnus-newsgroup-data))
2931 (defmacro gnus-data-find-list (number &optional data)
2932 `(let ((bdata ,(or data 'gnus-newsgroup-data)))
2936 (defmacro gnus-data-make (number mark pos header level)
2939 (defun gnus-data-enter (after-article number mark pos header level offset)
2940 (let ((data (gnus-data-find-list after-article)))
2942 (error "No such article: %d" after-article))
2943 (setcdr data (cons (gnus-data-make number mark pos header level)
2945 (setq gnus-newsgroup-data-reverse nil)
2946 (gnus-data-update-list (cddr data) offset)))
2948 (defun gnus-data-enter-list (after-article list &optional offset)
2950 (let ((data (and after-article (gnus-data-find-list after-article)))
2953 after-article))
2954 (let ((odata gnus-newsgroup-data))
2955 (setq gnus-newsgroup-data (nconc list gnus-newsgroup-data))
2957 (gnus-data-update-list odata offset)))
2964 (setcdr list gnus-newsgroup-data)
2965 (setq gnus-newsgroup-data ilist)
2967 (gnus-data-update-list (cdr list) offset)))
2971 (gnus-data-update-list (cdr list) offset))))
2972 (setq gnus-newsgroup-data-reverse nil))))
2974 (defun gnus-data-remove (article &optional offset)
2975 (let ((data gnus-newsgroup-data))
2976 (if (= (gnus-data-number (car data)) article)
2978 (setq gnus-newsgroup-data (cdr gnus-newsgroup-data)
2979 gnus-newsgroup-data-reverse nil)
2981 (gnus-data-update-list gnus-newsgroup-data offset)))
2983 (when (= (gnus-data-number (cadr data)) article)
2986 (gnus-data-update-list (cdr data) offset))
2988 gnus-newsgroup-data-reverse nil))
2991 (defmacro gnus-data-list (backward)
2993 (or gnus-newsgroup-data-reverse
2994 (setq gnus-newsgroup-data-reverse
2995 (reverse gnus-newsgroup-data)))
2996 gnus-newsgroup-data))
2998 (defun gnus-data-update-list (data offset)
3000 (setq gnus-newsgroup-data-reverse nil)
3005 (defun gnus-summary-article-pseudo-p (article)
3006 "Say whether this article is a pseudo article or not."
3007 (not (vectorp (gnus-data-header (gnus-data-find article)))))
3009 (defmacro gnus-summary-article-sparse-p (article)
3010 "Say whether this article is a sparse article or not."
3011 `(memq ,article gnus-newsgroup-sparse))
3013 (defmacro gnus-summary-article-ancient-p (article)
3014 "Say whether this article is a sparse article or not."
3015 `(memq ,article gnus-newsgroup-ancient))
3017 (defun gnus-article-parent-p (number)
3018 "Say whether this article is a parent or not."
3019 (let ((data (gnus-data-find-list number)))
3020 (and (cdr data) ; There has to be an article after...
3021 (< (gnus-data-level (car data)) ; And it has to have a higher level.
3022 (gnus-data-level (nth 1 data))))))
3024 (defun gnus-article-children (number)
3026 (let* ((data (gnus-data-find-list number))
3027 (level (gnus-data-level (car data)))
3031 (= (gnus-data-level (car data)) (1+ level)))
3032 (push (gnus-data-number (car data)) children)
3036 (defmacro gnus-summary-skip-intangible ()
3037 "If the current article is intangible, then jump to a different article."
3038 '(let ((to (get-text-property (point) 'gnus-intangible)))
3039 (and to (gnus-summary-goto-subject to))))
3041 (defmacro gnus-summary-article-intangible-p ()
3042 "Say whether this article is intangible or not."
3043 '(get-text-property (point) 'gnus-intangible))
3045 (defun gnus-article-read-p (article)
3047 (not (or (memq article gnus-newsgroup-marked)
3048 (memq article gnus-newsgroup-spam-marked)
3049 (memq article gnus-newsgroup-unreads)
3050 (memq article gnus-newsgroup-unselected)
3051 (memq article gnus-newsgroup-dormant))))
3055 (defmacro gnus-summary-article-number ()
3056 "The article number of the article on the current line.
3057 If there isn't an article number here, then we return the current
3058 article number."
3060 (gnus-summary-skip-intangible)
3061 (or (get-text-property (point) 'gnus-number)
3062 (gnus-summary-last-subject))))
3064 (defmacro gnus-summary-article-header (&optional number)
3065 "Return the header of article NUMBER."
3066 `(gnus-data-header (gnus-data-find
3067 ,(or number '(gnus-summary-article-number)))))
3069 (defmacro gnus-summary-thread-level (&optional number)
3070 "Return the level of thread that starts with article NUMBER."
3071 `(if (and (eq gnus-summary-make-false-root 'dummy)
3072 (get-text-property (point) 'gnus-intangible))
3074 (gnus-data-level (gnus-data-find
3075 ,(or number '(gnus-summary-article-number))))))
3077 (defmacro gnus-summary-article-mark (&optional number)
3078 "Return the mark of article NUMBER."
3079 `(gnus-data-mark (gnus-data-find
3080 ,(or number '(gnus-summary-article-number)))))
3082 (defmacro gnus-summary-article-pos (&optional number)
3083 "Return the position of the line of article NUMBER."
3084 `(gnus-data-pos (gnus-data-find
3085 ,(or number '(gnus-summary-article-number)))))
3087 (defalias 'gnus-summary-subject-string 'gnus-summary-article-subject)
3088 (defmacro gnus-summary-article-subject (&optional number)
3092 `(gnus-data-header (assq ,number gnus-newsgroup-data))
3093 '(gnus-data-header (assq (gnus-summary-article-number)
3094 gnus-newsgroup-data)))))
3099 (defmacro gnus-summary-article-score (&optional number)
3100 "Return current article score."
3101 `(or (cdr (assq ,(or number '(gnus-summary-article-number))
3102 gnus-newsgroup-scored))
3103 gnus-summary-default-score 0))
3105 (defun gnus-summary-article-children (&optional number)
3106 "Return a list of article numbers that are children of article NUMBER."
3107 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number))))
3108 (level (gnus-data-level (car data)))
3111 (> (setq l (gnus-data-level (car data))) level))
3113 (push (gnus-data-number (car data))
3117 (defun gnus-summary-article-parent (&optional number)
3118 "Return the article number of the parent of article NUMBER."
3119 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number))
3120 (gnus-data-list t)))
3121 (level (gnus-data-level (car data))))
3124 ;; We search until we find an article with a level less than
3127 (not (< (gnus-data-level (car data)) level))))
3128 (and data (gnus-data-number (car data))))))
3130 (defun gnus-unread-mark-p (mark)
3132 (= mark gnus-unread-mark))
3134 (defun gnus-read-mark-p (mark)
3137 (not (or (= mark gnus-unread-mark)
3138 (= mark gnus-ticked-mark)
3139 (= mark gnus-spam-mark)
3140 (= mark gnus-dormant-mark)
3141 (= mark gnus-expirable-mark))))
3143 (defmacro gnus-article-mark (number)
3144 "Return the MARK of article NUMBER.
3147 `gnus-summary-article-mark' should be used to examine the
3150 ((memq ,number gnus-newsgroup-unsendable) gnus-unsendable-mark)
3151 ((memq ,number gnus-newsgroup-downloadable) gnus-downloadable-mark)
3152 ((memq ,number gnus-newsgroup-unreads) gnus-unread-mark)
3153 ((memq ,number gnus-newsgroup-marked) gnus-ticked-mark)
3154 ((memq ,number gnus-newsgroup-spam-marked) gnus-spam-mark)
3155 ((memq ,number gnus-newsgroup-dormant) gnus-dormant-mark)
3156 ((memq ,number gnus-newsgroup-expirable) gnus-expirable-mark)
3157 (t (or (cdr (assq ,number gnus-newsgroup-reads))
3158 gnus-ancient-mark))))
3162 (defmacro gnus-save-hidden-threads (&rest forms)
3165 `(let ((,config (gnus-hidden-threads-configuration)))
3169 (gnus-restore-hidden-threads-configuration ,config)))))
3170 (put 'gnus-save-hidden-threads 'lisp-indent-function 0)
3171 (put 'gnus-save-hidden-threads 'edebug-form-spec '(body))
3173 (defun gnus-data-compute-positions ()
3175 (setq gnus-newsgroup-data-reverse nil)
3176 (let ((data gnus-newsgroup-data))
3178 (gnus-save-hidden-threads
3179 (gnus-summary-show-all-threads)
3182 (while (get-text-property (point) 'gnus-intangible)
3184 (gnus-data-set-pos (car data) (+ (point) 3))
3188 (defun gnus-hidden-threads-configuration ()
3197 (defun gnus-restore-hidden-threads-configuration (config)
3209 (defun gnus-mouse-pick-article (e)
3212 (gnus-summary-next-page nil t))
3214 (defun gnus-summary-set-display-table ()
3215 "Change the display table.
3218 display only a single character."
3220 ;; We start from the standard display table, if any.
3221 (let ((table (or (copy-sequence standard-display-table)
3222 (make-display-table)))
3228 ;; selective display).
3242 (setq buffer-display-table table)))
3244 (defun gnus-summary-set-article-display-arrow (pos)
3246 (when (and gnus-summary-display-arrow
3259 (defun gnus-summary-setup-buffer (group)
3261 (let ((buffer (gnus-summary-buffer-name group))
3263 (gnus-group-decoded-name group) "*")))
3265 (when (gnus-buffer-live-p dead-name)
3266 (gnus-kill-buffer dead-name))
3270 (setq gnus-summary-buffer (current-buffer))
3271 (not gnus-newsgroup-prepared))
3273 (setq gnus-summary-buffer (set-buffer (gnus-get-buffer-create buffer)))
3274 (gnus-summary-mode group)
3275 (when gnus-carpal
3276 (gnus-carpal-setup-buffer 'summary))
3277 (unless gnus-single-article-buffer
3278 (make-local-variable 'gnus-article-buffer)
3279 (make-local-variable 'gnus-article-current)
3280 (make-local-variable 'gnus-original-article-buffer))
3281 (setq gnus-newsgroup-name group)
3283 (gnus-summary-set-local-parameters gnus-newsgroup-name)
3286 (defun gnus-set-global-variables ()
3289 buffer that was in action when the last article was fetched."
3290 (when (eq major-mode 'gnus-summary-mode)
3291 (setq gnus-summary-buffer (current-buffer))
3292 (let ((name gnus-newsgroup-name)
3293 (marked gnus-newsgroup-marked)
3294 (spam gnus-newsgroup-spam-marked)
3295 (unread gnus-newsgroup-unreads)
3296 (headers gnus-current-headers)
3297 (data gnus-newsgroup-data)
3298 (summary gnus-summary-buffer)
3299 (article-buffer gnus-article-buffer)
3300 (original gnus-original-article-buffer)
3301 (gac gnus-article-current)
3302 (reffed gnus-reffed-article-number)
3303 (score-file gnus-current-score-file)
3304 (default-charset gnus-newsgroup-charset)
3306 (let ((locals gnus-newsgroup-variables))
3314 (set-buffer gnus-group-buffer)
3315 (setq gnus-newsgroup-name name
3316 gnus-newsgroup-marked marked
3317 gnus-newsgroup-spam-marked spam
3318 gnus-newsgroup-unreads unread
3319 gnus-current-headers headers
3320 gnus-newsgroup-data data
3321 gnus-article-current gac
3322 gnus-summary-buffer summary
3323 gnus-article-buffer article-buffer
3324 gnus-original-article-buffer original
3325 gnus-reffed-article-number reffed
3326 gnus-current-score-file score-file
3327 gnus-newsgroup-charset default-charset)
3328 (let ((locals gnus-newsgroup-variables))
3334 ;; The article buffer also has local variables.
3335 (when (gnus-buffer-live-p gnus-article-buffer)
3336 (set-buffer gnus-article-buffer)
3337 (setq gnus-summary-buffer summary))))))
3339 (defun gnus-summary-article-unread-p (article)
3341 (memq article gnus-newsgroup-unreads))
3343 (defun gnus-summary-first-article-p (&optional article)
3344 "Return whether ARTICLE is the first article in the buffer."
3345 (if (not (setq article (or article (gnus-summary-article-number))))
3347 (eq article (caar gnus-newsgroup-data))))
3349 (defun gnus-summary-last-article-p (&optional article)
3350 "Return whether ARTICLE is the last article in the buffer."
3351 (if (not (setq article (or article (gnus-summary-article-number))))
3352 ;; All non-existent numbers are the last article. :-)
3354 (not (cdr (gnus-data-find-list article)))))
3356 (defun gnus-make-thread-indent-array (&optional n)
3359 (null gnus-thread-indent-array)
3360 (/= gnus-thread-indent-level gnus-thread-indent-array-level))
3361 (setq gnus-thread-indent-array (make-vector (1+ n) "")
3362 gnus-thread-indent-array-level gnus-thread-indent-level)
3364 (aset gnus-thread-indent-array n
3365 (make-string (* n gnus-thread-indent-level) ? ))
3368 (defun gnus-update-summary-mark-positions ()
3371 (when (gnus-buffer-exists-p gnus-summary-buffer)
3372 (set-buffer gnus-summary-buffer))
3373 (let ((spec gnus-summary-line-format-spec)
3376 (gnus-set-work-buffer)
3377 (let ((gnus-tmp-unread ?Z)
3378 (gnus-replied-mark ?Z)
3379 (gnus-score-below-mark ?Z)
3380 (gnus-score-over-mark ?Z)
3381 (gnus-undownloaded-mark ?Z)
3382 (gnus-summary-line-format-spec spec)
3383 (gnus-newsgroup-downloadable '(0))
3387 (gnus-summary-insert-line header
3388 0 nil t gnus-tmp-unread t nil "" nil 1)
3396 (setq gnus-tmp-unread ?A
3397 gnus-replied-mark ?B
3398 gnus-score-below-mark ?C
3399 gnus-score-over-mark ?C
3400 gnus-undownloaded-mark ?D)
3401 (gnus-summary-insert-line header
3402 0 nil t gnus-tmp-unread t nil "" nil 1)
3423 (setq gnus-summary-mark-positions pos))))
3425 (defun gnus-summary-insert-dummy-line (gnus-tmp-subject gnus-tmp-number)
3428 (gnus-add-text-properties
3429 (point) (progn (eval gnus-summary-dummy-line-format-spec) (point))
3430 (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number)))
3432 (defun gnus-summary-extract-address-component (from)
3433 (or (car (funcall gnus-extract-address-components from))
3436 (defun gnus-summary-from-or-to-or-newsgroups (header gnus-tmp-from)
3437 (let ((mail-parse-charset gnus-newsgroup-charset)
3441 (save-excursion (set-buffer gnus-summary-buffer)
3442 gnus-newsgroup-ignored-charsets)))
3444 (and gnus-ignored-from-addresses
3445 (string-match gnus-ignored-from-addresses gnus-tmp-from)
3453 (gnus-summary-extract-address-component
3454 (funcall gnus-decode-encoded-address-function to)))))
3457 (inline (gnus-summary-extract-address-component gnus-tmp-from)))))
3459 (defun gnus-summary-insert-line (gnus-tmp-header
3460 gnus-tmp-level gnus-tmp-current
3461 undownloaded gnus-tmp-unread gnus-tmp-replied
3462 gnus-tmp-expirable gnus-tmp-subject-or-nil
3463 &optional gnus-tmp-dummy gnus-tmp-score
3464 gnus-tmp-process)
3465 (if (>= gnus-tmp-level (length gnus-thread-indent-array))
3466 (gnus-make-thread-indent-array (max (* 2 (length gnus-thread-indent-array))
3467 gnus-tmp-level)))
3468 (let* ((gnus-tmp-indentation (aref gnus-thread-indent-array gnus-tmp-level))
3469 (gnus-tmp-lines (mail-header-lines gnus-tmp-header))
3470 (gnus-tmp-score (or gnus-tmp-score gnus-summary-default-score 0))
3471 (gnus-tmp-score-char
3472 (if (or (null gnus-summary-default-score)
3473 (<= (abs (- gnus-tmp-score gnus-summary-default-score))
3474 gnus-summary-zcore-fuzz))
3476 (if (< gnus-tmp-score gnus-summary-default-score)
3477 gnus-score-below-mark gnus-score-over-mark)))
3478 (gnus-tmp-number (mail-header-number gnus-tmp-header))
3479 (gnus-tmp-replied
3480 (cond (gnus-tmp-process gnus-process-mark)
3481 ((memq gnus-tmp-current gnus-newsgroup-cached)
3482 gnus-cached-mark)
3483 (gnus-tmp-replied gnus-replied-mark)
3484 ((memq gnus-tmp-current gnus-newsgroup-forwarded)
3485 gnus-forwarded-mark)
3486 ((memq gnus-tmp-current gnus-newsgroup-saved)
3487 gnus-saved-mark)
3488 ((memq gnus-tmp-number gnus-newsgroup-recent)
3489 gnus-recent-mark)
3490 ((memq gnus-tmp-number gnus-newsgroup-unseen)
3491 gnus-unseen-mark)
3492 (t gnus-no-mark)))
3493 (gnus-tmp-downloaded
3495 gnus-undownloaded-mark)
3496 (gnus-newsgroup-agentized
3497 gnus-downloaded-mark)
3499 gnus-no-mark)))
3500 (gnus-tmp-from (mail-header-from gnus-tmp-header))
3501 (gnus-tmp-name
3503 ((string-match "<[^>]+> *$" gnus-tmp-from)
3505 (or (and (string-match "^\".+\"" gnus-tmp-from)
3506 (substring gnus-tmp-from 1 (1- (match-end 0))))
3507 (substring gnus-tmp-from 0 beg))))
3508 ((string-match "(.+)" gnus-tmp-from)
3509 (substring gnus-tmp-from
3511 (t gnus-tmp-from)))
3512 (gnus-tmp-subject (mail-header-subject gnus-tmp-header))
3513 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[))
3514 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\]))
3516 (when (string= gnus-tmp-name "")
3517 (setq gnus-tmp-name gnus-tmp-from))
3518 (unless (numberp gnus-tmp-lines)
3519 (setq gnus-tmp-lines -1))
3520 (if (= gnus-tmp-lines -1)
3521 (setq gnus-tmp-lines "?")
3522 (setq gnus-tmp-lines (number-to-string gnus-tmp-lines)))
3523 (gnus-put-text-property
3525 (progn (eval gnus-summary-line-format-spec) (point))
3526 'gnus-number gnus-tmp-number)
3527 (when (gnus-visual-p 'summary-highlight 'highlight)
3529 (gnus-run-hooks 'gnus-summary-update-hook)
3532 (defun gnus-summary-update-line (&optional dont-update)
3534 (when (and gnus-summary-default-score
3535 (not gnus-summary-inhibit-highlight))
3536 (let* ((gnus-summary-inhibit-highlight t) ; Prevent recursion.
3537 (article (gnus-summary-article-number))
3538 (score (gnus-summary-article-score article)))
3540 (if (and gnus-summary-mark-below
3541 (< (gnus-summary-article-score)
3542 gnus-summary-mark-below))
3543 ;; This article has a low score, so we mark it as read.
3544 (when (memq article gnus-newsgroup-unreads)
3545 (gnus-summary-mark-article-as-read gnus-low-score-mark))
3546 (when (eq (gnus-summary-article-mark) gnus-low-score-mark)
3547 ;; This article was previously marked as read on account
3550 (gnus-summary-mark-article-as-unread gnus-unread-mark)))
3551 (gnus-summary-update-mark
3552 (if (or (null gnus-summary-default-score)
3553 (<= (abs (- score gnus-summary-default-score))
3554 gnus-summary-zcore-fuzz))
3556 (if (< score gnus-summary-default-score)
3557 gnus-score-below-mark gnus-score-over-mark))
3560 (when (gnus-visual-p 'summary-highlight 'highlight)
3561 (gnus-run-hooks 'gnus-summary-update-hook)))))
3563 (defvar gnus-tmp-new-adopts nil)
3565 (defun gnus-summary-number-of-articles-in-thread (thread &optional level char)
3577 'gnus-summary-number-of-articles-in-thread (cdr thread))))
3580 ((memq (mail-header-number (car thread)) gnus-newsgroup-limit)
3583 (when (and level (zerop level) gnus-tmp-new-adopts)
3586 'gnus-summary-number-of-articles-in-thread
3587 gnus-tmp-new-adopts))))
3589 (if (> number 1) gnus-not-empty-thread-mark
3590 gnus-empty-thread-mark)
3593 (defsubst gnus-summary-line-message-size (head)
3596 `gnus-summary-line-format-alist'."
3605 (defun gnus-summary-set-local-parameters (group)
3607 (let ((params (gnus-group-find-parameter group))
3622 (defun gnus-summary-read-group (group &optional show-all no-article
3623 kill-buffer no-display backward
3627 If NO-ARTICLE is non-nil, no article is selected initially.
3632 (let ((gnus-auto-select-next nil))
3633 (or (gnus-summary-read-group-1
3634 group show-all no-article
3635 kill-buffer no-display
3639 (eq gnus-auto-select-next 'quietly))
3640 (set-buffer gnus-group-buffer)
3645 (gnus-group-prev-unread-group 2))
3646 (if (not (equal group (gnus-group-group-name)))
3647 (setq group (gnus-group-group-name))
3651 (defun gnus-summary-read-group-1 (group show-all no-article
3652 kill-buffer no-display
3655 ;; (when (and (not (gnus-group-native-p group))
3656 ;; (not (gnus-gethash group gnus-newsrc-hashtb)))
3658 (gnus-message 5 "Retrieving newsgroup: %s..."
3659 (gnus-group-decoded-name group))
3660 (let* ((new-group (gnus-summary-setup-buffer group))
3661 (quit-config (gnus-group-quit-config group))
3662 (did-select (and new-group (gnus-select-newsgroup
3667 (gnus-set-global-variables)
3669 (gnus-kill-or-deaden-summary kill-buffer))
3670 (gnus-configure-windows 'summary 'force)
3671 (gnus-set-mode-line 'summary)
3672 (gnus-summary-position-point)
3677 (when (and (eq major-mode 'gnus-summary-mode)
3684 (gnus-summary-update-info)
3685 (set-buffer gnus-group-buffer)
3686 (gnus-group-jump-to-group group)
3687 (gnus-group-next-unread-group 1))
3688 (gnus-handle-ephemeral-exit quit-config)))
3689 (let ((grpinfo (gnus-get-info group)))
3690 (if (null (gnus-info-read grpinfo))
3691 (gnus-message 3 "Group %s contains no messages"
3692 (gnus-group-decoded-name group))
3693 (gnus-message 3 "Can't select group")))
3698 (and (eq major-mode 'gnus-summary-mode)
3702 (gnus-kill-or-deaden-summary kill-buffer))
3705 (set-buffer gnus-group-buffer)
3706 (gnus-group-jump-to-group group)
3707 (gnus-group-next-unread-group 1)
3708 (gnus-configure-windows 'group 'force))
3709 (gnus-handle-ephemeral-exit quit-config))
3714 (gnus-set-global-variables)
3716 (setq gnus-newsgroup-active
3717 (gnus-copy-sequence
3718 (gnus-active gnus-newsgroup-name)))
3720 (gnus-run-hooks 'gnus-select-group-hook)
3721 (when (memq 'summary (gnus-update-format-specifications
3725 (gnus-update-summary-mark-positions))
3727 (when gnus-use-scoring
3728 (gnus-possibly-score-headers))
3730 (when gnus-build-sparse-threads
3731 (gnus-build-sparse-threads))
3734 (let ((gnus-newsgroup-dormant nil))
3735 (gnus-summary-initial-limit show-all))
3736 (gnus-summary-initial-limit show-all))
3738 (unless no-display
3739 (gnus-summary-prepare))
3740 (when gnus-use-trees
3741 (gnus-tree-open group)
3742 (setq gnus-summary-highlight-line-function
3743 'gnus-tree-highlight-article))
3748 (not no-display))
3749 (cond (gnus-newsgroup-dormant
3750 (gnus-summary-limit-include-dormant))
3751 ((and gnus-newsgroup-scored show-all)
3752 (gnus-summary-limit-include-expunged t))))
3753 ;; Function `gnus-apply-kill-file' must be called in this hook.
3754 (gnus-run-hooks 'gnus-apply-kill-hook)
3756 (not no-display))
3759 (gnus-summary-catchup-and-exit nil t)
3760 (gnus-message 6 "No unread news")
3762 (gnus-kill-or-deaden-summary kill-buffer))
3766 ;; gnus-summary-prepare-hook since kill processing may not
3768 (gnus-summary-maybe-hide-threads)
3770 (gnus-kill-or-deaden-summary kill-buffer))
3771 (gnus-summary-auto-select-subject)
3772 ;; Show first unread article if requested.
3773 (if (and (not no-article)
3774 (not no-display)
3775 gnus-newsgroup-unreads
3776 gnus-auto-select-first)
3778 (gnus-configure-windows 'summary)
3779 (let ((art (gnus-summary-article-number)))
3780 (unless (and (not gnus-plugged)
3781 (or (memq art gnus-newsgroup-undownloaded)
3782 (memq art gnus-newsgroup-downloadable)))
3783 (gnus-summary-goto-article art))))
3785 (gnus-summary-position-point)
3786 (gnus-configure-windows 'summary 'force)
3787 (gnus-set-mode-line 'summary))
3788 (when (and gnus-auto-center-group
3789 (get-buffer-window gnus-group-buffer t))
3793 (select-window (get-buffer-window gnus-group-buffer t))
3794 (when (gnus-group-goto-group group)
3798 (setq gnus-newsgroup-prepared t)
3799 (gnus-run-hooks 'gnus-summary-prepared-hook)
3800 (unless (gnus-ephemeral-group-p group)
3801 (gnus-group-update-group group))
3804 (defun gnus-summary-auto-select-subject ()
3808 ((eq gnus-auto-select-subject 'best)
3809 (gnus-summary-best-unread-subject))
3810 ((eq gnus-auto-select-subject 'unread)
3811 (gnus-summary-first-unread-subject))
3812 ((eq gnus-auto-select-subject 'unseen)
3813 (gnus-summary-first-unseen-subject))
3814 ((eq gnus-auto-select-subject 'unseen-or-unread)
3815 (gnus-summary-first-unseen-or-unread-subject))
3816 ((eq gnus-auto-select-subject 'first)
3819 ((functionp gnus-auto-select-subject)
3820 (funcall gnus-auto-select-subject))))
3822 (defun gnus-summary-prepare ()
3827 (setq gnus-newsgroup-data nil
3828 gnus-newsgroup-data-reverse nil)
3829 (gnus-run-hooks 'gnus-summary-generate-hook)
3831 (when gnus-newsgroup-headers
3832 (gnus-summary-prepare-threads
3833 (if gnus-show-threads
3834 (gnus-sort-gathered-threads
3835 (funcall gnus-summary-thread-gathering-function
3836 (gnus-sort-threads
3837 (gnus-cut-threads (gnus-make-threads)))))
3838 ;; Unthreaded display.
3839 (gnus-sort-articles gnus-newsgroup-headers))))
3840 (setq gnus-newsgroup-data (nreverse gnus-newsgroup-data))
3843 (gnus-run-hooks 'gnus-summary-prepare-hook)))
3845 (defsubst gnus-general-simplify-subject (subject)
3846 "Simplify subject by the same rules as `gnus-gather-threads-by-subject'."
3850 (gnus-simplify-subject-functions
3851 (gnus-map-function gnus-simplify-subject-functions subject))
3852 ((numberp gnus-summary-gather-subject-limit)
3853 (setq subject (gnus-simplify-subject-re subject))
3854 (if (> (length subject) gnus-summary-gather-subject-limit)
3855 (substring subject 0 gnus-summary-gather-subject-limit)
3858 ((eq 'fuzzy gnus-summary-gather-subject-limit)
3859 (gnus-simplify-subject-fuzzy subject))
3862 (gnus-simplify-subject-re subject))))
3864 (if (and gnus-summary-gather-exclude-subject
3865 (string-match gnus-summary-gather-exclude-subject subject))
3866 nil ; This article shouldn't be gathered
3869 (defun gnus-summary-simplify-subject-query ()
3870 "Query where the respool algorithm would put this article."
3872 (gnus-summary-select-article)
3873 (message (gnus-general-simplify-subject (gnus-summary-article-subject))))
3875 (defun gnus-gather-threads-by-subject (threads)
3877 (if (not gnus-summary-make-false-root)
3879 (let ((hashtb (gnus-make-hashtable 1024))
3884 (setq subject (gnus-general-simplify-subject
3888 (if (setq hthread (gnus-gethash subject hashtb))
3902 (gnus-sethash subject
3903 (if gnus-summary-make-false-root-always
3916 (defun gnus-gather-threads-by-references (threads)
3918 (let ((idhashtb (gnus-make-hashtable 1024))
3919 (thhashtb (gnus-make-hashtable 1024))
3926 ids (inline (gnus-split-references references))
3930 (if (not (setq gid (gnus-gethash ref idhashtb)))
3932 (gnus-sethash ref id idhashtb)
3933 (gnus-sethash id threads thhashtb))
3934 (setq gthread (gnus-gethash gid thhashtb))
3946 (gnus-sethash id gthread thhashtb)
3955 (defun gnus-sort-gathered-threads (threads)
3956 "Sort subtreads inside each gathered thread by `gnus-sort-gathered-threads-function'."
3961 (sort (cdar threads) gnus-sort-gathered-threads-function)))
3965 (defun gnus-thread-loop-p (root thread)
3980 gnus-newsgroup-dependencies)))
3991 (defun gnus-make-threads ()
4004 (gnus-thread-loop-p
4013 gnus-newsgroup-dependencies)))
4017 (defsubst gnus-dependencies-add-header (header dependencies force-new)
4023 If `gnus-summary-ignore-duplicates' is nil then duplicate Message-IDs
4052 ((not gnus-summary-ignore-duplicates)
4053 ;; An article with this Message-ID has already been seen.
4074 (setq parent-id (gnus-parent-id (mail-header-references header)))
4081 ;; Yuk! This is a reference loop. Make the article be a
4082 ;; root article.
4087 (setq ref (gnus-parent-id (mail-header-references ref-header)))))
4096 (defun gnus-extract-message-id-from-in-reply-to (string)
4101 (defun gnus-build-sparse-threads ()
4102 (let ((headers gnus-newsgroup-headers)
4103 (mail-parse-charset gnus-newsgroup-charset)
4104 (gnus-summary-ignore-duplicates t)
4110 (gnus-message 7 "Making sparse threads...")
4112 (nnheader-set-temp-buffer " *gnus sparse threads*")
4136 (when (gnus-dependencies-add-header
4138 gnus-reffed-article-number
4142 gnus-newsgroup-dependencies nil)
4143 (push gnus-reffed-article-number gnus-newsgroup-limit)
4144 (push gnus-reffed-article-number gnus-newsgroup-sparse)
4145 (push (cons gnus-reffed-article-number gnus-sparse-mark)
4146 gnus-newsgroup-reads)
4147 (decf gnus-reffed-article-number)))
4149 (gnus-message 7 "Making sparse threads...done")))
4151 (defun gnus-build-old-threads ()
4156 (let ((mail-parse-charset gnus-newsgroup-charset)
4164 gnus-newsgroup-dormant)
4167 (while (and (setq id (gnus-build-get-header id))
4168 (not (car (gnus-id-to-thread id)))))
4170 gnus-newsgroup-dependencies)))
4172 (defsubst gnus-remove-odd-characters (string)
4179 ;; This function has to be called with point after the article number
4181 (defsubst gnus-nov-parse-line (number dependencies &optional force-new)
4182 (let ((eol (gnus-point-at-eol))
4197 (gnus-remove-odd-characters
4198 (funcall gnus-decode-encoded-word-function
4202 (gnus-remove-odd-characters
4203 (funcall gnus-decode-encoded-address-function
4223 header (gnus-extract-message-id-from-in-reply-to in-reply-to)))
4225 (when gnus-alter-header-function
4226 (funcall gnus-alter-header-function header))
4227 (gnus-dependencies-add-header header dependencies force-new)))
4229 (defun gnus-build-get-header (id)
4232 the id of the parent article (if any)."
4233 (let ((deps gnus-newsgroup-dependencies)
4250 (setq header (gnus-nov-parse-line
4252 (gnus-parent-id (mail-header-references header))))))
4255 (push number gnus-newsgroup-limit)
4256 (push header gnus-newsgroup-headers)
4257 (if (memq number gnus-newsgroup-unselected)
4259 (setq gnus-newsgroup-unreads
4260 (gnus-add-to-sorted-list gnus-newsgroup-unreads
4262 (setq gnus-newsgroup-unselected
4263 (delq number gnus-newsgroup-unselected)))
4264 (push number gnus-newsgroup-ancient)))))))
4266 (defun gnus-build-all-threads ()
4268 (let ((gnus-summary-ignore-duplicates t)
4269 (mail-parse-charset gnus-newsgroup-charset)
4270 (dependencies gnus-newsgroup-dependencies)
4271 header article)
4278 (setq article (read (current-buffer))
4279 header (gnus-nov-parse-line article dependencies)))
4282 (set-buffer gnus-summary-buffer)
4283 (push header gnus-newsgroup-headers)
4284 (if (memq (setq article (mail-header-number header))
4285 gnus-newsgroup-unselected)
4287 (setq gnus-newsgroup-unreads
4288 (gnus-add-to-sorted-list
4289 gnus-newsgroup-unreads article))
4290 (setq gnus-newsgroup-unselected
4291 (delq article gnus-newsgroup-unselected)))
4292 (push article gnus-newsgroup-ancient)))
4295 (defun gnus-summary-update-article-line (article header)
4298 (thread (gnus-id-to-thread id)))
4303 (gnus-summary-goto-subject article)
4304 (let* ((datal (gnus-data-find-list article))
4307 (level (gnus-summary-thread-level)))
4308 (gnus-delete-line)
4311 (gnus-summary-insert-line
4313 (memq article gnus-newsgroup-undownloaded)
4314 (gnus-article-mark article)
4315 (memq article gnus-newsgroup-replied)
4316 (memq article gnus-newsgroup-expirable)
4320 gnus-show-threads
4321 (gnus-subject-equal
4324 (gnus-data-header
4326 (gnus-data-find-list
4327 article
4328 (gnus-data-list t)))))
4334 nil (cdr (assq article gnus-newsgroup-scored))
4335 (memq article gnus-newsgroup-processable))
4338 (gnus-data-update-list
4340 (- (gnus-data-pos data) (gnus-data-pos (cadr datal)) inserted)))))))
4342 (defun gnus-summary-update-article (article &optional iheader)
4344 (set-buffer gnus-summary-buffer)
4345 (let* ((header (gnus-summary-article-header article))
4347 (data (gnus-data-find article))
4348 (thread (gnus-id-to-thread id))
4351 (gnus-id-to-thread
4352 (or (gnus-parent-id
4364 (if (gnus-summary-insert-subject id header)
4365 ;; Set the (possibly) new article number in the data structure.
4366 (gnus-data-set-number data (gnus-id-to-article id))
4370 (defun gnus-rebuild-thread (id &optional line)
4375 (if (not gnus-show-threads)
4376 (setq thread (list (car (gnus-id-to-thread id))))
4377 ;; Get the thread this article is part of.
4378 (setq thread (gnus-remove-thread id)))
4379 (setq old-pos (gnus-point-at-bol))
4382 (gnus-summary-article-number))))
4389 (unless (memq (setq thr (gnus-id-to-thread
4390 (gnus-root-id
4399 (setq thread (cons subject (gnus-sort-threads roots))))))
4405 (let (gnus-newsgroup-data gnus-newsgroup-threads)
4406 (if gnus-show-threads
4407 (gnus-summary-prepare-threads (gnus-cut-threads (list thread)))
4408 (gnus-summary-prepare-unthreaded thread))
4409 (setq data (nreverse gnus-newsgroup-data))
4410 (setq threads gnus-newsgroup-threads))
4416 (gnus-data-enter-list
4418 (setq gnus-newsgroup-threads
4419 (nconc threads gnus-newsgroup-threads))
4420 (gnus-data-compute-positions))))
4422 (defun gnus-number-to-header (number)
4423 "Return the header for article NUMBER."
4424 (let ((headers gnus-newsgroup-headers))
4431 (defun gnus-parent-headers (in-headers &optional generation)
4442 (setq parent (gnus-parent-id references)))
4443 (car (gnus-id-to-thread parent))
4449 (defun gnus-id-to-thread (id)
4451 (gnus-gethash id gnus-newsgroup-dependencies))
4453 (defun gnus-id-to-article (id)
4454 "Return the article number of ID."
4455 (let ((thread (gnus-id-to-thread id)))
4460 (defun gnus-id-to-header (id)
4461 "Return the article headers of ID."
4462 (car (gnus-id-to-thread id)))
4464 (defun gnus-article-displayed-root-p (article)
4465 "Say whether ARTICLE is a root(ish) article."
4466 (let ((level (gnus-summary-thread-level article))
4467 (refs (mail-header-references (gnus-summary-article-header article)))
4473 ((null (gnus-parent-id refs)) t)
4475 (null (setq particle (gnus-id-to-article
4476 (gnus-parent-id refs))))
4477 (null (gnus-summary-thread-level particle)))))))
4479 (defun gnus-root-id (id)
4482 (while (and id (setq prev (car (gnus-id-to-thread id))))
4484 id (gnus-parent-id (mail-header-references prev))))
4487 (defun gnus-articles-in-thread (thread)
4490 (apply 'nconc (mapcar 'gnus-articles-in-thread (cdr thread)))))
4492 (defun gnus-remove-thread (id &optional dont-remove)
4496 (setq last-id (gnus-root-id id)
4497 headers (message-flatten-list (gnus-id-to-thread last-id)))
4501 (let ((threads gnus-newsgroup-threads)
4507 ;; below it to find whether this article is in this
4522 ;; If this article is in no thread, then it's a root.
4525 (setq gnus-newsgroup-threads (delq thread gnus-newsgroup-threads)))
4526 (setq thread (gnus-id-to-thread last-id)))
4535 (when (eq gnus-summary-make-false-root 'dummy)
4538 (gnus-summary-goto-article
4541 (gnus-delete-line)
4542 (gnus-data-compute-positions))
4545 (gnus-remove-thread-1 (car thread))
4547 (gnus-remove-thread-1 thread))))))))
4549 (defun gnus-remove-thread-1 (thread)
4555 (gnus-remove-thread-1 (pop thread)))
4556 (when (setq d (gnus-data-find number))
4557 (goto-char (gnus-data-pos d))
4558 (gnus-summary-show-thread)
4559 (gnus-data-remove
4561 (- (gnus-point-at-bol)
4563 (1+ (gnus-point-at-eol))
4564 (gnus-delete-line)))))))
4566 (defun gnus-sort-threads-recursive (threads func)
4570 (gnus-sort-threads-recursive (cdr thread) func))))
4573 (defun gnus-sort-threads-loop (threads func)
4589 (defun gnus-sort-threads (threads)
4591 (if (not gnus-thread-sort-functions)
4593 (gnus-message 8 "Sorting threads...")
4597 (gnus-sort-threads-recursive
4598 threads (gnus-make-sort-function gnus-thread-sort-functions)))
4602 (error (gnus-sort-threads-loop
4603 threads (gnus-make-sort-function
4604 gnus-thread-sort-functions))))
4605 (gnus-message 8 "Sorting threads...done"))))
4607 (defun gnus-sort-articles (articles)
4609 (when gnus-article-sort-functions
4610 (gnus-message 7 "Sorting articles...")
4612 (setq gnus-newsgroup-headers
4613 (sort articles (gnus-make-sort-function
4614 gnus-article-sort-functions)))
4615 (gnus-message 7 "Sorting articles...done"))))
4618 (defmacro gnus-thread-header (thread)
4619 "Return header of first article in THREAD.
4623 ;; (8% speedup to gnus-summary-prepare, just for fun :-)
4627 (defsubst gnus-article-sort-by-number (h1 h2)
4628 "Sort articles by article number."
4632 (defun gnus-thread-sort-by-number (h1 h2)
4633 "Sort threads by root article number."
4634 (gnus-article-sort-by-number
4635 (gnus-thread-header h1) (gnus-thread-header h2)))
4637 (defsubst gnus-article-sort-by-random (h1 h2)
4638 "Sort articles by article number."
4641 (defun gnus-thread-sort-by-random (h1 h2)
4642 "Sort threads by root article number."
4643 (gnus-article-sort-by-random
4644 (gnus-thread-header h1) (gnus-thread-header h2)))
4646 (defsubst gnus-article-sort-by-lines (h1 h2)
4647 "Sort articles by article Lines header."
4651 (defun gnus-thread-sort-by-lines (h1 h2)
4652 "Sort threads by root article Lines header."
4653 (gnus-article-sort-by-lines
4654 (gnus-thread-header h1) (gnus-thread-header h2)))
4656 (defsubst gnus-article-sort-by-chars (h1 h2)
4661 (defun gnus-thread-sort-by-chars (h1 h2)
4662 "Sort threads by root article octet length."
4663 (gnus-article-sort-by-chars
4664 (gnus-thread-header h1) (gnus-thread-header h2)))
4666 (defsubst gnus-article-sort-by-author (h1 h2)
4670 gnus-extract-address-components
4674 gnus-extract-address-components
4678 (defun gnus-thread-sort-by-author (h1 h2)
4680 (gnus-article-sort-by-author
4681 (gnus-thread-header h1) (gnus-thread-header h2)))
4683 (defsubst gnus-article-sort-by-subject (h1 h2)
4686 (downcase (gnus-simplify-subject-re (mail-header-subject h1)))
4687 (downcase (gnus-simplify-subject-re (mail-header-subject h2)))))
4689 (defun gnus-thread-sort-by-subject (h1 h2)
4691 (gnus-article-sort-by-subject
4692 (gnus-thread-header h1) (gnus-thread-header h2)))
4694 (defsubst gnus-article-sort-by-date (h1 h2)
4695 "Sort articles by root article date."
4697 (gnus-date-get-time (mail-header-date h1))
4698 (gnus-date-get-time (mail-header-date h2))))
4700 (defun gnus-thread-sort-by-date (h1 h2)
4701 "Sort threads by root article date."
4702 (gnus-article-sort-by-date
4703 (gnus-thread-header h1) (gnus-thread-header h2)))
4705 (defsubst gnus-article-sort-by-score (h1 h2)
4706 "Sort articles by root article score.
4709 gnus-newsgroup-scored))
4710 gnus-summary-default-score 0)
4712 gnus-newsgroup-scored))
4713 gnus-summary-default-score 0)))
4715 (defun gnus-thread-sort-by-score (h1 h2)
4716 "Sort threads by root article score."
4717 (gnus-article-sort-by-score
4718 (gnus-thread-header h1) (gnus-thread-header h2)))
4720 (defun gnus-thread-sort-by-total-score (h1 h2)
4723 (> (gnus-thread-total-score h1) (gnus-thread-total-score h2)))
4725 (defun gnus-thread-total-score (thread)
4732 (apply gnus-thread-score-function 0
4733 (mapcar 'gnus-thread-total-score-1 (cdr thread)))
4734 (gnus-thread-total-score-1 thread)))
4736 (gnus-thread-total-score-1 (list thread)))))
4738 (defun gnus-thread-sort-by-most-recent-number (h1 h2)
4739 "Sort threads such that the thread with the most recently arrived article comes first."
4740 (> (gnus-thread-highest-number h1) (gnus-thread-highest-number h2)))
4742 (defun gnus-thread-highest-number (thread)
4743 "Return the highest article number in THREAD."
4748 (defun gnus-thread-sort-by-most-recent-date (h1 h2)
4749 "Sort threads such that the thread with the most recently dated article comes first."
4750 (> (gnus-thread-latest-date h1) (gnus-thread-latest-date h2)))
4752 (defun gnus-thread-latest-date (thread)
4753 "Return the highest article date in THREAD."
4769 (defun gnus-thread-total-score-1 (root)
4772 (apply gnus-thread-score-function
4774 (mapcar 'gnus-thread-total-score
4775 (cdr (gnus-id-to-thread (mail-header-id root))))
4778 gnus-newsgroup-scored))
4779 gnus-summary-default-score 0))))
4780 (list gnus-summary-default-score)
4784 (defvar gnus-tmp-prev-subject nil)
4785 (defvar gnus-tmp-false-parent nil)
4786 (defvar gnus-tmp-root-expunged nil)
4787 (defvar gnus-tmp-dummy-line nil)
4789 (eval-when-compile (defvar gnus-tmp-header))
4790 (defun gnus-extra-header (type &optional header)
4792 (or (cdr (assq type (mail-header-extra (or header gnus-tmp-header))))
4795 (defvar gnus-tmp-thread-tree-header-string "")
4797 (defcustom gnus-sum-thread-tree-root "> "
4802 :group 'gnus-thread)
4803 (defcustom gnus-sum-thread-tree-false-root "> "
4808 :group 'gnus-thread)
4809 (defcustom gnus-sum-thread-tree-single-indent ""
4814 :group 'gnus-thread)
4815 (defcustom gnus-sum-thread-tree-vertical "| "
4819 :group 'gnus-thread)
4820 (defcustom gnus-sum-thread-tree-indent " "
4824 :group 'gnus-thread)
4825 (defcustom gnus-sum-thread-tree-leaf-with-other "+-> "
4829 :group 'gnus-thread)
4830 (defcustom gnus-sum-thread-tree-single-leaf "\\-> "
4834 :group 'gnus-thread)
4836 (defun gnus-summary-prepare-threads (threads)
4840 (gnus-message 7 "Generating summary...")
4842 (setq gnus-newsgroup-threads threads)
4845 (let ((gnus-tmp-level 0)
4846 (default-score (or gnus-summary-default-score 0))
4847 (gnus-visual-p (gnus-visual-p 'summary-highlight 'highlight))
4848 (building-line-count gnus-summary-display-while-building)
4849 (building-count (integerp gnus-summary-display-while-building))
4850 thread number subject stack state gnus-tmp-gathered beg-match
4851 new-roots gnus-tmp-new-adopts thread-end simp-subject
4852 gnus-tmp-header gnus-tmp-unread gnus-tmp-downloaded
4853 gnus-tmp-replied gnus-tmp-subject-or-nil
4854 gnus-tmp-dummy gnus-tmp-indentation gnus-tmp-lines gnus-tmp-score
4855 gnus-tmp-score-char gnus-tmp-from gnus-tmp-name
4856 gnus-tmp-number gnus-tmp-opening-bracket gnus-tmp-closing-bracket
4859 (setq gnus-tmp-prev-subject nil
4860 gnus-tmp-thread-tree-header-string "")
4864 ;; threaded summary display isn't required, so we just create
4866 (gnus-summary-prepare-unthreaded threads)
4868 ;; Do the threaded display.
4870 (if gnus-summary-display-while-building
4872 (while (or threads stack gnus-tmp-new-adopts new-roots)
4874 (if (and (= gnus-tmp-level 0)
4877 (not gnus-tmp-false-parent)
4878 (or gnus-tmp-new-adopts new-roots))
4879 (if gnus-tmp-new-adopts
4880 (setq gnus-tmp-level (if gnus-tmp-root-expunged 0 1)
4881 thread (list (car gnus-tmp-new-adopts))
4882 gnus-tmp-header (caar thread)
4883 gnus-tmp-new-adopts (cdr gnus-tmp-new-adopts))
4886 gnus-tmp-header (caar thread)
4893 gnus-tmp-header (caar thread))
4897 gnus-tmp-level (car state)
4901 gnus-tmp-header (caar thread))))
4903 (setq gnus-tmp-false-parent nil)
4904 (setq gnus-tmp-root-expunged nil)
4907 (if (stringp gnus-tmp-header)
4910 ((eq gnus-summary-make-false-root 'adopt)
4911 ;; We let the first article adopt the rest.
4912 (setq gnus-tmp-new-adopts (nconc gnus-tmp-new-adopts
4914 (setq gnus-tmp-gathered
4918 gnus-tmp-gathered))
4922 (setq gnus-tmp-level -1
4923 gnus-tmp-false-parent t))
4924 ((eq gnus-summary-make-false-root 'empty)
4926 (setq gnus-tmp-gathered
4930 gnus-tmp-gathered))
4931 (setq gnus-tmp-level -1))
4932 ((eq gnus-summary-make-false-root 'dummy)
4935 (setq gnus-tmp-dummy-line gnus-tmp-header)
4936 (setq gnus-tmp-prev-subject gnus-tmp-header))
4940 (setq gnus-tmp-level -1)))
4942 (setq number (mail-header-number gnus-tmp-header)
4943 subject (mail-header-subject gnus-tmp-header)
4944 simp-subject (gnus-simplify-subject-fully subject))
4949 ((and (null gnus-thread-ignore-subject)
4950 (not (zerop gnus-tmp-level))
4951 gnus-tmp-prev-subject
4952 (not (string= gnus-tmp-prev-subject simp-subject)))
4955 gnus-tmp-header nil))
4956 ;; If the article lies outside the current limit,
4957 ;; then we do not display it.
4958 ((not (memq number gnus-newsgroup-limit))
4959 (setq gnus-tmp-gathered
4963 gnus-tmp-gathered))
4964 (setq gnus-tmp-new-adopts (if (cdar thread)
4965 (append gnus-tmp-new-adopts
4967 gnus-tmp-new-adopts)
4969 gnus-tmp-header nil)
4970 (when (zerop gnus-tmp-level)
4971 (setq gnus-tmp-root-expunged t)))
4972 ;; Perhaps this article is to be marked as read?
4973 ((and gnus-summary-mark-below
4974 (< (or (cdr (assq number gnus-newsgroup-scored))
4976 gnus-summary-mark-below)
4978 (not (gnus-summary-article-sparse-p number))
4979 (not (gnus-summary-article-ancient-p number)))
4980 (setq gnus-newsgroup-unreads
4981 (delq number gnus-newsgroup-unreads))
4982 (if gnus-newsgroup-auto-expire
4983 (setq gnus-newsgroup-expirable
4984 (gnus-add-to-sorted-list
4985 gnus-newsgroup-expirable number))
4986 (push (cons number gnus-low-score-mark)
4987 gnus-newsgroup-reads))))
4989 (when gnus-tmp-header
4991 ;; article.
4992 (when (and gnus-tmp-dummy-line
4993 (gnus-subject-equal
4994 gnus-tmp-dummy-line
4995 (mail-header-subject gnus-tmp-header)))
4996 (gnus-summary-insert-dummy-line
4997 gnus-tmp-dummy-line (mail-header-number gnus-tmp-header))
4998 (setq gnus-tmp-dummy-line nil))
5001 (setq gnus-tmp-unread (gnus-article-mark number))
5003 (push (gnus-data-make number gnus-tmp-unread (1+ (point))
5004 gnus-tmp-header gnus-tmp-level)
5005 gnus-newsgroup-data)
5009 gnus-tmp-subject-or-nil
5011 ((and gnus-thread-ignore-subject
5012 gnus-tmp-prev-subject
5013 (not (string= gnus-tmp-prev-subject simp-subject)))
5015 ((zerop gnus-tmp-level)
5016 (if (and (eq gnus-summary-make-false-root 'empty)
5017 (memq number gnus-tmp-gathered)
5018 gnus-tmp-prev-subject
5019 (string= gnus-tmp-prev-subject simp-subject))
5020 gnus-summary-same-subject
5022 (t gnus-summary-same-subject)))
5023 (if (and (eq gnus-summary-make-false-root 'adopt)
5024 (= gnus-tmp-level 1)
5025 (memq number gnus-tmp-gathered))
5026 (setq gnus-tmp-opening-bracket ?\<
5027 gnus-tmp-closing-bracket ?\>)
5028 (setq gnus-tmp-opening-bracket ?\[
5029 gnus-tmp-closing-bracket ?\]))
5030 (if (>= gnus-tmp-level (length gnus-thread-indent-array))
5031 (gnus-make-thread-indent-array
5032 (max (* 2 (length gnus-thread-indent-array))
5033 gnus-tmp-level)))
5035 gnus-tmp-indentation
5036 (aref gnus-thread-indent-array gnus-tmp-level)
5037 gnus-tmp-lines (mail-header-lines gnus-tmp-header)
5038 gnus-tmp-score (or (cdr (assq number gnus-newsgroup-scored))
5039 gnus-summary-default-score 0)
5040 gnus-tmp-score-char
5041 (if (or (null gnus-summary-default-score)
5042 (<= (abs (- gnus-tmp-score gnus-summary-default-score))
5043 gnus-summary-zcore-fuzz))
5045 (if (< gnus-tmp-score gnus-summary-default-score)
5046 gnus-score-below-mark gnus-score-over-mark))
5047 gnus-tmp-replied
5048 (cond ((memq number gnus-newsgroup-processable)
5049 gnus-process-mark)
5050 ((memq number gnus-newsgroup-cached)
5051 gnus-cached-mark)
5052 ((memq number gnus-newsgroup-replied)
5053 gnus-replied-mark)
5054 ((memq number gnus-newsgroup-forwarded)
5055 gnus-forwarded-mark)
5056 ((memq number gnus-newsgroup-saved)
5057 gnus-saved-mark)
5058 ((memq number gnus-newsgroup-recent)
5059 gnus-recent-mark)
5060 ((memq number gnus-newsgroup-unseen)
5061 gnus-unseen-mark)
5062 (t gnus-no-mark))
5063 gnus-tmp-downloaded
5064 (cond ((memq number gnus-newsgroup-undownloaded)
5065 gnus-undownloaded-mark)
5066 (gnus-newsgroup-agentized
5067 gnus-downloaded-mark)
5069 gnus-no-mark))
5070 gnus-tmp-from (mail-header-from gnus-tmp-header)
5071 gnus-tmp-name
5073 ((string-match "<[^>]+> *$" gnus-tmp-from)
5075 (or (and (string-match "^\".+\"" gnus-tmp-from)
5076 (substring gnus-tmp-from 1 (1- (match-end 0))))
5077 (substring gnus-tmp-from 0 beg-match)))
5078 ((string-match "(.+)" gnus-tmp-from)
5079 (substring gnus-tmp-from
5081 (t gnus-tmp-from))
5084 gnus-tmp-thread-tree-header-string
5086 ((not gnus-show-threads) "")
5087 ((zerop gnus-tmp-level)
5089 (or gnus-sum-thread-tree-root subject))
5090 (gnus-tmp-new-adopts
5091 (or gnus-sum-thread-tree-false-root subject))
5093 (or gnus-sum-thread-tree-single-indent subject))))
5098 gnus-sum-thread-tree-vertical
5099 gnus-sum-thread-tree-indent))
5102 gnus-sum-thread-tree-leaf-with-other
5103 gnus-sum-thread-tree-single-leaf)))))
5104 (when (string= gnus-tmp-name "")
5105 (setq gnus-tmp-name gnus-tmp-from))
5106 (unless (numberp gnus-tmp-lines)
5107 (setq gnus-tmp-lines -1))
5108 (if (= gnus-tmp-lines -1)
5109 (setq gnus-tmp-lines "?")
5110 (setq gnus-tmp-lines (number-to-string gnus-tmp-lines)))
5111 (gnus-put-text-property
5113 (progn (eval gnus-summary-line-format-spec) (point))
5114 'gnus-number number)
5115 (when gnus-visual-p
5117 (gnus-run-hooks 'gnus-summary-update-hook)
5120 (setq gnus-tmp-prev-subject simp-subject)))
5123 (push (list (max 0 gnus-tmp-level)
5128 (incf gnus-tmp-level)
5130 (if gnus-summary-display-while-building
5138 gnus-summary-display-while-building)))
5142 (setq gnus-tmp-level 0)))))
5143 (gnus-message 7 "Generating summary...done"))
5145 (defun gnus-summary-prepare-unthreaded (headers)
5155 gnus-newsgroup-limit)
5156 ;; Mark article as read when it has a low score.
5157 (when (and gnus-summary-mark-below
5158 (< (or (cdr (assq number gnus-newsgroup-scored))
5159 gnus-summary-default-score 0)
5160 gnus-summary-mark-below)
5161 (not (gnus-summary-article-ancient-p number)))
5162 (setq gnus-newsgroup-unreads
5163 (delq number gnus-newsgroup-unreads))
5164 (if gnus-newsgroup-auto-expire
5165 (push number gnus-newsgroup-expirable)
5166 (push (cons number gnus-low-score-mark)
5167 gnus-newsgroup-reads)))
5169 (setq mark (gnus-article-mark number))
5170 (push (gnus-data-make number mark (1+ (point)) header 0)
5171 gnus-newsgroup-data)
5172 (gnus-summary-insert-line
5174 (memq number gnus-newsgroup-undownloaded)
5175 mark (memq number gnus-newsgroup-replied)
5176 (memq number gnus-newsgroup-expirable)
5178 (cdr (assq number gnus-newsgroup-scored))
5179 (memq number gnus-newsgroup-processable))))))
5181 (defun gnus-summary-remove-list-identifiers ()
5182 "Remove list identifiers in `gnus-list-identifiers' from articles in the current group."
5183 (let ((regexp (if (consp gnus-list-identifiers)
5184 (mapconcat 'identity gnus-list-identifiers " *\\|")
5185 gnus-list-identifiers))
5188 (dolist (header gnus-newsgroup-headers)
5207 (defun gnus-fetch-headers (articles)
5209 (let ((name (gnus-group-decoded-name gnus-newsgroup-name)))
5210 (gnus-message 5 "Fetching headers for %s..." name)
5213 (setq gnus-headers-retrieved-by
5214 (gnus-retrieve-headers
5215 articles gnus-newsgroup-name
5217 ;; not if there is only 1 article.
5219 (not (eq gnus-fetch-old-headers 'some))
5220 (not (numberp gnus-fetch-old-headers)))
5222 gnus-fetch-old-headers))))
5223 (gnus-get-newsgroup-headers-xover
5224 articles nil nil gnus-newsgroup-name t)
5225 (gnus-get-newsgroup-headers))
5226 (gnus-message 5 "Fetching headers for %s...done" name))))
5228 (defun gnus-select-newsgroup (group &optional read-all select-articles)
5232 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb))
5234 (gnus-summary-ignore-duplicates
5235 (if (eq (car (gnus-find-method-for-group group)) 'nnvirtual)
5237 gnus-summary-ignore-duplicates))
5241 (unless (gnus-check-server
5242 (set (make-local-variable 'gnus-current-select-method)
5243 (gnus-find-method-for-group group)))
5247 (gnus-activate-group group) ; Or we can activate it...
5249 (when (equal major-mode 'gnus-summary-mode)
5250 (gnus-kill-buffer (current-buffer)))
5252 (gnus-group-decoded-name group) (gnus-status-message group))))
5254 (unless (gnus-request-group group t)
5255 (when (equal major-mode 'gnus-summary-mode)
5256 (gnus-kill-buffer (current-buffer)))
5258 (gnus-group-decoded-name group) (gnus-status-message group)))
5260 (when gnus-agent
5261 (gnus-agent-possibly-alter-active group (gnus-active group) info)
5263 (setq gnus-summary-use-undownloaded-faces
5264 (gnus-agent-find-parameter
5268 (setq gnus-newsgroup-name group
5269 gnus-newsgroup-unselected nil
5270 gnus-newsgroup-unreads (gnus-list-of-unread-articles group))
5272 (let ((display (gnus-group-find-parameter group 'display)))
5273 (setq gnus-newsgroup-display
5278 'gnus-not-ignore)
5279 ((eq display 'all)
5280 'gnus-not-ignore)
5281 ((arrayp display)
5282 (gnus-summary-display-make-predicate (mapcar 'identity display)))
5283 ((numberp display)
5290 ;; (gnus-byte-compile
5291 ;; `(lambda () (> number ,(- (cdr (gnus-active group))
5292 ;; display)))))
5294 (gnus-uncompress-range
5295 (cons (let ((tmp (- (cdr (gnus-active group)) display)))
5299 (cdr (gnus-active group)))))
5304 (gnus-summary-setup-default-charset)
5307 (when (gnus-virtual-group-p group)
5308 (setq cached gnus-newsgroup-cached))
5310 (setq gnus-newsgroup-unreads
5311 (gnus-sorted-ndifference
5312 (gnus-sorted-ndifference gnus-newsgroup-unreads
5313 gnus-newsgroup-marked)
5314 gnus-newsgroup-dormant))
5316 (setq gnus-newsgroup-processable nil)
5318 (gnus-update-read-articles group gnus-newsgroup-unreads)
5320 ;; Adjust and set lists of article marks.
5322 (gnus-adjust-marked-articles info))
5324 (setq gnus-newsgroup-unselected
5325 (gnus-sorted-difference gnus-newsgroup-unreads articles))
5326 (setq articles (gnus-articles-to-read group read-all)))
5330 ;;(gnus-message 3 "Couldn't select newsgroup -- no articles to display")
5335 (setq gnus-newsgroup-dependencies
5336 (gnus-make-hashtable (length articles)))
5337 (gnus-set-global-variables)
5340 (setq gnus-newsgroup-headers (gnus-fetch-headers articles))
5344 (setq gnus-newsgroup-cached cached))
5347 (when gnus-suppress-duplicates
5348 (gnus-dup-suppress-articles))
5351 (setq gnus-newsgroup-limit (copy-sequence articles))
5355 gnus-newsgroup-headers))
5356 (setq gnus-newsgroup-articles fetched-articles)
5357 (setq gnus-newsgroup-unreads
5358 (gnus-sorted-nintersection
5359 gnus-newsgroup-unreads fetched-articles))
5360 (gnus-compute-unseen-list)
5363 (gnus-update-missing-marks
5364 (gnus-sorted-difference articles fetched-articles))
5366 (when (and gnus-fetch-old-headers
5367 (eq gnus-headers-retrieved-by 'nov))
5368 (if (eq gnus-fetch-old-headers 'invisible)
5369 (gnus-build-all-threads)
5370 (gnus-build-old-threads)))
5372 (when gnus-agent
5373 (gnus-agent-get-undownloaded-list))
5375 (when gnus-list-identifiers
5376 (gnus-summary-remove-list-identifiers))
5378 (setq gnus-newsgroup-auto-expire
5379 (gnus-group-auto-expirable-p group))
5380 ;; Set up the article buffer now, if necessary.
5381 (unless gnus-single-article-buffer
5382 (gnus-article-setup-buffer))
5383 ;; First and last article in this newsgroup.
5384 (when gnus-newsgroup-headers
5385 (setq gnus-newsgroup-begin
5386 (mail-header-number (car gnus-newsgroup-headers))
5387 gnus-newsgroup-end
5389 (gnus-last-element gnus-newsgroup-headers))))
5391 (or gnus-newsgroup-headers t)))))
5393 (defun gnus-compute-unseen-list ()
5395 (if (not gnus-newsgroup-seen)
5396 (setq gnus-newsgroup-unseen gnus-newsgroup-articles)
5397 (setq gnus-newsgroup-unseen
5398 (gnus-inverse-list-range-intersection
5399 gnus-newsgroup-articles gnus-newsgroup-seen))))
5401 (defun gnus-summary-display-make-predicate (display)
5402 (require 'gnus-agent)
5403 (when (= (length display) 1)
5404 (setq display (car display)))
5405 (unless gnus-summary-display-cache
5409 gnus-article-mark-lists))
5411 (gnus-byte-compile
5412 `(lambda () (gnus-article-marked-p ',(cdr elem)))))
5413 gnus-summary-display-cache)))
5414 (let ((gnus-category-predicate-alist gnus-summary-display-cache)
5415 (gnus-category-predicate-cache gnus-summary-display-cache))
5416 (gnus-get-predicate display)))
5421 (defun gnus-article-marked-p (type &optional article)
5422 (let ((article (or article number)))
5425 (memq article gnus-newsgroup-marked))
5427 (memq article gnus-newsgroup-spam-marked))
5429 (memq article gnus-newsgroup-unsendable))
5431 (memq article gnus-newsgroup-undownloaded))
5433 (memq article gnus-newsgroup-downloadable))
5435 (memq article gnus-newsgroup-unreads))
5437 (memq article gnus-newsgroup-reads))
5439 (memq article gnus-newsgroup-dormant) )
5441 (memq article gnus-newsgroup-expirable))
5443 (memq article gnus-newsgroup-replied))
5445 (memq article gnus-newsgroup-killed))
5447 (assq article gnus-newsgroup-bookmarks))
5449 (assq article gnus-newsgroup-scored))
5451 (memq article gnus-newsgroup-saved))
5453 (memq article gnus-newsgroup-cached))
5455 (memq article gnus-newsgroup-forwarded))
5457 (not (memq article gnus-newsgroup-unseen)))
5459 (memq article gnus-newsgroup-recent))
5462 (defun gnus-articles-to-read (group &optional read-all)
5468 (and (zerop (length gnus-newsgroup-marked))
5469 (zerop (length gnus-newsgroup-unreads)))
5471 gnus-newsgroup-display)
5477 (gnus-uncompress-range (gnus-active group))
5478 (gnus-cache-articles-in-group group))
5480 (gnus-sorted-nunion
5481 (gnus-sorted-union gnus-newsgroup-dormant gnus-newsgroup-marked)
5482 gnus-newsgroup-unreads)))
5483 (scored-list (gnus-killed-articles gnus-newsgroup-killed articles))
5486 (marked (+ (length gnus-newsgroup-marked)
5487 (length gnus-newsgroup-dormant)))
5492 ((numberp gnus-newsgroup-display)
5493 gnus-newsgroup-display)
5498 (numberp gnus-large-newsgroup)
5499 (> number gnus-large-newsgroup))
5501 (initial (gnus-parameter-large-newsgroup-initial
5502 gnus-newsgroup-name))
5507 (gnus-limit-string
5508 (gnus-group-decoded-name gnus-newsgroup-name)
5522 (gnus-group-decoded-name group)
5545 (setq gnus-newsgroup-unselected
5546 (gnus-sorted-difference gnus-newsgroup-unreads articles))
5547 (when gnus-alter-articles-to-read-function
5550 (funcall gnus-alter-articles-to-read-function
5551 gnus-newsgroup-name articles)
5555 (defun gnus-killed-articles (killed articles)
5558 (when (inline (gnus-member-of-range (car articles) killed))
5563 (defun gnus-uncompress-marks (marks)
5570 (push (cons (caar marks) (gnus-uncompress-range (cdar marks))) out))
5574 (defun gnus-article-mark-to-type (mark)
5576 (or (cadr (assq mark gnus-article-special-mark-lists))
5579 (defun gnus-article-unpropagatable-p (mark)
5581 (memq mark gnus-article-unpropagated-mark-lists))
5583 (defun gnus-adjust-marked-articles (info)
5584 "Set all article lists and remove all marks that are no longer valid."
5585 (let* ((marked-lists (gnus-info-marks info))
5586 (active (gnus-active (gnus-info-group info)))
5589 (types gnus-article-mark-lists)
5590 marks var articles article mark mark-type
5595 mark-type (gnus-article-mark-to-type mark)
5596 var (intern (format "gnus-newsgroup-%s" (car (rassq mark types)))))
5604 ;; See gnus-uncompress-range for a description of possible marks
5614 (while (setq article (pop articles))
5615 (cond ((consp article)
5616 (setq bgn (max (car article) min)
5617 end (min (cdr article) max))
5621 ((and (<= min article)
5622 (>= max article))
5623 (setq l (setcdr l (cons article nil))))))
5633 (when (or (not (consp (setq article (pop articles))))
5634 (< (car article) min)
5635 (> (car article) max))
5636 (set var (delq article (symbol-value var))))))
5654 (defun gnus-update-missing-marks (missing)
5659 (dolist (elem gnus-article-mark-lists)
5660 (when (eq (gnus-article-mark-to-type (cdr elem)) 'list)
5661 (setq var (intern (format "gnus-newsgroup-%s" (car elem))))
5669 (defun gnus-update-marks ()
5671 (let ((types gnus-article-mark-lists)
5672 (info (gnus-get-info gnus-newsgroup-name))
5679 (intern (format "gnus-newsgroup-%s" (car type))))))
5685 gnus-save-score
5692 (= (cdar arts) gnus-summary-default-score))
5699 (setq list (gnus-range-add list gnus-newsgroup-unseen)))
5701 (when (eq (gnus-article-mark-to-type (cdr type)) 'list)
5702 (setq list (gnus-compress-sequence (set symbol (sort list '<)) t)))
5704 (when (and (gnus-check-backend-function
5705 'request-set-mark gnus-newsgroup-name)
5706 (not (gnus-article-unpropagatable-p (cdr type))))
5707 (let* ((old (cdr (assq (cdr type) (gnus-info-marks info))))
5708 (del (gnus-remove-from-range (gnus-copy-sequence old) list))
5709 (add (gnus-remove-from-range
5710 (gnus-copy-sequence list) old)))
5720 (unless (gnus-check-group gnus-newsgroup-name)
5721 (error "Can't open server for %s" gnus-newsgroup-name))
5722 (gnus-request-set-mark gnus-newsgroup-name delta-marks))
5738 (defun gnus-set-mode-line (where)
5739 "Set the mode line of the article or summary buffers.
5742 (when (and (memq where gnus-updated-mode-lines)
5744 (intern (format "gnus-%s-mode-line-format-spec" where))))
5749 (set-buffer gnus-summary-buffer)
5754 (format "gnus-%s-mode-line-format-spec" where))))
5755 (gnus-tmp-group-name (gnus-mode-string-quote
5756 (gnus-group-decoded-name
5757 gnus-newsgroup-name)))
5758 (gnus-tmp-article-number (or gnus-current-article 0))
5759 (gnus-tmp-unread gnus-newsgroup-unreads)
5760 (gnus-tmp-unread-and-unticked (length gnus-newsgroup-unreads))
5761 (gnus-tmp-unselected (length gnus-newsgroup-unselected))
5762 (gnus-tmp-unread-and-unselected
5763 (cond ((and (zerop gnus-tmp-unread-and-unticked)
5764 (zerop gnus-tmp-unselected))
5766 ((zerop gnus-tmp-unselected)
5767 (format "{%d more}" gnus-tmp-unread-and-unticked))
5769 gnus-tmp-unread-and-unticked
5770 gnus-tmp-unselected))))
5771 (gnus-tmp-subject
5772 (if (and gnus-current-headers
5773 (vectorp gnus-current-headers))
5774 (gnus-mode-string-quote
5775 (mail-header-subject gnus-current-headers))
5778 gnus-tmp-header) ;; passed as argument to any user-format-funcs
5785 (get-buffer gnus-article-buffer))))
5788 (setq max-len (max 4 (if gnus-mode-non-string-length
5790 gnus-mode-non-string-length
5802 (gnus-mode-line-buffer-identification (list mode-string)))
5805 (defun gnus-create-xref-hashtb (from-newsgroup headers unreads)
5808 (let* ((virtual (gnus-virtual-group-p from-newsgroup))
5809 (prefix (if virtual "" (gnus-group-real-prefix from-newsgroup)))
5810 (xref-hashtb (gnus-make-hashtable))
5827 (if (setq entry (gnus-gethash group xref-hashtb))
5829 (gnus-sethash group (cons number nil) xref-hashtb)))))
5832 (defun gnus-mark-xrefs-as-read (from-newsgroup headers unreads)
5834 (let ((virtual (gnus-virtual-group-p from-newsgroup))
5837 (set-buffer gnus-group-buffer)
5839 (gnus-create-xref-hashtb from-newsgroup headers unreads))
5846 (setq entry (gnus-gethash name gnus-newsrc-hashtb)
5848 (when (stringp (setq nth4 (gnus-info-method info)))
5849 (setq nth4 (gnus-server-to-method nth4))))
5852 (or (gnus-methods-equal-p
5853 nth4 (gnus-find-method-for-group from-newsgroup))
5855 (equal nth4 (setq method (gnus-find-method-for-group
5859 gnus-use-cross-reference
5860 (or (not (eq gnus-use-cross-reference t))
5864 (<= (gnus-info-level info) gnus-level-subscribed))
5865 (gnus-group-make-articles-read name idlist))))
5868 (defun gnus-compute-read-articles (group articles)
5869 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb))
5871 (active (gnus-active group))
5874 ;; First peel off all invalid article numbers.
5882 ;; a new article that is cross-posted to a different
5884 ;; crossposted article that has a higher number than
5889 (setq active (or (gnus-activate-group group) active)))
5895 (null (gnus-info-read info))
5898 (setq ninfo (gnus-info-read info)))
5900 (gnus-add-to-range
5903 (defun gnus-group-make-articles-read (group articles)
5906 (entry (gnus-gethash group gnus-newsrc-hashtb))
5908 (active (gnus-active group))
5911 (setq range (gnus-compute-read-articles group articles))
5913 (set-buffer gnus-group-buffer)
5914 (gnus-undo-register
5916 (gnus-info-set-marks ',info ',(gnus-info-marks info) t)
5917 (gnus-info-set-read ',info ',(gnus-info-read info))
5918 (gnus-get-unread-articles-in-group ',info (gnus-active ,group))
5919 (gnus-request-set-mark ,group (list (list ',range 'del '(read))))
5920 (gnus-group-update-group ,group t))))
5922 (gnus-info-set-read info range)
5923 (gnus-request-set-mark group (list (list range 'add '(read))))
5943 (unless (gnus-ephemeral-group-p group)
5944 (gnus-group-update-group group t))))))
5946 (defvar gnus-newsgroup-none-id 0)
5948 (defun gnus-get-newsgroup-headers (&optional dependencies force-new)
5952 (save-excursion (set-buffer gnus-summary-buffer)
5953 gnus-newsgroup-dependencies)))
5955 (mail-parse-charset gnus-newsgroup-charset)
5958 (set-buffer gnus-summary-buffer)
5960 gnus-newsgroup-ignored-charsets)))
5967 (gnus-run-hooks 'gnus-parse-headers-hook)
5998 (funcall gnus-decode-encoded-word-function
6005 (funcall gnus-decode-encoded-address-function
6078 (when gnus-extra-headers
6079 (let ((extra gnus-extra-headers)
6092 (when gnus-alter-header-function
6093 (funcall gnus-alter-header-function header)
6095 ref (gnus-parent-id (mail-header-references header))))
6098 (gnus-dependencies-add-header
6106 (defun gnus-get-newsgroup-headers-xover (sequence &optional
6114 (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs))
6115 (let ((mail-parse-charset gnus-newsgroup-charset)
6116 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets)
6118 (dependencies (or dependencies gnus-newsgroup-dependencies))
6120 ((eq gnus-read-all-available-headers t)
6122 ((and (stringp gnus-read-all-available-headers)
6124 (string-match gnus-read-all-available-headers group))
6132 (gnus-run-hooks 'gnus-parse-headers-hook)
6134 (gnus-parse-without-error
6148 (gnus-nov-parse-line
6152 ;; A common bug in inn is that if you have posted an article and
6154 ;; the new article is included. However, a NOV entry for the
6155 ;; article may not have been generated yet, so this may fail.
6162 (let ((gnus-nov-is-evil t))
6165 (when (eq (gnus-retrieve-headers sequence group) 'headers)
6166 (gnus-get-newsgroup-headers))))))))
6168 (defun gnus-article-get-xrefs ()
6169 "Fill in the Xref value in `gnus-current-headers', if necessary.
6170 This is meant to be called in `gnus-article-internal-prepare-hook'."
6171 (let ((headers (save-excursion (set-buffer gnus-summary-buffer)
6172 gnus-current-headers)))
6173 (or (not gnus-use-cross-reference)
6187 (setq xref (buffer-substring (point) (gnus-point-at-eol)))
6190 (defun gnus-summary-insert-subject (id &optional old-header use-old-header)
6191 "Find article ID and insert the summary line for that article.
6199 (gnus-number-to-header id))
6200 (gnus-number-to-header id))
6202 (gnus-read-header id))))
6206 ;; Rebuild the thread that this article is part of and go to the
6207 ;; article we have fetched.
6208 (when (and (not gnus-show-threads)
6211 (setq d (gnus-data-find (mail-header-number old-header))))
6212 (goto-char (gnus-data-pos d))
6213 (gnus-data-remove
6215 (- (gnus-point-at-bol)
6217 (1+ (gnus-point-at-eol))
6218 (gnus-delete-line))))))
6220 (when gnus-list-identifiers
6221 (let ((gnus-newsgroup-headers (list header)))
6222 (gnus-summary-remove-list-identifiers)))
6225 (setq gnus-newsgroup-sparse
6227 gnus-newsgroup-sparse))
6228 (setq gnus-newsgroup-ancient (delq number gnus-newsgroup-ancient))
6229 (push number gnus-newsgroup-limit)
6230 (gnus-rebuild-thread (mail-header-id header) line)
6231 (gnus-summary-goto-subject number nil t))
6235 ;; article if ID is a number -- so that the next `P' or `N'
6236 ;; command will fetch the previous (or next) article even
6238 (when (> number gnus-newsgroup-end)
6239 (setq gnus-newsgroup-end number))
6240 (when (< number gnus-newsgroup-begin)
6241 (setq gnus-newsgroup-begin number))
6242 (setq gnus-newsgroup-unselected
6243 (delq number gnus-newsgroup-unselected)))
6249 (defun gnus-summary-work-articles (n)
6252 current article will be taken into consideration."
6254 (set-buffer gnus-summary-buffer)
6261 articles article)
6265 (push (setq article (gnus-summary-article-number))
6268 (gnus-summary-find-prev nil article)
6269 (gnus-summary-find-next nil article)))
6272 ((and (gnus-region-active-p) (mark))
6276 articles article)
6281 (push (setq article (gnus-summary-article-number)) articles)
6282 (gnus-summary-find-next nil article)
6285 (gnus-newsgroup-processable
6288 (gnus-summary-save-process-mark)
6290 (reverse gnus-newsgroup-processable))
6292 ;; Just return the current article.
6293 (list (gnus-summary-article-number))))))
6295 (defmacro gnus-summary-iterate (arg &rest forms)
6299 (let ((articles (make-symbol "gnus-summary-iterate-articles")))
6300 `(let ((,articles (gnus-summary-work-articles ,arg)))
6302 (gnus-summary-goto-subject (car ,articles))
6306 (put 'gnus-summary-iterate 'lisp-indent-function 1)
6307 (put 'gnus-summary-iterate 'edebug-form-spec '(form body))
6309 (defun gnus-summary-save-process-mark ()
6312 (push (copy-sequence gnus-newsgroup-processable)
6313 gnus-newsgroup-process-stack))
6315 (defun gnus-summary-kill-process-mark ()
6318 (gnus-summary-save-process-mark)
6319 (gnus-summary-unmark-all-processable))
6321 (defun gnus-summary-yank-process-mark ()
6324 (unless gnus-newsgroup-process-stack
6326 (gnus-summary-process-mark-set (pop gnus-newsgroup-process-stack)))
6328 (defun gnus-summary-process-mark-set (set)
6330 (gnus-summary-unmark-all-processable)
6332 (gnus-summary-set-process-mark (pop set))))
6336 (defun gnus-summary-search-group (&optional backward use-level)
6340 (set-buffer gnus-group-buffer)
6341 (when (gnus-group-search-forward
6342 backward nil (if use-level (gnus-group-group-level) nil))
6343 (gnus-group-group-name))))
6345 (defun gnus-summary-best-group (&optional exclude-group)
6349 (set-buffer gnus-group-buffer)
6351 (gnus-group-best-unread-group exclude-group))))
6353 (defun gnus-summary-find-next (&optional unread article backward)
6355 (gnus-summary-find-prev unread article)
6356 (let* ((dummy (gnus-summary-article-intangible-p))
6357 (article (or article (gnus-summary-article-number)))
6358 (data (gnus-data-find-list article))
6361 (or (not gnus-summary-check-current)
6363 (not (gnus-data-unread-p (car data)))))
6369 (unless (memq (gnus-data-number (car data))
6371 ((eq gnus-auto-goto-ignores
6373 gnus-newsgroup-undownloaded)
6374 (gnus-plugged
6376 ((eq gnus-auto-goto-ignores
6378 gnus-newsgroup-unfetched)
6379 ((eq gnus-auto-goto-ignores
6381 gnus-newsgroup-undownloaded)))
6382 (when (gnus-data-unread-p (car data))
6388 (goto-char (gnus-data-pos result))
6389 (gnus-data-number result)))))
6391 (defun gnus-summary-find-prev (&optional unread article)
6393 (article (or article (gnus-summary-article-number)))
6394 (data (gnus-data-find-list article (gnus-data-list 'rev)))
6397 (or (not gnus-summary-check-current)
6399 (not (gnus-data-unread-p (car data)))))
6405 (unless (memq (gnus-data-number (car data))
6407 ((eq gnus-auto-goto-ignores
6409 gnus-newsgroup-undownloaded)
6410 (gnus-plugged
6412 ((eq gnus-auto-goto-ignores
6414 gnus-newsgroup-unfetched)
6415 ((eq gnus-auto-goto-ignores
6417 gnus-newsgroup-undownloaded)))
6418 (when (gnus-data-unread-p (car data))
6424 (goto-char (gnus-data-pos result))
6425 (gnus-data-number result))))
6427 (defun gnus-summary-find-subject (subject &optional unread backward article)
6428 (let* ((simp-subject (gnus-simplify-subject-fully subject))
6429 (article (or article (gnus-summary-article-number)))
6430 (articles (gnus-data-list backward))
6431 (arts (gnus-data-find-list article articles))
6433 (when (or (not gnus-summary-check-current)
6435 (not (gnus-data-unread-p (car arts))))
6439 (gnus-data-unread-p (car arts)))
6440 (vectorp (gnus-data-header (car arts)))
6441 (gnus-subject-equal
6442 simp-subject (mail-header-subject (gnus-data-header (car arts))) t)
6447 (goto-char (gnus-data-pos result))
6448 (gnus-data-number result))))
6450 (defun gnus-summary-search-forward (&optional unread subject backward)
6451 "Search forward for an article.
6454 (cond (subject (gnus-summary-find-subject subject unread backward))
6455 (backward (gnus-summary-find-prev unread))
6456 (t (gnus-summary-find-next unread))))
6458 (defun gnus-recenter (&optional n)
6462 (when (and gnus-auto-center-summary
6463 (not (eq gnus-auto-center-summary 'vertical)))
6464 (gnus-horizontal-recenter))
6467 (defun gnus-summary-recenter ()
6469 If `gnus-auto-center-summary' is nil, or the article buffer isn't
6475 (when gnus-auto-center-summary
6478 (t (if (numberp gnus-auto-center-summary)
6479 gnus-auto-center-summary
6486 (when (get-buffer-window gnus-article-buffer)
6487 ;; Only do recentering when the article buffer is displayed,
6509 (not (eq gnus-auto-center-summary 'vertical)))
6512 (gnus-summary-position-point)
6513 (gnus-horizontal-recenter)
6516 (defun gnus-summary-jump-to-group (newsgroup)
6519 (if (eq (current-buffer) (get-buffer gnus-group-buffer))
6522 (when (get-buffer-window gnus-group-buffer)
6523 (pop-to-buffer gnus-group-buffer))
6524 (gnus-group-jump-to-group newsgroup))
6527 (if (get-buffer-window gnus-group-buffer)
6528 (pop-to-buffer gnus-group-buffer)
6529 (set-buffer gnus-group-buffer))
6530 (gnus-group-jump-to-group newsgroup))))
6532 ;; This function returns a list of article numbers based on the
6535 (defun gnus-list-of-unread-articles (group)
6536 (let* ((read (gnus-info-read (gnus-get-info group)))
6537 (active (or (gnus-active group) (gnus-activate-group group)))
6544 ;; first unread article is the article after the last read
6545 ;; article. Sounds logical, doesn't it?
6571 (defun gnus-list-of-read-articles (group)
6573 (let* ((info (gnus-get-info group))
6574 (marked (gnus-info-marks info))
6575 (active (gnus-active group)))
6577 (gnus-list-range-difference
6578 (gnus-list-range-difference
6579 (gnus-sorted-complement
6580 (gnus-uncompress-range active)
6581 (gnus-list-of-unread-articles group))
6585 ;; This function returns a sequence of article numbers based on the
6588 (defun gnus-sequence-of-unread-articles (group)
6589 (let* ((read (gnus-info-read (gnus-get-info group)))
6590 (active (or (gnus-active group) (gnus-activate-group group)))
6597 ;; first unread article is the article after the last read
6598 ;; article. Sounds logical, doesn't it?
6627 (defun gnus-summary-select-article-buffer ()
6628 "Reconfigure windows to show article buffer."
6630 (if (not (gnus-buffer-live-p gnus-article-buffer))
6631 (error "There is no article buffer for this summary buffer")
6632 (gnus-configure-windows 'article)
6633 (select-window (get-buffer-window gnus-article-buffer))))
6635 (defun gnus-summary-universal-argument (arg)
6638 (let ((articles (gnus-summary-work-articles arg))
6639 func article)
6646 "\\<gnus-summary-mode-map>\\[gnus-summary-universal-argument]"))))
6648 (gnus-error 1 "Undefined key")
6651 (gnus-summary-goto-subject (setq article (pop articles)))
6652 (let (gnus-newsgroup-processable)
6654 (gnus-summary-remove-process-mark article)))))
6655 (gnus-summary-position-point))
6657 (defun gnus-summary-toggle-truncation (&optional arg)
6664 (redraw-display))
6666 (defun gnus-summary-find-for-reselect ()
6667 "Return the number of an article to stay on across a reselect.
6668 The current article is considered, then following articles, then previous
6669 articles. An article is sought which is not cancelled and isn't a temporary
6674 (let ((data (gnus-data-find-list
6675 (gnus-summary-article-number) (gnus-data-list rev))))
6677 (if (and (< 0 (gnus-data-number (car data)))
6678 (not (eq gnus-canceled-mark (gnus-data-mark (car data)))))
6679 (setq found (gnus-data-number (car data))))
6683 (defun gnus-summary-reselect-current-group (&optional all rescan)
6687 (when (gnus-ephemeral-group-p gnus-newsgroup-name)
6689 (let ((current-subject (gnus-summary-find-for-reselect))
6690 (group gnus-newsgroup-name))
6691 (setq gnus-newsgroup-begin nil)
6692 (gnus-summary-exit nil 'leave-hidden)
6695 (gnus-summary-jump-to-group group)
6698 (gnus-group-get-new-news-this-group 1)))
6699 (gnus-group-read-group all t)
6700 (gnus-summary-goto-subject current-subject nil t)))
6702 (defun gnus-summary-rescan-group (&optional all)
6705 (gnus-summary-reselect-current-group all t))
6707 (defun gnus-summary-update-info (&optional non-destructive)
6709 (let ((group gnus-newsgroup-name))
6711 (when gnus-newsgroup-kill-headers
6712 (setq gnus-newsgroup-killed
6713 (gnus-compress-sequence
6714 (gnus-sorted-union
6715 (gnus-list-range-intersection
6716 gnus-newsgroup-unselected gnus-newsgroup-killed)
6717 gnus-newsgroup-unreads)
6719 (unless (listp (cdr gnus-newsgroup-killed))
6720 (setq gnus-newsgroup-killed (list gnus-newsgroup-killed)))
6721 (let ((headers gnus-newsgroup-headers))
6724 (set-buffer gnus-group-buffer)
6725 (gnus-undo-force-boundary))
6726 (gnus-update-read-articles
6727 group (gnus-sorted-union
6728 gnus-newsgroup-unreads gnus-newsgroup-unselected))
6729 ;; Set the current article marks.
6730 (let ((gnus-newsgroup-scored
6731 (if (and (not gnus-save-score)
6734 gnus-newsgroup-scored)))
6736 (gnus-update-marks)))
6738 (when gnus-use-cross-reference
6739 (gnus-mark-xrefs-as-read group headers gnus-newsgroup-unreads))
6741 (set-buffer gnus-group-buffer)
6742 (unless (gnus-ephemeral-group-p group)
6743 (gnus-group-update-group group)))))))
6745 (defun gnus-summary-save-newsrc (&optional force)
6750 (gnus-summary-update-info t)
6752 (gnus-save-newsrc-file)
6753 (gnus-dribble-save)))
6755 (defun gnus-summary-exit (&optional temporary leave-hidden)
6757 `gnus-exit-group-hook' is called with no arguments if that value is non-nil."
6759 (gnus-set-global-variables)
6760 (when (gnus-buffer-live-p gnus-article-buffer)
6762 (set-buffer gnus-article-buffer)
6763 (mm-destroy-parts gnus-article-mime-handles)
6765 (setq gnus-article-mime-handle-alist nil)
6766 (setq gnus-article-mime-handles nil)))
6767 (gnus-kill-save-kill-buffer)
6768 (gnus-async-halt-prefetch)
6769 (let* ((group gnus-newsgroup-name)
6770 (quit-config (gnus-group-quit-config gnus-newsgroup-name))
6771 (gnus-group-is-exiting-p t)
6777 (when gnus-newsgroup-adaptive
6778 (gnus-score-adaptive))
6779 (when gnus-use-scoring
6780 (gnus-score-save)))
6781 (gnus-run-hooks 'gnus-summary-prepare-exit-hook)
6782 ;; If we have several article buffers, we kill them at exit.
6783 (unless gnus-single-article-buffer
6784 (gnus-kill-buffer gnus-original-article-buffer)
6785 (setq gnus-article-current nil))
6786 (when gnus-use-cache
6787 (gnus-cache-possibly-remove-articles)
6788 (gnus-cache-save-buffers))
6789 (gnus-async-prefetch-remove-group group)
6790 (when gnus-suppress-duplicates
6791 (gnus-dup-enter-articles))
6792 (when gnus-use-trees
6793 (gnus-tree-close group))
6794 (when gnus-use-cache
6795 (gnus-cache-write-active))
6797 (nnmail-purge-split-history (gnus-group-real-name group))
6800 (gnus-run-hooks 'gnus-exit-group-hook)
6801 (gnus-summary-update-info))
6802 (gnus-close-group group)
6804 (set-buffer gnus-group-buffer)
6806 (gnus-group-jump-to-group group))
6807 (gnus-run-hooks 'gnus-summary-exit-hook)
6811 (not (string= group (gnus-group-group-name))))
6812 (gnus-group-next-unread-group 1))
6816 ;; If we have several article buffers, we kill them at exit.
6817 (unless gnus-single-article-buffer
6818 (gnus-kill-buffer gnus-article-buffer)
6819 (gnus-kill-buffer gnus-original-article-buffer)
6820 (setq gnus-article-current nil))
6822 (if (not gnus-kill-summary-on-exit)
6824 (gnus-deaden-summary)
6830 (gnus-summary-clear-local-variables)
6831 (let ((gnus-summary-local-variables gnus-newsgroup-variables))
6832 (gnus-summary-clear-local-variables))
6833 (when (get-buffer gnus-article-buffer)
6834 (bury-buffer gnus-article-buffer))
6837 (set-buffer gnus-group-buffer)
6838 (gnus-summary-clear-local-variables)
6839 (let ((gnus-summary-local-variables gnus-newsgroup-variables))
6840 (gnus-summary-clear-local-variables))
6842 (when (eq mode 'gnus-summary-mode)
6843 (gnus-kill-buffer buf)))
6844 (setq gnus-current-select-method gnus-select-method)
6845 (set-buffer gnus-group-buffer)
6847 (gnus-handle-ephemeral-exit quit-config)
6849 ;; If gnus-group-buffer is already displayed, make sure we also move
6854 (gnus-configure-windows 'group 'force)))
6857 (setq gnus-newsgroup-name nil)))))
6859 (defalias 'gnus-summary-quit 'gnus-summary-exit-no-update)
6860 (defun gnus-summary-exit-no-update (&optional no-questions)
6861 "Quit reading current newsgroup without updating read article info."
6863 (let* ((group gnus-newsgroup-name)
6864 (gnus-group-is-exiting-p t)
6865 (gnus-group-is-exiting-without-update-p t)
6866 (quit-config (gnus-group-quit-config group)))
6868 gnus-expert-user
6869 (gnus-y-or-n-p "Discard changes to this group and exit? "))
6870 (gnus-async-halt-prefetch)
6871 (run-hooks 'gnus-summary-prepare-exit-hook)
6872 (when (gnus-buffer-live-p gnus-article-buffer)
6874 (set-buffer gnus-article-buffer)
6875 (mm-destroy-parts gnus-article-mime-handles)
6877 (setq gnus-article-mime-handle-alist nil)
6878 (setq gnus-article-mime-handles nil)))
6879 ;; If we have several article buffers, we kill them at exit.
6880 (unless gnus-single-article-buffer
6881 (gnus-kill-buffer gnus-article-buffer)
6882 (gnus-kill-buffer gnus-original-article-buffer)
6883 (setq gnus-article-current nil))
6884 (if (not gnus-kill-summary-on-exit)
6885 (gnus-deaden-summary)
6886 (gnus-close-group group)
6887 (gnus-summary-clear-local-variables)
6888 (let ((gnus-summary-local-variables gnus-newsgroup-variables))
6889 (gnus-summary-clear-local-variables))
6890 (set-buffer gnus-group-buffer)
6891 (gnus-summary-clear-local-variables)
6892 (let ((gnus-summary-local-variables gnus-newsgroup-variables))
6893 (gnus-summary-clear-local-variables))
6894 (gnus-kill-buffer gnus-summary-buffer))
6895 (unless gnus-single-article-buffer
6896 (setq gnus-article-current nil))
6897 (when gnus-use-trees
6898 (gnus-tree-close group))
6899 (gnus-async-prefetch-remove-group group)
6900 (when (get-buffer gnus-article-buffer)
6901 (bury-buffer gnus-article-buffer))
6903 (gnus-configure-windows 'group 'force)
6905 (setq gnus-newsgroup-name nil)
6906 (unless (gnus-ephemeral-group-p group)
6907 (gnus-group-update-group group))
6908 (when (equal (gnus-group-group-name) group)
6909 (gnus-group-next-unread-group 1))
6911 (gnus-handle-ephemeral-exit quit-config)))))
6913 (defun gnus-handle-ephemeral-exit (quit-config)
6917 (gnus-configure-windows 'group 'force)
6919 (cond ((eq major-mode 'gnus-summary-mode)
6920 (gnus-set-global-variables))
6921 ((eq major-mode 'gnus-article-mode)
6923 ;; The `gnus-summary-buffer' variable may point
6925 ;; article buffer.
6926 (unless (gnus-buffer-live-p gnus-summary-buffer)
6927 (set-buffer gnus-group-buffer))
6928 (set-buffer gnus-summary-buffer)
6929 (gnus-set-global-variables))))
6930 (if (or (eq (cdr quit-config) 'article)
6933 ;; The current article may be from the ephemeral group
6934 ;; thus it is best that we reload this article
6938 ;;(gnus-summary-show-article)
6939 (if (and (boundp 'gnus-pick-mode) (symbol-value 'gnus-pick-mode))
6940 (gnus-configure-windows 'pick 'force)
6941 (gnus-configure-windows (cdr quit-config) 'force)))
6942 (gnus-configure-windows (cdr quit-config) 'force))
6943 (when (eq major-mode 'gnus-summary-mode)
6944 (gnus-summary-next-subject 1 nil t)
6945 (gnus-summary-recenter)
6946 (gnus-summary-position-point))))
6950 (defvar gnus-dead-summary-mode-map nil)
6952 (unless gnus-dead-summary-mode-map
6953 (setq gnus-dead-summary-mode-map (make-keymap))
6954 (suppress-keymap gnus-dead-summary-mode-map)
6956 'undefined 'gnus-summary-wake-up-the-dead gnus-dead-summary-mode-map)
6958 (define-key gnus-dead-summary-mode-map
6959 key 'gnus-summary-wake-up-the-dead))
6961 (define-key gnus-dead-summary-mode-map key 'bury-buffer)))
6963 (defvar gnus-dead-summary-mode nil
6966 (defun gnus-dead-summary-mode (&optional arg)
6969 (when (eq major-mode 'gnus-summary-mode)
6970 (make-local-variable 'gnus-dead-summary-mode)
6971 (setq gnus-dead-summary-mode
6972 (if (null arg) (not gnus-dead-summary-mode)
6974 (when gnus-dead-summary-mode
6975 (gnus-add-minor-mode
6976 'gnus-dead-summary-mode " Dead" gnus-dead-summary-mode-map))))
6978 (defun gnus-deaden-summary ()
6981 (when (and gnus-dead-summary
6982 (buffer-name gnus-dead-summary))
6984 (set-buffer gnus-dead-summary)
6985 (when gnus-dead-summary-mode
6988 (setq gnus-dead-summary (current-buffer))
6989 (gnus-dead-summary-mode 1)
6998 (defun gnus-kill-or-deaden-summary (buffer)
7002 (not gnus-single-article-buffer))
7005 (gnus-kill-buffer gnus-article-buffer)
7006 (gnus-kill-buffer gnus-original-article-buffer)))
7009 (gnus-kill-summary-on-exit
7010 (when (and gnus-use-trees
7011 (gnus-buffer-exists-p buffer))
7014 (gnus-tree-close gnus-newsgroup-name)))
7015 (gnus-kill-buffer buffer))
7017 ((gnus-buffer-exists-p buffer)
7020 (gnus-deaden-summary))))))
7022 (defun gnus-summary-wake-up-the-dead (&rest args)
7025 (gnus-dead-summary-mode -1)
7032 (gnus-message 3 "This dead summary is now alive again"))
7035 (defun gnus-summary-fetch-faq (&optional faq-dir)
7043 "FAQ dir: " (and (listp gnus-group-faq-directory)
7045 gnus-group-faq-directory))))))
7046 (let (gnus-faq-buffer)
7047 (when (setq gnus-faq-buffer
7048 (gnus-group-fetch-faq gnus-newsgroup-name faq-dir))
7049 (gnus-configure-windows 'summary-faq))))
7052 (defun gnus-summary-describe-group (&optional force)
7055 (gnus-group-describe-group force gnus-newsgroup-name))
7057 (defun gnus-summary-describe-briefly ()
7060 (gnus-message 6 (substitute-command-keys "\\<gnus-summary-mode-map>\\[gnus-summary-next-page]:Select \\[gnus-summary-next-unread-article]:Forward \\[gnus-summary-prev-unread-article]:Backward \\[gnus-summary-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-summary-describe-briefly]:This help")))
7064 (defun gnus-summary-next-group (&optional no-article target-group backward)
7066 If prefix argument NO-ARTICLE is non-nil, no article is selected
7071 (gnus-async-halt-prefetch)
7072 (let ((current-group gnus-newsgroup-name)
7079 (gnus-summary-exit t)
7082 (set-buffer gnus-group-buffer)
7083 (gnus-group-jump-to-group current-group)
7086 (if (eq gnus-keep-same-level 'best)
7087 (gnus-summary-best-group gnus-newsgroup-name)
7088 (gnus-summary-search-group backward gnus-keep-same-level))))
7093 (gnus-message 5 "Returning to the group buffer")
7095 (when (gnus-buffer-live-p current-buffer)
7097 (gnus-summary-exit))
7098 (gnus-run-hooks 'gnus-group-no-more-groups-hook))
7100 (gnus-group-jump-to-group target-group)
7101 (let ((unreads (gnus-group-group-unread)))
7104 (gnus-summary-read-group
7105 target-group nil no-article
7112 (defun gnus-summary-prev-group (&optional no-article)
7114 If prefix argument NO-ARTICLE is non-nil, no article is selected initially."
7116 (gnus-summary-next-group no-article nil t))
7120 (defun gnus-summary-first-subject (&optional unread undownloaded unseen)
7122 If UNREAD is non-nil, the article should be unread.
7123 If UNDOWNLOADED is non-nil, the article should be undownloaded.
7124 If UNSEEN is non-nil, the article should be unseen.
7125 Returns the article selected or nil if there are no matching articles."
7129 ((null gnus-newsgroup-data)
7130 (gnus-message 3 "No articles in the group")
7132 ;; Pick the first article.
7134 (goto-char (gnus-data-pos (car gnus-newsgroup-data)))
7135 (gnus-data-number (car gnus-newsgroup-data)))
7136 ;; Find the first unread article.
7138 (let ((data gnus-newsgroup-data))
7140 (let ((num (gnus-data-number (car data))))
7141 (or (memq num gnus-newsgroup-unfetched)
7143 (memq num gnus-newsgroup-unreads))
7145 (memq num gnus-newsgroup-undownloaded))
7147 (memq num gnus-newsgroup-unseen)))))))
7152 (goto-char (gnus-data-pos (car data)))
7153 (gnus-data-number (car data)))
7154 (gnus-message 3 "No more%s articles"
7169 (gnus-summary-position-point))))))
7171 (defun gnus-summary-next-subject (n &optional unread dont-display)
7182 (gnus-summary-find-prev unread)
7183 (gnus-summary-find-next unread)))
7185 (gnus-summary-show-thread)))
7187 (gnus-message 7 "No more%s articles"
7189 (unless dont-display
7190 (gnus-summary-recenter)
7191 (gnus-summary-position-point))
7194 (defun gnus-summary-next-unread-subject (n)
7197 (gnus-summary-next-subject n t))
7199 (defun gnus-summary-prev-subject (n &optional unread)
7201 If optional argument UNREAD is non-nil, only unread article is selected."
7203 (gnus-summary-next-subject (- n) unread))
7205 (defun gnus-summary-prev-unread-subject (n)
7208 (gnus-summary-next-subject (- n) t))
7210 (defun gnus-summary-goto-subjects (articles)
7213 (dolist (article articles)
7214 (gnus-summary-goto-subject article t)))
7215 (gnus-summary-limit (append articles gnus-newsgroup-limit))
7216 (gnus-summary-position-point))
7218 (defun gnus-summary-goto-subject (article &optional force silent)
7222 (unless (numberp article)
7223 (error "Article %s is not a number" article))
7225 (data (gnus-data-find article)))
7226 ;; We read in the article if we have to.
7229 (gnus-summary-insert-subject
7230 article
7233 (setq data (gnus-data-find article)))
7238 (gnus-message 3 "Can't find article %d" article))
7240 (let ((pt (gnus-data-pos data)))
7242 (gnus-summary-set-article-display-arrow pt))
7243 (gnus-summary-position-point)
7244 article)))
7248 (defun gnus-summary-expand-window (&optional arg)
7250 Given a prefix, will force an `article' buffer configuration."
7253 (gnus-configure-windows 'article 'force)
7254 (gnus-configure-windows 'summary 'force)))
7256 (defun gnus-summary-display-article (article &optional all-header)
7257 "Display ARTICLE in article buffer."
7258 (when (gnus-buffer-live-p gnus-article-buffer)
7259 (with-current-buffer gnus-article-buffer
7261 (gnus-set-global-variables)
7262 (when (gnus-buffer-live-p gnus-article-buffer)
7263 (with-current-buffer gnus-article-buffer
7264 (setq gnus-article-charset gnus-newsgroup-charset)
7265 (setq gnus-article-ignored-charsets gnus-newsgroup-ignored-charsets)
7267 (if (null article)
7270 (if gnus-summary-display-article-function
7271 (funcall gnus-summary-display-article-function article all-header)
7272 (gnus-article-prepare article all-header))
7273 (gnus-run-hooks 'gnus-select-article-hook)
7274 (when (and gnus-current-article
7275 (not (zerop gnus-current-article)))
7276 (gnus-summary-goto-subject gnus-current-article))
7277 (gnus-summary-recenter)
7278 (when (and gnus-use-trees gnus-show-threads)
7279 (gnus-possibly-generate-tree article)
7280 (gnus-highlight-selected-tree article))
7281 ;; Successfully display article.
7282 (gnus-article-set-window-start
7283 (cdr (assq article gnus-newsgroup-bookmarks))))))
7285 (defun gnus-summary-select-article (&optional all-headers force pseudo article)
7286 "Select the current article.
7288 non-nil, the article will be re-fetched even if it already present in
7289 the article buffer. If PSEUDO is non-nil, pseudo-articles will also
7292 (unless (eq major-mode 'gnus-summary-mode)
7293 (set-buffer gnus-summary-buffer))
7294 (let ((article (or article (gnus-summary-article-number)))
7296 gnus-summary-display-article-function)
7298 (gnus-summary-article-pseudo-p article)
7299 (error "This is a pseudo-article"))
7301 (set-buffer gnus-summary-buffer)
7302 (if (or (and gnus-single-article-buffer
7303 (or (null gnus-current-article)
7304 (null gnus-article-current)
7305 (null (get-buffer gnus-article-buffer))
7306 (not (eq article (cdr gnus-article-current)))
7307 (not (equal (car gnus-article-current)
7308 gnus-newsgroup-name))))
7309 (and (not gnus-single-article-buffer)
7310 (or (null gnus-current-article)
7311 (not (eq gnus-current-article article))))
7313 ;; The requested article is different from the current article.
7315 (gnus-summary-display-article article all-headers)
7316 (when (gnus-buffer-live-p gnus-article-buffer)
7317 (with-current-buffer gnus-article-buffer
7318 (if (not gnus-article-decoded-p) ;; a local variable
7320 (gnus-article-set-window-start
7321 (cdr (assq article gnus-newsgroup-bookmarks)))
7322 article)
7325 (defun gnus-summary-force-verify-and-decrypt ()
7330 (gnus-article-emulate-mime t)
7331 (gnus-buttonized-mime-types (append (list "multipart/signed"
7333 gnus-buttonized-mime-types)))
7334 (gnus-summary-select-article nil 'force)))
7336 (defun gnus-summary-set-current-mark (&optional current-mark)
7340 (defun gnus-summary-next-article (&optional unread subject backward push)
7341 "Select the next article.
7344 If BACKWARD, the previous article is selected instead of the next."
7347 (unless (eq major-mode 'gnus-summary-mode)
7348 (set-buffer gnus-summary-buffer))
7350 ;; Is there such an article?
7351 ((and (gnus-summary-search-forward unread subject backward)
7352 (or (gnus-summary-display-article (gnus-summary-article-number))
7353 (eq (gnus-summary-article-mark) gnus-canceled-mark)))
7354 (gnus-summary-position-point))
7357 gnus-auto-select-same
7358 (gnus-summary-first-unread-article))
7359 (gnus-summary-position-point)
7360 (gnus-message 6 "Wrapped"))
7361 ;; Try to get next/previous article not displayed in this group.
7362 ((and gnus-auto-extend-newsgroup
7364 (gnus-summary-goto-article
7365 (if backward (1- gnus-newsgroup-begin) (1+ gnus-newsgroup-end))
7369 (unless (gnus-ephemeral-group-p gnus-newsgroup-name)
7370 (gnus-summary-jump-to-group gnus-newsgroup-name))
7374 (set-buffer gnus-group-buffer)
7377 (if (eq gnus-keep-same-level 'best)
7378 (gnus-summary-best-group gnus-newsgroup-name)
7379 (gnus-summary-search-group backward gnus-keep-same-level))))
7385 ((or (not gnus-auto-select-next)
7387 (gnus-message 7 "No more%s articles" (if unread " unread" "")))
7388 ((or (eq gnus-auto-select-next 'quietly)
7389 (and (eq gnus-auto-select-next 'slightly-quietly)
7391 (and (eq gnus-auto-select-next 'almost-quietly)
7392 (gnus-summary-last-article-p)))
7394 (if (gnus-ephemeral-group-p gnus-newsgroup-name)
7395 (gnus-summary-exit)
7396 (gnus-message 7 "No more%s articles (%s)..."
7400 (gnus-summary-next-group nil group backward)))
7402 (when (gnus-key-press-event-p last-input-event)
7403 (gnus-summary-walk-group-buffer
7404 gnus-newsgroup-name cmd unread backward point))))))))
7406 (defun gnus-summary-walk-group-buffer (from-group cmd unread backward start)
7407 (let ((keystrokes '((?\C-n (gnus-group-next-unread-group 1))
7408 (?\C-p (gnus-group-prev-unread-group 1))))
7412 (set-buffer gnus-group-buffer)
7415 (if (eq gnus-keep-same-level 'best)
7416 (gnus-summary-best-group gnus-newsgroup-name)
7417 (gnus-summary-search-group backward gnus-keep-same-level))))
7423 (not (gnus-ephemeral-group-p gnus-newsgroup-name)))
7426 (gnus-group-decoded-name group)
7427 (car (gnus-gethash group gnus-newsrc-hashtb)))
7430 (gnus-group-decoded-name gnus-newsgroup-name)))))
7432 (setq key (car (setq keve (gnus-read-event-char prompt)))
7437 (switch-to-buffer gnus-group-buffer)
7439 (gnus-group-jump-to-group group))
7441 (setq group (gnus-group-group-name))
7446 (gnus-ephemeral-group-p gnus-newsgroup-name))
7447 (gnus-summary-exit)
7448 (gnus-summary-next-group nil group backward)))
7452 (defun gnus-summary-next-unread-article ()
7453 "Select unread article after current one."
7455 (gnus-summary-next-article
7456 (or (not (eq gnus-summary-goto-unread 'never))
7457 (gnus-summary-last-article-p (gnus-summary-article-number)))
7458 (and gnus-auto-select-same
7459 (gnus-summary-article-subject))))
7461 (defun gnus-summary-prev-article (&optional unread subject)
7462 "Select the article after the current one.
7465 (gnus-summary-next-article unread subject t))
7467 (defun gnus-summary-prev-unread-article ()
7468 "Select unread article before current one."
7470 (gnus-summary-prev-article
7471 (or (not (eq gnus-summary-goto-unread 'never))
7472 (gnus-summary-first-article-p (gnus-summary-article-number)))
7473 (and gnus-auto-select-same
7474 (gnus-summary-article-subject))))
7476 (defun gnus-summary-next-page (&optional lines circular stop)
7477 "Show next page of the selected article.
7478 If at the end of the current article, select the next article.
7481 If CIRCULAR is non-nil, go to the start of the article instead of
7482 selecting the next article when reaching the end of the current
7483 article.
7487 Also see the variable `gnus-article-skip-boring'."
7489 (setq gnus-summary-buffer (current-buffer))
7490 (gnus-set-global-variables)
7491 (let ((article (gnus-summary-article-number))
7492 (article-window (get-buffer-window gnus-article-buffer t))
7494 ;; If the buffer is empty, we have no article.
7495 (unless article
7496 (error "No article to select"))
7497 (gnus-configure-windows 'article)
7498 (if (eq (cdr (assq article gnus-newsgroup-reads)) gnus-canceled-mark)
7499 (if (and (eq gnus-summary-goto-unread 'never)
7500 (not (gnus-summary-last-article-p article)))
7501 (gnus-summary-next-article)
7502 (gnus-summary-next-unread-article))
7503 (if (or (null gnus-current-article)
7504 (null gnus-article-current)
7505 (/= article (cdr gnus-article-current))
7506 (not (equal (car gnus-article-current) gnus-newsgroup-name)))
7507 ;; Selected subject is different from current article's.
7508 (gnus-summary-display-article article)
7509 (when article-window
7510 (gnus-eval-in-buffer-window gnus-article-buffer
7511 (setq endp (or (gnus-article-next-page lines)
7512 (gnus-article-only-boring-p))))
7515 (gnus-message 3 "End of message"))
7517 (gnus-summary-beginning-of-article))
7519 (gnus-message 3 "End of message"))
7521 (if (and (eq gnus-summary-goto-unread 'never)
7522 (not (gnus-summary-last-article-p article)))
7523 (gnus-summary-next-article)
7524 (gnus-summary-next-unread-article))))))))
7525 (gnus-summary-recenter)
7526 (gnus-summary-position-point)))
7528 (defun gnus-summary-prev-page (&optional lines move)
7529 "Show previous page of selected article.
7531 If MOVE, move to the previous unread article if point is at
7534 (let ((article (gnus-summary-article-number))
7535 (article-window (get-buffer-window gnus-article-buffer t))
7537 (gnus-configure-windows 'article)
7538 (if (or (null gnus-current-article)
7539 (null gnus-article-current)
7540 (/= article (cdr gnus-article-current))
7541 (not (equal (car gnus-article-current) gnus-newsgroup-name)))
7542 ;; Selected subject is different from current article's.
7543 (gnus-summary-display-article article)
7544 (gnus-summary-recenter)
7545 (when article-window
7546 (gnus-eval-in-buffer-window gnus-article-buffer
7547 (setq endp (gnus-article-prev-page lines)))
7550 (gnus-message 3 "Beginning of message"))
7552 (if (and (eq gnus-summary-goto-unread 'never)
7553 (not (gnus-summary-first-article-p article)))
7554 (gnus-summary-prev-article)
7555 (gnus-summary-prev-unread-article))))))))
7556 (gnus-summary-position-point))
7558 (defun gnus-summary-prev-page-or-article (&optional lines)
7559 "Show previous page of selected article.
7561 If at the beginning of the article, go to the next article."
7563 (gnus-summary-prev-page lines t))
7565 (defun gnus-summary-scroll-up (lines)
7566 "Scroll up (or down) one line current article.
7569 (gnus-configure-windows 'article)
7570 (gnus-summary-show-thread)
7571 (when (eq (gnus-summary-select-article nil nil 'pseudo) 'old)
7572 (gnus-eval-in-buffer-window gnus-article-buffer
7574 (when (gnus-article-next-page lines)
7575 (gnus-message 3 "End of message")))
7577 (gnus-article-prev-page (- lines))))))
7578 (gnus-summary-recenter)
7579 (gnus-summary-position-point))
7581 (defun gnus-summary-scroll-down (lines)
7582 "Scroll down (or up) one line current article.
7585 (gnus-summary-scroll-up (- lines)))
7587 (defun gnus-summary-next-same-subject ()
7588 "Select next article which has the same subject as current one."
7590 (gnus-summary-next-article nil (gnus-summary-article-subject)))
7592 (defun gnus-summary-prev-same-subject ()
7593 "Select previous article which has the same subject as current one."
7595 (gnus-summary-prev-article nil (gnus-summary-article-subject)))
7597 (defun gnus-summary-next-unread-same-subject ()
7598 "Select next unread article which has the same subject as current one."
7600 (gnus-summary-next-article t (gnus-summary-article-subject)))
7602 (defun gnus-summary-prev-unread-same-subject ()
7603 "Select previous unread article which has the same subject as current one."
7605 (gnus-summary-prev-article t (gnus-summary-article-subject)))
7607 (defun gnus-summary-first-unread-article ()
7608 "Select the first unread article.
7612 (when (gnus-summary-first-subject t)
7613 (gnus-summary-show-thread)
7614 (gnus-summary-first-subject t)
7615 (gnus-summary-display-article (gnus-summary-article-number)))
7616 (gnus-summary-position-point)))
7618 (defun gnus-summary-first-unread-subject ()
7619 "Place the point on the subject line of the first unread article.
7623 (when (gnus-summary-first-subject t)
7624 (gnus-summary-show-thread)
7625 (gnus-summary-first-subject t))
7626 (gnus-summary-position-point)))
7628 (defun gnus-summary-first-unseen-subject ()
7629 "Place the point on the subject line of the first unseen article.
7633 (when (gnus-summary-first-subject nil nil t)
7634 (gnus-summary-show-thread)
7635 (gnus-summary-first-subject nil nil t))
7636 (gnus-summary-position-point)))
7638 (defun gnus-summary-first-unseen-or-unread-subject ()
7639 "Place the point on the subject line of the first unseen article or,
7640 if all article have been seen, on the subject line of the first unread
7641 article."
7644 (unless (when (gnus-summary-first-subject nil nil t)
7645 (gnus-summary-show-thread)
7646 (gnus-summary-first-subject nil nil t))
7647 (when (gnus-summary-first-subject t)
7648 (gnus-summary-show-thread)
7649 (gnus-summary-first-subject t)))
7650 (gnus-summary-position-point)))
7652 (defun gnus-summary-first-article ()
7653 "Select the first article.
7657 (when (gnus-summary-first-subject)
7658 (gnus-summary-show-thread)
7659 (gnus-summary-first-subject)
7660 (gnus-summary-display-article (gnus-summary-article-number)))
7661 (gnus-summary-position-point)))
7663 (defun gnus-summary-best-unread-article (&optional arg)
7664 "Select the unread article with the highest score.
7665 If given a prefix argument, select the next unread article that has a
7668 (let ((article (if arg
7669 (gnus-summary-better-unread-subject)
7670 (gnus-summary-best-unread-subject))))
7671 (if article
7672 (gnus-summary-goto-article article)
7675 (defun gnus-summary-best-unread-subject ()
7679 (data gnus-newsgroup-data)
7680 article score)
7682 (and (gnus-data-unread-p (car data))
7684 (gnus-summary-article-score (gnus-data-number (car data))))
7687 article (gnus-data-number (car data))))
7689 (when article
7690 (gnus-summary-goto-subject article))
7691 (gnus-summary-position-point)
7692 article))
7694 (defun gnus-summary-better-unread-subject ()
7697 (let ((data gnus-newsgroup-data)
7698 article score)
7699 (while (and (setq article (gnus-data-number (car data)))
7700 (or (gnus-data-read-p (car data))
7701 (not (> (gnus-summary-article-score article)
7702 gnus-summary-default-score))))
7704 (when article
7705 (gnus-summary-goto-subject article))
7706 (gnus-summary-position-point)
7707 article))
7709 (defun gnus-summary-last-subject ()
7711 (let ((article (gnus-data-number (car (gnus-data-list t)))))
7712 (when article
7713 (gnus-summary-goto-subject article))))
7715 (defun gnus-summary-goto-article (article &optional all-headers force)
7716 "Fetch ARTICLE (article number or Message-ID) and display it if it exists.
7718 If FORCE, go to the article even if it isn't displayed. If FORCE
7719 is a number, it is the line the article is to be displayed on."
7725 gnus-newsgroup-limit))
7729 (if (and (stringp article)
7730 (string-match "@\\|%40" article))
7731 (gnus-summary-refer-article article)
7732 (when (stringp article)
7733 (setq article (string-to-number article)))
7734 (if (gnus-summary-goto-subject article force)
7735 (gnus-summary-display-article article all-headers)
7736 (gnus-message 4 "Couldn't go to article %s" article) nil))
7737 (gnus-summary-position-point)))
7739 (defun gnus-summary-goto-last-article ()
7740 "Go to the previously read article."
7743 (when gnus-last-article
7744 (gnus-summary-goto-article gnus-last-article nil t))
7745 (gnus-summary-position-point)))
7747 (defun gnus-summary-pop-article (number)
7748 "Pop one article off the history and go to the previous.
7752 (setq gnus-newsgroup-history
7753 (cdr (setq to (nthcdr number gnus-newsgroup-history))))
7755 (gnus-summary-goto-article (car to) nil t)
7757 (gnus-summary-position-point))
7761 (defun gnus-summary-limit-to-articles (n)
7766 (let ((articles (gnus-summary-work-articles n)))
7767 (setq gnus-newsgroup-processable nil)
7768 (gnus-summary-limit articles))
7769 (gnus-summary-position-point)))
7771 (defun gnus-summary-pop-limit (&optional total)
7776 (setq gnus-newsgroup-limits
7778 gnus-newsgroup-headers))))
7779 (unless gnus-newsgroup-limits
7782 (gnus-summary-limit nil 'pop)
7783 (gnus-summary-position-point)))
7785 (defun gnus-summary-limit-to-subject (subject &optional header not-matching)
7797 (let ((articles (gnus-summary-find-matching
7802 (gnus-summary-limit articles))
7803 (gnus-summary-position-point))))
7805 (defun gnus-summary-limit-to-author (from &optional not-matching)
7813 (gnus-summary-limit-to-subject from "from" not-matching))
7815 (defun gnus-summary-limit-to-age (age &optional younger-p)
7841 (let ((data gnus-newsgroup-data)
7845 (when (and (vectorp (gnus-data-header d))
7846 (setq date (mail-header-date (gnus-data-header d))))
7855 (push (gnus-data-number d) articles))))
7856 (gnus-summary-limit (nreverse articles)))
7857 (gnus-summary-position-point)))
7859 (defun gnus-summary-limit-to-extra (header regexp &optional not-matching)
7864 (gnus-completing-read-with-default
7865 (symbol-name (car gnus-extra-headers))
7871 gnus-extra-headers)
7881 (let ((articles (gnus-summary-find-matching
7886 (gnus-summary-limit articles))
7887 (gnus-summary-position-point))))
7889 (defun gnus-summary-limit-to-display-predicate ()
7890 "Limit the summary buffer to the predicated in the `display' group parameter."
7892 (unless gnus-newsgroup-display
7893 (error "There is no `display' group parameter"))
7895 (dolist (number gnus-newsgroup-articles)
7896 (when (funcall gnus-newsgroup-display)
7898 (gnus-summary-limit articles))
7899 (gnus-summary-position-point))
7901 (defalias 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread)
7903 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread)
7905 (defun gnus-summary-limit-to-unread (&optional all)
7910 (gnus-summary-limit-to-marks (char-to-string gnus-unread-mark))
7911 (gnus-summary-limit-to-marks
7912 ;; Concat all the marks that say that an article is read and have
7914 (list gnus-del-mark gnus-read-mark gnus-ancient-mark
7915 gnus-killed-mark gnus-spam-mark gnus-kill-file-mark
7916 gnus-low-score-mark gnus-expirable-mark
7917 gnus-canceled-mark gnus-catchup-mark gnus-sparse-mark
7918 gnus-duplicate-mark gnus-souped-mark)
7921 (defalias 'gnus-summary-delete-marked-with 'gnus-summary-limit-exclude-marks)
7922 (make-obsolete 'gnus-summary-delete-marked-with
7923 'gnus-summary-limit-exclude-marks)
7925 (defun gnus-summary-limit-exclude-marks (marks &optional reverse)
7931 (gnus-summary-limit-to-marks marks t))
7933 (defun gnus-summary-limit-to-marks (marks &optional reverse)
7941 (let ((data gnus-newsgroup-data)
7946 (when (if reverse (not (memq (gnus-data-mark (car data)) marks))
7947 (memq (gnus-data-mark (car data)) marks))
7948 (push (gnus-data-number (car data)) articles))
7950 (gnus-summary-limit articles))
7951 (gnus-summary-position-point)))
7953 (defun gnus-summary-limit-to-score (score)
7956 (let ((data gnus-newsgroup-data)
7959 (when (>= (gnus-summary-article-score (gnus-data-number (car data)))
7961 (push (gnus-data-number (car data)) articles))
7964 (gnus-summary-limit articles)
7965 (gnus-summary-position-point))))
7967 (defun gnus-summary-limit-to-unseen ()
7971 (gnus-summary-limit gnus-newsgroup-unseen)
7972 (gnus-summary-position-point)))
7974 (defun gnus-summary-limit-include-thread (id)
7977 article."
7978 (interactive (list (mail-header-id (gnus-summary-article-header))))
7979 (let ((articles (gnus-articles-in-thread
7980 (gnus-id-to-thread (gnus-root-id id)))))
7982 (gnus-summary-limit (nconc articles gnus-newsgroup-limit))
7983 (gnus-summary-limit-include-matching-articles
7985 (regexp-quote (gnus-simplify-subject-re
7986 (mail-header-subject (gnus-id-to-header id)))))
7987 (gnus-summary-position-point))))
7989 (defun gnus-summary-limit-include-matching-articles (header regexp)
7993 (let ((articles (gnus-find-matching-articles header regexp)))
7995 (gnus-summary-limit (nconc articles gnus-newsgroup-limit))
7996 (gnus-summary-position-point))))
7998 (defun gnus-summary-insert-dormant-articles ()
8001 (let ((gnus-verbose (max 6 gnus-verbose)))
8002 (if (not gnus-newsgroup-dormant)
8003 (gnus-message 3 "No dormant articles for this group")
8004 (gnus-summary-goto-subjects gnus-newsgroup-dormant))))
8006 (defun gnus-summary-limit-include-dormant ()
8011 (unless gnus-newsgroup-dormant
8014 (gnus-summary-limit (append gnus-newsgroup-dormant gnus-newsgroup-limit))
8015 (gnus-summary-position-point)))
8017 (defun gnus-summary-limit-exclude-dormant ()
8021 (gnus-summary-limit-to-marks (list gnus-dormant-mark) 'reverse)
8022 (gnus-summary-position-point)))
8024 (defun gnus-summary-limit-exclude-childless-dormant ()
8027 (let ((data (gnus-data-list t))
8032 (when (or (not (= (gnus-data-mark d) gnus-dormant-mark))
8034 (gnus-article-children (gnus-data-number d)))
8042 (push (gnus-data-number d) articles)))
8045 (gnus-summary-limit articles)
8046 (gnus-summary-position-point))))
8048 (defun gnus-summary-limit-mark-excluded-as-read (&optional all)
8052 (setq gnus-newsgroup-limit (sort gnus-newsgroup-limit '<))
8053 (let ((articles (gnus-sorted-ndifference
8056 gnus-newsgroup-headers)
8058 gnus-newsgroup-limit))
8059 article)
8060 (setq gnus-newsgroup-unreads
8061 (gnus-sorted-intersection gnus-newsgroup-unreads
8062 gnus-newsgroup-limit))
8064 (setq gnus-newsgroup-dormant nil
8065 gnus-newsgroup-marked nil
8066 gnus-newsgroup-reads
8068 (mapcar (lambda (n) (cons n gnus-catchup-mark)) articles)
8069 gnus-newsgroup-reads))
8070 (while (setq article (pop articles))
8071 (unless (or (memq article gnus-newsgroup-dormant)
8072 (memq article gnus-newsgroup-marked))
8073 (push (cons article gnus-catchup-mark) gnus-newsgroup-reads))))))
8075 (defun gnus-summary-limit (articles &optional pop)
8078 (setq articles (car gnus-newsgroup-limits)
8079 gnus-newsgroup-limits (cdr gnus-newsgroup-limits))
8081 (push gnus-newsgroup-limit gnus-newsgroup-limits))
8083 (setq gnus-newsgroup-limit articles)
8084 (let ((total (length gnus-newsgroup-data))
8085 (data (gnus-data-find-list (gnus-summary-article-number)))
8086 (gnus-summary-mark-below nil) ; Inhibit this.
8090 (gnus-summary-prepare)
8092 (gnus-summary-maybe-hide-threads)
8093 ;; Try to return to the article you were at, or one in the
8096 ;; We try to find some article after the current one.
8098 (when (gnus-summary-goto-subject (gnus-data-number (car data)) nil t)
8104 ;; article. The same goes when we can't find any articles
8107 (gnus-summary-find-prev))
8108 (gnus-set-mode-line 'summary)
8111 (- total (length gnus-newsgroup-data))))
8113 (defsubst gnus-invisible-cut-children (threads)
8116 (when (memq (mail-header-number (caar threads)) gnus-newsgroup-limit)
8121 (defsubst gnus-cut-thread (thread)
8122 "Go forwards in the thread until we find an article that we want to display."
8123 (when (or (eq gnus-fetch-old-headers 'some)
8124 (eq gnus-fetch-old-headers 'invisible)
8125 (numberp gnus-fetch-old-headers)
8126 (eq gnus-build-sparse-threads 'some)
8127 (eq gnus-build-sparse-threads 'more))
8132 (gnus-summary-article-sparse-p (mail-header-number (car thread)))
8133 (gnus-summary-article-ancient-p
8136 (eq gnus-fetch-old-headers 'invisible))
8137 (setq gnus-newsgroup-limit
8139 gnus-newsgroup-limit)
8141 (when (gnus-invisible-cut-children (cdr thread))
8145 gnus-newsgroup-limit)
8151 (defun gnus-cut-threads (threads)
8153 (when (or (eq gnus-fetch-old-headers 'some)
8154 (eq gnus-fetch-old-headers 'invisible)
8155 (numberp gnus-fetch-old-headers)
8156 (eq gnus-build-sparse-threads 'some)
8157 (eq gnus-build-sparse-threads 'more))
8160 (setcar th (gnus-cut-thread (car th)))
8165 (defun gnus-summary-initial-limit (&optional show-if-empty)
8170 (if (or gnus-inhibit-limiting
8171 (and (null gnus-newsgroup-dormant)
8172 (eq gnus-newsgroup-display 'gnus-not-ignore)
8173 (not (eq gnus-fetch-old-headers 'some))
8174 (not (numberp gnus-fetch-old-headers))
8175 (not (eq gnus-fetch-old-headers 'invisible))
8176 (null gnus-summary-expunge-below)
8177 (not (eq gnus-build-sparse-threads 'some))
8178 (not (eq gnus-build-sparse-threads 'more))
8179 (null gnus-thread-expunge-below)
8180 (not gnus-use-nocem)))
8182 (push gnus-newsgroup-limit gnus-newsgroup-limits)
8183 (setq gnus-newsgroup-limit nil)
8191 (if (and gnus-thread-expunge-below
8192 (< (gnus-thread-total-score (car nodes))
8193 gnus-thread-expunge-below))
8194 (gnus-expunge-thread (pop nodes))
8196 (gnus-summary-limit-children thread))))))
8197 gnus-newsgroup-dependencies)
8200 (when (and (not gnus-newsgroup-limit)
8202 (setq gnus-newsgroup-limit (pop gnus-newsgroup-limits)))
8203 gnus-newsgroup-limit))
8205 (defun gnus-summary-limit-children (thread)
8209 ;; will really go down to a leaf article first, before slowly
8215 (apply '+ (mapcar 'gnus-summary-limit-children
8221 (not (memq number gnus-newsgroup-marked))
8223 ;; If this article is dormant and has absolutely no visible
8224 ;; children, then this article isn't visible.
8225 (and (memq number gnus-newsgroup-dormant)
8228 ;; visible children, then we don't want this article.
8229 (and (or (eq gnus-fetch-old-headers 'some)
8230 (numberp gnus-fetch-old-headers))
8231 (gnus-summary-article-ancient-p number)
8234 ;; we don't want this article.
8235 (and (eq gnus-fetch-old-headers 'invisible)
8236 (gnus-summary-article-ancient-p number))
8237 ;; If this is a sparsely inserted article with no children,
8239 (and (eq gnus-build-sparse-threads 'some)
8240 (gnus-summary-article-sparse-p number)
8242 ;; If we use expunging, and this article is really
8243 ;; low-scored, then we don't want this article.
8244 (when (and gnus-summary-expunge-below
8246 (or (cdr (assq number gnus-newsgroup-scored))
8247 gnus-summary-default-score))
8248 gnus-summary-expunge-below))
8251 (incf gnus-newsgroup-expunged-tally)
8253 (when (and gnus-summary-mark-below
8254 (< score gnus-summary-mark-below))
8255 (setq gnus-newsgroup-unreads
8256 (delq number gnus-newsgroup-unreads))
8257 (if gnus-newsgroup-auto-expire
8258 (push number gnus-newsgroup-expirable)
8259 (push (cons number gnus-low-score-mark)
8260 gnus-newsgroup-reads)))
8262 ;; Do the `display' group parameter.
8263 (and gnus-newsgroup-display
8264 (not (funcall gnus-newsgroup-display)))
8266 (if (and gnus-use-nocem
8267 (gnus-nocem-unwanted-article-p
8270 (setq gnus-newsgroup-unreads
8271 (delq number gnus-newsgroup-unreads))
8273 ;; Nope, invisible article.
8275 ;; Ok, this article is to be visible, so we add it to the limit
8277 (push number gnus-newsgroup-limit)
8280 (defun gnus-expunge-thread (thread)
8283 (incf gnus-newsgroup-expunged-tally)
8285 (setq gnus-newsgroup-unreads
8286 (delq number gnus-newsgroup-unreads))
8287 (if gnus-newsgroup-auto-expire
8288 (push number gnus-newsgroup-expirable)
8289 (push (cons number gnus-low-score-mark)
8290 gnus-newsgroup-reads)))
8292 (mapcar 'gnus-expunge-thread (cdr thread)))
8294 ;; Summary article oriented commands
8296 (defun gnus-summary-refer-parent-article (n)
8297 "Refer parent article N times.
8308 (setq header (gnus-summary-article-header))
8310 (cdr gnus-article-current))
8311 (equal gnus-newsgroup-name
8312 (car gnus-article-current)))
8314 ;; displayed article, then we take a look at the actual
8319 (set-buffer gnus-original-article-buffer)
8323 (setq ref (gnus-extract-message-id-from-in-reply-to ref))))
8326 ;; It's not the current article, so we take a bet on
8331 (unless (gnus-summary-refer-article (gnus-parent-id ref skip))
8332 (gnus-message 1 "Couldn't find parent"))
8333 (gnus-message 1 "No references in article %d"
8334 (gnus-summary-article-number))
8337 (gnus-summary-position-point)
8340 (defun gnus-summary-refer-references ()
8344 (let ((ref (mail-header-references (gnus-summary-article-header)))
8345 (current (gnus-summary-article-number))
8349 (error "No References in the current article")
8353 ;; ... fetch that article.
8354 (gnus-summary-refer-article
8357 (gnus-summary-goto-subject current)
8358 (gnus-summary-position-point)
8361 (defun gnus-summary-refer-thread (&optional limit)
8364 of what's specified by the `gnus-refer-thread-limit' variable."
8366 (let ((id (mail-header-id (gnus-summary-article-header)))
8368 gnus-refer-thread-limit)))
8369 (unless (eq gnus-fetch-old-headers 'invisible)
8370 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name)
8373 (gnus-retrieve-headers
8376 (gnus-summary-article-header))
8378 gnus-newsgroup-end))
8379 gnus-newsgroup-name (* limit 2))
8380 ;; gnus-refer-thread-limit is t, i.e. fetch _all_
8382 (gnus-retrieve-headers (list gnus-newsgroup-end)
8383 gnus-newsgroup-name limit))
8385 (gnus-build-all-threads)
8387 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name))
8388 (gnus-summary-limit-include-thread id)))
8390 (defun gnus-summary-refer-article (message-id)
8391 "Fetch an article specified by MESSAGE-ID."
8395 (setq message-id (gnus-replace-in-string message-id " " ""))
8404 (setq message-id (gnus-url-unhex-string message-id)))
8405 (let* ((header (gnus-id-to-header message-id))
8407 (gnus-summary-article-sparse-p
8410 gnus-newsgroup-limit)))
8413 ;; If the article is present in the buffer we just go to it.
8415 (or (not (gnus-summary-article-sparse-p
8419 (gnus-summary-goto-article
8422 (gnus-summary-update-article (mail-header-number header)))))
8424 ;; We fetch the article.
8426 (dolist (gnus-override-method (gnus-refer-article-methods))
8427 (when (and (gnus-check-server gnus-override-method)
8429 (setq number (gnus-summary-insert-subject message-id)))
8430 ;; and display the article.
8431 (gnus-summary-select-article nil nil nil number)
8433 (gnus-message 3 "Couldn't fetch article %s" message-id)))))))
8435 (defun gnus-refer-article-methods ()
8439 ((null gnus-refer-article-method)
8440 (list gnus-current-select-method gnus-select-method))
8442 ((eq 'current gnus-refer-article-method)
8443 (list gnus-current-select-method))
8445 ((not (and (symbolp (car gnus-refer-article-method))
8446 (assq (car gnus-refer-article-method) nnoo-definition-alist)))
8448 (dolist (method gnus-refer-article-method)
8450 gnus-current-select-method
8456 (list gnus-refer-article-method))))
8458 (defun gnus-summary-edit-parameters ()
8461 (gnus-group-edit-group gnus-newsgroup-name 'params))
8463 (defun gnus-summary-customize-parameters ()
8466 (gnus-group-customize gnus-newsgroup-name))
8468 (defun gnus-summary-enter-digest-group (&optional force)
8469 "Enter an nndoc group based on the current article.
8473 (let ((conf gnus-current-window-configuration))
8476 (let (gnus-article-prepare-hook
8477 gnus-display-mime-function
8478 gnus-break-pages)
8479 (gnus-summary-select-article))))
8480 (setq gnus-current-window-configuration conf)
8482 (gnus-group-prefixed-name
8483 gnus-newsgroup-name (list 'nndoc ""))
8485 (set-buffer gnus-summary-buffer)
8486 gnus-current-article)))
8487 (ogroup gnus-newsgroup-name)
8488 (params (append (gnus-info-params (gnus-get-info ogroup))
8491 (list (cons 'save-article-group ogroup))))
8496 (set-buffer gnus-original-article-buffer)
8498 ;; the parent article.
8499 (when (setq to-address (or (gnus-fetch-field "reply-to")
8500 (gnus-fetch-field "from")))
8504 (funcall gnus-decode-encoded-address-function
8506 (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*"))
8507 (insert-buffer-substring gnus-original-article-buffer)
8517 (if (let ((gnus-newsgroup-ephemeral-charset gnus-newsgroup-charset)
8518 (gnus-newsgroup-ephemeral-ignored-charsets
8519 gnus-newsgroup-ignored-charsets))
8520 (gnus-group-read-ephemeral-group
8522 (nndoc-article-type
8525 `((adapt-file . ,(gnus-score-file-name gnus-newsgroup-name
8528 (nconc (gnus-info-params (gnus-get-info name))
8532 (gnus-set-global-variables)
8533 (gnus-configure-windows 'summary)
8534 (gnus-message 3 "Article couldn't be entered?"))
8537 (defun gnus-summary-read-document (n)
8538 "Open a new group based on the current article(s).
8543 (let* ((articles (gnus-summary-work-articles n))
8544 (ogroup gnus-newsgroup-name)
8545 (params (append (gnus-info-params (gnus-get-info ogroup))
8547 article group egroup groups vgroup)
8548 (while (setq article (pop articles))
8549 (setq group (format "%s-%d" gnus-newsgroup-name article))
8550 (gnus-summary-remove-process-mark article)
8551 (when (gnus-summary-display-article article)
8554 (insert-buffer-substring gnus-original-article-buffer)
8562 (gnus-group-read-ephemeral-group
8564 (nndoc-article-type guess))
8568 (nconc (gnus-info-params (gnus-get-info egroup))
8572 (gnus-error 3 "Article couldn't be entered"))))))
8577 ((gnus-group-read-ephemeral-group
8579 "nnvirtual:%s-%s" gnus-newsgroup-name
8587 (defun gnus-summary-isearch-article (&optional regexp-p)
8588 "Do incremental search forward on the current article.
8591 (gnus-summary-select-article)
8592 (gnus-configure-windows 'article)
8593 (gnus-eval-in-buffer-window gnus-article-buffer
8598 (defun gnus-summary-search-article-forward (regexp &optional backward)
8599 "Search for an article containing REGEXP forward.
8603 (format "Search article %s (regexp%s): "
8605 (if gnus-last-search-regexp
8606 (concat ", default " gnus-last-search-regexp)
8610 (setq regexp (or gnus-last-search-regexp ""))
8611 (setq gnus-last-search-regexp regexp)
8612 (setq gnus-article-before-search gnus-current-article))
8613 ;; Intentionally set gnus-last-article.
8614 (setq gnus-last-article gnus-article-before-search)
8615 (let ((gnus-last-article gnus-last-article))
8616 (if (gnus-summary-search-article regexp backward)
8617 (gnus-summary-show-thread)
8620 (defun gnus-summary-search-article-backward (regexp)
8621 "Search for an article containing REGEXP backward."
8624 (format "Search article backward (regexp%s): "
8625 (if gnus-last-search-regexp
8626 (concat ", default " gnus-last-search-regexp)
8628 (gnus-summary-search-article-forward regexp 'backward))
8630 (defun gnus-summary-search-article (regexp &optional backward)
8631 "Search for an article containing REGEXP.
8633 `gnus-select-article-hook' is not called during the search."
8636 (require 'gnus-async)
8637 (require 'gnus-art)
8638 (let ((gnus-select-article-hook nil) ;Disable hook.
8639 (gnus-article-prepare-hook nil)
8640 (gnus-mark-article-hook nil) ;Inhibit marking as read.
8641 (gnus-use-article-prefetch nil)
8642 (gnus-xmas-force-redisplay nil) ;Inhibit XEmacs redisplay.
8643 (gnus-use-trees nil) ;Inhibit updating tree buffer.
8644 (gnus-visual nil)
8645 (gnus-keep-backlog nil)
8646 (gnus-break-pages nil)
8647 (gnus-summary-display-arrow nil)
8648 (gnus-updated-mode-lines nil)
8649 (gnus-auto-center-summary nil)
8651 (gnus-display-mime-function nil)
8654 (gnus-save-hidden-threads
8655 (gnus-summary-select-article)
8656 (set-buffer gnus-article-buffer)
8661 (gnus-message 7 "Searching article: %d..." (cdr gnus-article-current))
8678 ;; We didn't find it, so we go to the next article.
8682 (if (not (if backward (gnus-summary-find-prev)
8683 (gnus-summary-find-next)))
8686 ;; Select the next article and adjust point.
8687 (unless (gnus-summary-article-sparse-p
8688 (gnus-summary-article-number))
8690 (gnus-summary-select-article)
8691 (set-buffer gnus-article-buffer)
8694 (gnus-message 7 ""))
8698 (gnus-summary-show-thread)
8699 (gnus-summary-goto-subject gnus-current-article)
8700 (gnus-summary-position-point)
8703 (defun gnus-find-matching-articles (header regexp)
8710 (dolist (header gnus-newsgroup-headers)
8715 (defun gnus-summary-find-matching (header regexp &optional backward unread
8718 The search stars on the current article and goes forwards unless
8737 gnus-newsgroup-data
8738 (gnus-data-find-list
8739 (gnus-summary-article-number)
8740 (gnus-data-list backward))))
8742 (gnus-data-unread-p d)) ; Or just unreads.
8743 (vectorp (gnus-data-header d)) ; It's not a pseudo.
8747 (funcall func (gnus-data-header d))))
8749 (funcall func (gnus-data-header d)))))
8750 (push (gnus-data-number d) articles))) ; Success!
8753 (defun gnus-summary-execute-command (header regexp command &optional backward)
8754 "Search forward for an article whose HEADER matches REGEXP and execute COMMAND.
8756 article. If BACKWARD (the prefix) is non-nil, search backward instead."
8765 gnus-extra-headers))
8773 (gnus-summary-show-all-threads)
8777 (let (gnus-visual
8778 gnus-treat-strip-trailing-blank-lines
8779 gnus-treat-strip-leading-blank-lines
8780 gnus-treat-strip-multiple-blank-lines
8781 gnus-treat-hide-boring-headers
8782 gnus-treat-fold-newsgroups
8783 gnus-article-prepare-hook)
8784 (gnus-message 6 "Executing %s..." (key-description command))
8786 (gnus-execute header regexp
8789 (gnus-message 6 "Executing %s...done" (key-description command))))))
8791 (defun gnus-summary-beginning-of-article ()
8792 "Scroll the article back to the beginning."
8794 (gnus-summary-select-article)
8795 (gnus-configure-windows 'article)
8796 (gnus-eval-in-buffer-window gnus-article-buffer
8799 (when gnus-break-pages
8800 (gnus-narrow-to-page))))
8802 (defun gnus-summary-end-of-article ()
8803 "Scroll to the end of the article."
8805 (gnus-summary-select-article)
8806 (gnus-configure-windows 'article)
8807 (gnus-eval-in-buffer-window gnus-article-buffer
8811 (when gnus-break-pages
8814 (gnus-narrow-to-page))))
8816 (defun gnus-summary-print-truncate-and-quote (string &optional len)
8818 (gnus-replace-in-string (if (and len (> (length string) len))
8823 (defun gnus-summary-print-article (&optional filename n)
8826 If used interactively, print the current article if none are
8840 (dolist (article (gnus-summary-work-articles n))
8841 (gnus-summary-select-article nil nil 'pseudo article)
8842 (gnus-eval-in-buffer-window gnus-article-buffer
8843 (gnus-print-buffer))
8844 (gnus-summary-remove-process-mark article))
8847 (defun gnus-print-buffer ()
8853 (gnus-remove-text-with-property 'gnus-decoration)
8854 (when (gnus-visual-p 'article-highlight 'highlight)
8857 (let ((gnus-article-buffer buffer))
8858 (gnus-article-highlight-citation t)
8859 (gnus-article-highlight-signature)
8860 (gnus-article-emphasize)
8861 (gnus-article-delete-invisible-text)))
8865 (gnus-summary-print-truncate-and-quote
8866 (mail-header-subject gnus-current-headers)
8869 (gnus-summary-print-truncate-and-quote
8870 (mail-header-from gnus-current-headers)
8876 (mail-header-date gnus-current-headers) ")"))))
8877 (gnus-run-hooks 'gnus-ps-print-hook)
8884 (defun gnus-summary-show-article (&optional arg)
8885 "Force redisplaying of the current article.
8886 If ARG (the prefix) is a number, show the article with the charset
8887 defined in `gnus-summary-show-article-charset-alist', or the charset
8889 If ARG (the prefix) is non-nil and not a number, show the raw article
8890 without any article massaging functions being run. Normally, the key
8895 (gnus-summary-show-article t)
8896 (let ((gnus-newsgroup-charset
8897 (or (cdr (assq arg gnus-summary-show-article-charset-alist))
8901 (set-buffer gnus-article-buffer)
8903 (gnus-newsgroup-ignored-charsets 'gnus-all))
8904 (gnus-summary-select-article nil 'force)
8905 (let ((deps gnus-newsgroup-dependencies)
8908 (set-buffer gnus-original-article-buffer)
8919 (cdr gnus-article-current)))
8924 (setq header (car (gnus-get-newsgroup-headers deps t))))))
8925 (gnus-data-set-header
8926 (gnus-data-find (cdr gnus-article-current))
8928 (gnus-summary-update-article-line
8929 (cdr gnus-article-current) header)
8930 (when (gnus-summary-goto-subject (cdr gnus-article-current) nil t)
8931 (gnus-summary-update-secondary-mark (cdr gnus-article-current))))))
8933 ;; Select the article the normal way.
8934 (gnus-summary-select-article nil 'force))
8938 (require 'gnus-async)
8939 (require 'gnus-art)
8940 ;; Bind the article treatment functions to nil.
8941 (let ((gnus-have-all-headers t)
8942 gnus-article-prepare-hook
8943 gnus-article-decode-hook
8944 gnus-display-mime-function
8945 gnus-break-pages)
8947 (when (gnus-buffer-live-p gnus-article-buffer)
8949 (set-buffer gnus-article-buffer)
8950 (mm-destroy-parts gnus-article-mime-handles)
8952 (setq gnus-article-mime-handle-alist nil)
8953 (setq gnus-article-mime-handles nil)))
8954 (gnus-summary-select-article nil 'force))))
8955 (gnus-summary-goto-subject gnus-current-article)
8956 (gnus-summary-position-point))
8958 (defun gnus-summary-show-raw-article ()
8959 "Show the raw article without any article massaging functions being run."
8961 (gnus-summary-show-article t))
8963 (defun gnus-summary-verbose-headers (&optional arg)
8964 "Toggle permanent full header display.
8965 If ARG is a positive number, turn header display on.
8966 If ARG is a negative number, turn header display off."
8968 (setq gnus-show-all-headers
8971 (not gnus-show-all-headers))
8974 (gnus-summary-show-article))
8976 (defun gnus-summary-toggle-header (&optional arg)
8981 (let ((window (and (gnus-buffer-live-p gnus-article-buffer)
8982 (get-buffer-window gnus-article-buffer t))))
8983 (with-current-buffer gnus-article-buffer
8985 (article-narrow-to-head)
8991 (gnus-article-hidden-text-p 'headers))))
8994 (with-current-buffer gnus-original-article-buffer
8999 (insert-buffer-substring gnus-original-article-buffer s e)
9000 (run-hooks 'gnus-article-decode-hook)
9002 (let ((gnus-treat-hide-headers nil)
9003 (gnus-treat-hide-boring-headers nil))
9004 (gnus-delete-wash-type 'headers)
9005 (gnus-treat-article 'head))
9006 (gnus-treat-article 'head))
9010 (if gnus-break-pages
9011 (gnus-narrow-to-page)
9012 (when (gnus-visual-p 'page-marker)
9014 (gnus-remove-text-with-property 'gnus-prev)
9015 (gnus-remove-text-with-property 'gnus-next))))
9016 (gnus-set-mode-line 'article)))))
9018 (defun gnus-summary-show-all-headers ()
9021 (gnus-summary-toggle-header 1))
9023 (defun gnus-summary-caesar-message (&optional arg)
9024 "Caesar rotate the current article by 13.
9028 (gnus-summary-select-article)
9030 (gnus-eval-in-buffer-window gnus-article-buffer
9038 (gnus-treat-article nil))
9044 (defun gnus-summary-morse-message (&optional arg)
9045 "Morse decode the current article."
9047 (gnus-summary-select-article)
9049 (gnus-eval-in-buffer-window gnus-article-buffer
9057 (gnus-narrow-to-body))
9065 (defun gnus-summary-stop-page-breaking ()
9066 "Stop page breaking in the current article."
9068 (gnus-summary-select-article)
9069 (gnus-eval-in-buffer-window gnus-article-buffer
9071 (when (gnus-visual-p 'page-marker)
9073 (gnus-remove-text-with-property 'gnus-prev)
9074 (gnus-remove-text-with-property 'gnus-next))
9075 (setq gnus-page-broken nil))))
9077 (defun gnus-summary-move-article (&optional n to-newsgroup
9079 "Move the current article to a different newsgroup.
9089 the variable `gnus-move-split-methods' is used for finding a default
9102 (not (gnus-check-backend-function
9103 'request-move-article gnus-newsgroup-name)))
9104 (error "The current group does not support article moving"))
9106 (not (gnus-check-backend-function
9107 'request-replace-article gnus-newsgroup-name)))
9108 (error "The current group does not support article editing")))
9109 (let ((articles (gnus-summary-work-articles n))
9110 (prefix (if (gnus-check-backend-function
9111 'request-move-article gnus-newsgroup-name)
9112 (gnus-group-real-prefix gnus-newsgroup-name)
9118 (nnheader-set-temp-buffer " *copy article*")))
9119 art-group to-method new-xref article to-groups)
9125 (if (and gnus-move-split-methods
9127 (and (memq gnus-current-article articles)
9128 (gnus-buffer-live-p gnus-original-article-buffer))))
9129 ;; When `gnus-move-split-methods' is non-nil, we have to
9130 ;; select an article to give `gnus-read-move-group-name' an
9132 ;; we needn't render or mark the article.
9133 (let ((gnus-display-mime-function nil)
9134 (gnus-article-prepare-hook nil)
9135 (gnus-mark-article-hook nil))
9136 (gnus-summary-select-article nil nil nil (car articles))))
9138 (gnus-read-move-group-name
9140 (symbol-value (intern (format "gnus-current-%s-group" action)))
9142 (set (intern (format "gnus-current-%s-group" action)) to-newsgroup))
9144 (gnus-server-to-method
9145 (gnus-group-method to-newsgroup))))
9146 ;; Check the method we are to move this article to...
9147 (unless (gnus-check-backend-function
9148 'request-accept-article (car to-method))
9149 (error "%s does not support article copying" (car to-method)))
9150 (unless (gnus-check-server to-method)
9152 (gnus-message 6 "%s to %s: %s..."
9156 (setq article (pop articles))
9160 ;; Move the article.
9162 ;; Remove this article from future suppression.
9163 (gnus-dup-unsuppress-article article)
9164 (gnus-request-move-article
9165 article ; Article to move
9166 gnus-newsgroup-name ; From newsgroup
9167 (nth 1 (gnus-find-method-for-group
9168 gnus-newsgroup-name)) ; Server
9169 (list 'gnus-request-accept-article
9173 ;; Copy the article.
9177 (when (gnus-request-article-this-buffer article gnus-newsgroup-name)
9178 (gnus-request-accept-article
9180 ;; Crosspost the article.
9183 (mail-header-xref (gnus-summary-article-header article))
9185 (setq new-xref (concat (gnus-group-real-name gnus-newsgroup-name)
9186 ":" (number-to-string article)))
9197 ;; First put the article in the destination group.
9198 (gnus-request-article-this-buffer article gnus-newsgroup-name)
9200 (gnus-request-accept-article
9206 ;; it and replace the new article.
9208 (gnus-request-replace-article
9213 (gnus-message 1 "Couldn't %s article %s: %s"
9214 (cadr (assq action names)) article
9218 (gnus-summary-mark-article article gnus-canceled-mark)
9219 (gnus-message 4 "Deleted article %s" article)
9221 (run-hook-with-args 'gnus-summary-article-delete-hook
9223 (gnus-data-header
9224 (assoc article (gnus-data-list nil)))
9225 gnus-newsgroup-name nil
9228 (let* ((pto-group (gnus-group-prefixed-name
9231 (gnus-gethash pto-group gnus-newsrc-hashtb))
9233 (to-group (gnus-info-group info))
9241 (unless (memq article gnus-newsgroup-unreads)
9243 (gnus-info-set-read
9244 info (gnus-add-to-range (gnus-info-read info)
9247 ;; See whether the article is to be put in the cache.
9248 (let ((marks (if (gnus-group-auto-expirable-p to-group)
9249 gnus-article-mark-lists
9251 (copy-sequence gnus-article-mark-lists))))
9252 (to-article (cdr art-group)))
9254 ;; Enter the article into the cache in the new group,
9256 (when gnus-use-cache
9257 (gnus-cache-possibly-enter-article
9258 to-group to-article
9259 (memq article gnus-newsgroup-marked)
9260 (memq article gnus-newsgroup-dormant)
9261 (memq article gnus-newsgroup-unreads)))
9263 (when gnus-preserve-marks
9265 (when (and (equal to-group gnus-newsgroup-name)
9266 (not (memq article gnus-newsgroup-unreads)))
9267 ;; Mark this article as read in this group.
9268 (push (cons to-article gnus-read-mark) gnus-newsgroup-reads)
9269 (setcdr (gnus-active to-group) to-article)
9270 (setcdr gnus-newsgroup-active to-article))
9273 (when (eq (gnus-article-mark-to-type (cdar marks)) 'list)
9274 (when (memq article (symbol-value
9275 (intern (format "gnus-newsgroup-%s"
9280 (when (equal to-group gnus-newsgroup-name)
9281 (set (intern (format "gnus-newsgroup-%s" (caar marks)))
9282 (cons to-article
9284 (intern (format "gnus-newsgroup-%s"
9287 (gnus-add-marked-articles
9288 to-group (cdar marks) (list to-article) info)))
9291 (gnus-request-set-mark
9292 to-group (list (list (list to-article) 'add to-marks))))
9294 (gnus-dribble-enter
9295 (concat "(gnus-group-set-info '"
9296 (gnus-prin1-to-string (gnus-get-info to-group))
9299 ;; Update the Xref header in this article to point to
9300 ;; the new crossposted article we have just created.
9304 (gnus-request-article-this-buffer article gnus-newsgroup-name)
9306 (gnus-request-replace-article
9307 article gnus-newsgroup-name (current-buffer) t)))
9310 (run-hook-with-args 'gnus-summary-article-move-hook
9312 (gnus-data-header
9313 (assoc article (gnus-data-list nil)))
9314 gnus-newsgroup-name
9319 (set-buffer gnus-summary-buffer)
9321 (gnus-summary-goto-subject article)
9323 (gnus-summary-mark-article article gnus-canceled-mark))))
9324 (gnus-summary-remove-process-mark article))
9327 (set-buffer gnus-group-buffer)
9328 (let ((gnus-group-marked to-groups))
9329 (gnus-group-get-new-news-this-group nil t)))
9331 (gnus-kill-buffer copy-buf)
9332 (gnus-summary-position-point)
9333 (gnus-set-mode-line 'summary)))
9335 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method)
9336 "Copy the current article to some other group.
9339 the variable `gnus-move-split-methods' for finding a default target
9344 (gnus-summary-move-article n to-newsgroup select-method 'copy))
9346 (defun gnus-summary-crosspost-article (&optional n)
9347 "Crosspost the current article to some other group."
9349 (gnus-summary-move-article n nil nil 'crosspost))
9351 (defcustom gnus-summary-respool-default-method nil
9352 "Default method type for respooling an article.
9355 :group 'gnus-summary-mail)
9357 (defcustom gnus-summary-display-while-building nil
9360 the value is an integer (N), update the display every N lines."
9362 :group 'gnus-thread
9367 (defun gnus-summary-respool-article (&optional n method)
9368 "Respool the current article.
9369 The article will be squeezed through the mail spooling process again,
9383 (let* ((methods (gnus-methods-using 'respool))
9385 (symbol-name (or gnus-summary-respool-default-method
9386 (car (gnus-find-method-for-group
9387 gnus-newsgroup-name)))))
9389 (gnus-completing-read-with-default
9391 methods nil t nil 'gnus-mail-method-history))
9394 ((zerop (length (setq ms (gnus-servers-using-backend
9406 (car (gnus-find-method-for-group gnus-newsgroup-name)))
9407 (gnus-methods-using 'respool))
9408 (gnus-summary-move-article n nil method)
9409 (gnus-summary-copy-article n nil method)))
9411 (defun gnus-summary-import-article (file &optional edit)
9414 (let ((group gnus-newsgroup-name)
9417 (unless (gnus-check-backend-function 'request-accept-article group)
9418 (error "%s does not support article importing" group))
9423 (set-buffer (gnus-get-buffer-create " *import file*"))
9427 (if (nnheader-article-p)
9436 ;; This doesn't look like an article, so we fudge some headers.
9445 (setq group-art (gnus-request-accept-article group nil t))
9447 (setq gnus-newsgroup-active (gnus-activate-group group))
9449 (gnus-summary-goto-article (cdr group-art) nil t)
9451 (gnus-summary-edit-article))))
9453 (defun gnus-summary-create-article ()
9454 "Create an article in a mail newsgroup."
9456 (let ((group gnus-newsgroup-name)
9459 (unless (gnus-check-backend-function 'request-accept-article group)
9460 (error "%s does not support article importing" group))
9462 (set-buffer (gnus-get-buffer-create " *import file*"))
9465 ;; This doesn't look like an article, so we fudge some headers.
9470 (setq group-art (gnus-request-accept-article group nil t))
9472 (setq gnus-newsgroup-active (gnus-activate-group group))
9474 (gnus-summary-goto-article (cdr group-art) nil t)
9475 (gnus-summary-edit-article)))
9477 (defun gnus-summary-article-posted-p ()
9478 "Say whether the current (mail) article is available from news as well.
9479 This will be the case if the article has both been mailed and posted."
9481 (let ((id (mail-header-references (gnus-summary-article-header)))
9482 (gnus-override-method (car (gnus-refer-article-methods))))
9483 (if (gnus-request-head id "")
9484 (gnus-message 2 "The current message was found on %s"
9485 gnus-override-method)
9486 (gnus-message 2 "The current message couldn't be found on %s"
9487 gnus-override-method)
9490 (defun gnus-summary-expire-articles (&optional now)
9493 (when (and (not gnus-group-is-exiting-without-update-p)
9494 (gnus-check-backend-function
9495 'request-expire-articles gnus-newsgroup-name))
9497 (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name))
9501 ;; this group for `gnus-list-of-read-articles'
9503 (gnus-run-hooks 'gnus-exit-group-hook)
9504 (gnus-summary-update-info)
9505 (gnus-list-of-read-articles gnus-newsgroup-name))
9506 (setq gnus-newsgroup-expirable
9507 (sort gnus-newsgroup-expirable '<))))
9509 (gnus-group-find-parameter
9510 gnus-newsgroup-name 'expiry-wait)))
9512 (or (gnus-group-find-parameter gnus-newsgroup-name 'expiry-target)
9518 (gnus-message 6 "Expiring articles...")
9519 (unless (gnus-check-group gnus-newsgroup-name)
9520 (error "Can't open server for %s" gnus-newsgroup-name))
9526 (setq es (gnus-request-expire-articles
9527 expirable gnus-newsgroup-name)))
9528 (setq es (gnus-request-expire-articles
9529 expirable gnus-newsgroup-name)))
9531 (setq gnus-newsgroup-expirable es))
9535 (let ((gnus-use-cache nil))
9536 (dolist (article expirable)
9537 (when (and (not (memq article es))
9538 (gnus-data-find article))
9539 (gnus-summary-mark-article article gnus-canceled-mark)
9540 (run-hook-with-args 'gnus-summary-article-expire-hook
9542 (gnus-data-header
9543 (assoc article (gnus-data-list nil)))
9544 gnus-newsgroup-name
9547 (gnus-message 6 "Expiring articles...done")))))
9549 (defun gnus-summary-expire-articles-now ()
9554 (or gnus-expert-user
9555 (gnus-yes-or-no-p
9558 (gnus-summary-expire-articles t))
9561 (defun gnus-summary-delete-article (&optional n)
9564 command. The article will disappear forever from your life, never to
9571 If `gnus-novice-user' is non-nil you will be asked for
9574 (unless (gnus-check-backend-function 'request-expire-articles
9575 gnus-newsgroup-name)
9576 (error "The current newsgroup does not support article deletion"))
9577 (unless (gnus-check-server (gnus-find-method-for-group gnus-newsgroup-name))
9580 (let ((articles (sort (copy-sequence (gnus-summary-work-articles n)) '<))
9583 (if (and gnus-novice-user
9584 (not (gnus-yes-or-no-p
9588 "this article")))))
9591 (setq not-deleted (gnus-request-expire-articles
9592 articles gnus-newsgroup-name 'force))
9594 (gnus-summary-remove-process-mark (car articles))
9595 ;; The backend might not have been able to delete the article
9598 (gnus-summary-mark-article (car articles) gnus-canceled-mark))
9599 (let* ((article (car articles))
9600 (id (mail-header-id (gnus-data-header
9601 (assoc article (gnus-data-list nil))))))
9602 (run-hook-with-args 'gnus-summary-article-delete-hook
9603 'delete id gnus-newsgroup-name nil
9607 (gnus-message 4 "Couldn't delete articles %s" not-deleted)))
9608 (gnus-summary-position-point)
9609 (gnus-set-mode-line 'summary)
9612 (defun gnus-summary-edit-article (&optional arg)
9613 "Edit the current article.
9632 (and (gnus-buffer-live-p gnus-article-buffer)
9633 (with-current-buffer gnus-article-buffer
9635 gnus-article-mime-handles
9636 (setq gnus-article-mime-handles nil))))))
9640 (member gnus-newsgroup-name '("nndraft:delayed"
9643 (error "Can't edit the raw article in group %s"
9644 gnus-newsgroup-name))
9646 (set-buffer gnus-summary-buffer)
9647 (let ((mail-parse-charset gnus-newsgroup-charset)
9648 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets))
9649 (gnus-set-global-variables)
9651 (gnus-group-read-only-p))
9652 (error "The current newsgroup does not support article editing"))
9653 (gnus-summary-show-article t)
9654 (when (and (not raw) (gnus-buffer-live-p gnus-article-buffer))
9655 (with-current-buffer gnus-article-buffer
9657 (if (member gnus-newsgroup-name '("nndraft:delayed" "nndraft:drafts"))
9659 (gnus-article-edit-article
9669 (gnus-make-local-hook 'kill-buffer-hook)
9672 (let ((mail-parse-charset ',gnus-newsgroup-charset)
9676 ',gnus-newsgroup-ignored-charsets))
9683 (gnus-summary-edit-article-done
9684 ,(or (mail-header-references gnus-current-headers) "")
9685 ,(gnus-group-read-only-p)
9686 ,gnus-summary-buffer no-highlight))))))))
9688 (defalias 'gnus-summary-edit-article-postpone 'gnus-article-edit-exit)
9690 (defun gnus-summary-edit-article-done (&optional references read-only buffer
9692 "Make edits to the current article permanent."
9695 ;; The buffer restriction contains the entire article if it exists.
9696 (when (article-goto-body)
9714 ;; Replace the article.
9720 (not (gnus-request-replace-article
9721 (cdr gnus-article-current) (car gnus-article-current)
9723 (error "Couldn't replace article")
9738 (cdr gnus-article-current)))
9742 (setq header (car (gnus-get-newsgroup-headers
9745 (set-buffer gnus-summary-buffer)
9746 (gnus-data-set-header
9747 (gnus-data-find (cdr gnus-article-current))
9749 (gnus-summary-update-article-line
9750 (cdr gnus-article-current) header)
9751 (if (gnus-summary-goto-subject
9752 (cdr gnus-article-current) nil t)
9753 (gnus-summary-update-secondary-mark
9754 (cdr gnus-article-current))))))))
9756 (set-buffer (or buffer gnus-summary-buffer))
9757 (gnus-summary-update-article (cdr gnus-article-current))
9758 (if (gnus-summary-goto-subject (cdr gnus-article-current) nil t)
9759 (gnus-summary-update-secondary-mark
9760 (cdr gnus-article-current))))
9761 ;; Prettify the article buffer again.
9764 (set-buffer gnus-article-buffer)
9765 ;;;!!! Fix this -- article should be rehighlighted.
9766 ;;;(gnus-run-hooks 'gnus-article-display-hook)
9767 (set-buffer gnus-original-article-buffer)
9768 (gnus-request-article
9769 (cdr gnus-article-current)
9770 (car gnus-article-current) (current-buffer))))
9772 (when (gnus-visual-p 'summary-highlight 'highlight)
9773 (gnus-run-hooks 'gnus-visual-mark-article-hook))))))
9775 (defun gnus-summary-edit-wash (key)
9776 "Perform editing command KEY in the article buffer."
9783 (gnus-summary-edit-article)
9785 (gnus-article-edit-done))
9789 (defun gnus-summary-respool-query (&optional silent trace)
9790 "Query where the respool algorithm would put this article."
9792 (let (gnus-mark-article-hook)
9793 (gnus-summary-select-article)
9795 (set-buffer gnus-original-article-buffer)
9796 (let ((groups (nnmail-article-group 'identity trace)))
9804 (defun gnus-summary-respool-trace ()
9805 "Trace where the respool algorithm would put this article.
9808 (gnus-summary-respool-query nil t))
9812 (defun gnus-summary-kill-same-subject-and-select (&optional unmark)
9820 (gnus-summary-mark-same-subject
9821 (gnus-summary-article-subject) unmark)))
9822 ;; Select next unread article. If auto-select-same mode, should
9823 ;; select the first unread article.
9824 (gnus-summary-next-article t (and gnus-auto-select-same
9825 (gnus-summary-article-subject)))
9826 (gnus-message 7 "%d article%s marked as %s"
9830 (defun gnus-summary-kill-same-subject (&optional unmark)
9838 (gnus-summary-mark-same-subject
9839 (gnus-summary-article-subject) unmark)))
9843 (gnus-summary-next-subject 1 t))
9844 (gnus-message 7 "%d articles are marked as %s"
9847 (defun gnus-summary-mark-same-subject (subject &optional unmark)
9857 (gnus-summary-mark-article-as-read gnus-killed-mark)
9858 (gnus-summary-show-thread) t)
9859 (gnus-summary-find-subject subject))
9864 (gnus-summary-mark-article-as-unread gnus-ticked-mark)
9865 (gnus-summary-show-thread) t)
9866 (gnus-summary-find-subject subject))
9871 (gnus-summary-mark-article-as-unread gnus-unread-mark)
9872 (gnus-summary-show-thread) t)
9873 (gnus-summary-find-subject subject))
9875 (gnus-set-mode-line 'summary)
9879 (defun gnus-summary-mark-as-processable (n &optional unmark)
9885 (if (and (null n) (gnus-region-active-p))
9886 (gnus-uu-mark-region (region-beginning) (region-end) unmark)
9893 (gnus-summary-remove-process-mark
9894 (gnus-summary-article-number))
9895 (gnus-summary-set-process-mark (gnus-summary-article-number)))
9896 (zerop (gnus-summary-next-subject (if backward -1 1) nil t)))
9899 (gnus-message 7 "No more articles"))
9900 (gnus-summary-recenter)
9901 (gnus-summary-position-point)
9904 (defun gnus-summary-unmark-as-processable (n)
9909 (gnus-summary-mark-as-processable n t))
9911 (defun gnus-summary-unmark-all-processable ()
9915 (while gnus-newsgroup-processable
9916 (gnus-summary-remove-process-mark (car gnus-newsgroup-processable))))
9917 (gnus-summary-position-point))
9919 (defun gnus-summary-add-mark (article type)
9921 (let ((vtype (car (assq type gnus-article-mark-lists)))
9925 (setq var (intern (format "gnus-newsgroup-%s" type)))
9926 (set var (cons article (symbol-value var)))
9928 (gnus-summary-update-secondary-mark article)
9931 (gnus-summary-update-mark gnus-del-mark 'unread)))))
9933 (defun gnus-summary-mark-as-expirable (n)
9938 (gnus-summary-mark-forward n gnus-expirable-mark))
9940 (defun gnus-summary-mark-as-spam (n)
9945 (gnus-summary-mark-forward n gnus-spam-mark))
9947 (defun gnus-summary-mark-article-as-replied (article)
9950 (interactive (list (gnus-summary-article-number)))
9951 (let ((articles (if (listp article) article (list article))))
9952 (dolist (article articles)
9953 (unless (numberp article)
9954 (error "%s is not a number" article))
9955 (push article gnus-newsgroup-replied)
9957 (when (gnus-summary-goto-subject article nil t)
9958 (gnus-summary-update-secondary-mark article))))))
9960 (defun gnus-summary-mark-article-as-forwarded (article)
9963 (let ((articles (if (listp article) article (list article))))
9964 (dolist (article articles)
9965 (push article gnus-newsgroup-forwarded)
9967 (when (gnus-summary-goto-subject article nil t)
9968 (gnus-summary-update-secondary-mark article))))))
9970 (defun gnus-summary-set-bookmark (article)
9971 "Set a bookmark in current article."
9972 (interactive (list (gnus-summary-article-number)))
9973 (when (or (not (get-buffer gnus-article-buffer))
9974 (not gnus-current-article)
9975 (not gnus-article-current)
9976 (not (equal gnus-newsgroup-name (car gnus-article-current))))
9977 (error "No current article selected"))
9979 (gnus-pull article gnus-newsgroup-bookmarks)
9981 ;; (article-number . line-number-in-body).
9983 (cons article
9985 (set-buffer gnus-article-buffer)
9989 (article-goto-body)
9992 gnus-newsgroup-bookmarks)
9993 (gnus-message 6 "A bookmark has been added to the current article."))
9995 (defun gnus-summary-remove-bookmark (article)
9996 "Remove the bookmark from the current article."
9997 (interactive (list (gnus-summary-article-number)))
9999 (if (not (assq article gnus-newsgroup-bookmarks))
10000 (gnus-message 6 "No bookmark in current article.")
10001 (gnus-pull article gnus-newsgroup-bookmarks)
10002 (gnus-message 6 "Removed bookmark.")))
10005 (defun gnus-summary-mark-as-dormant (n)
10010 (gnus-summary-mark-forward n gnus-dormant-mark))
10012 (defun gnus-summary-set-process-mark (article)
10014 (setq gnus-newsgroup-processable
10015 (cons article
10016 (delq article gnus-newsgroup-processable)))
10017 (when (gnus-summary-goto-subject article)
10018 (gnus-summary-show-thread)
10019 (gnus-summary-goto-subject article)
10020 (gnus-summary-update-secondary-mark article)))
10022 (defun gnus-summary-remove-process-mark (article)
10024 (setq gnus-newsgroup-processable (delq article gnus-newsgroup-processable))
10025 (when (gnus-summary-goto-subject article)
10026 (gnus-summary-show-thread)
10027 (gnus-summary-goto-subject article)
10028 (gnus-summary-update-secondary-mark article)))
10030 (defun gnus-summary-set-saved-mark (article)
10032 (push article gnus-newsgroup-saved)
10033 (when (gnus-summary-goto-subject article)
10034 (gnus-summary-update-secondary-mark article)))
10036 (defun gnus-summary-mark-forward (n &optional mark no-expire)
10043 (gnus-summary-show-thread)
10045 (gnus-summary-goto-unread
10046 (and gnus-summary-goto-unread
10047 (not (eq gnus-summary-goto-unread 'never))
10048 (not (memq mark (list gnus-unread-mark gnus-spam-mark
10049 gnus-ticked-mark gnus-dormant-mark)))))
10051 (mark (or mark gnus-del-mark)))
10053 (gnus-summary-mark-article nil mark no-expire)
10054 (zerop (gnus-summary-next-subject
10056 (and gnus-summary-goto-unread
10057 (not (eq gnus-summary-goto-unread 'never)))
10061 (gnus-message 7 "No more %sarticles" (if mark "" "unread ")))
10062 (gnus-summary-recenter)
10063 (gnus-summary-position-point)
10064 (gnus-set-mode-line 'summary)
10067 (defun gnus-summary-mark-article-as-read (mark)
10068 "Mark the current article quickly as read with MARK."
10069 (let ((article (gnus-summary-article-number)))
10070 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
10071 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
10072 (setq gnus-newsgroup-spam-marked (delq article gnus-newsgroup-spam-marked))
10073 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
10074 (push (cons article mark) gnus-newsgroup-reads)
10076 (when gnus-use-cache
10077 (gnus-cache-enter-remove-article article))
10079 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark))
10081 (when (and gnus-newsgroup-auto-expire
10082 (memq mark gnus-auto-expirable-marks))
10083 (setq mark gnus-expirable-mark)
10085 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark))
10086 (push article gnus-newsgroup-expirable))
10088 (gnus-summary-update-mark mark 'unread)
10091 (defun gnus-summary-mark-article-as-unread (mark)
10092 "Mark the current article quickly as unread with MARK."
10093 (let* ((article (gnus-summary-article-number))
10094 (old-mark (gnus-summary-article-mark article)))
10096 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark))
10099 (if (<= article 0)
10101 (gnus-error 1 "Can't mark negative article numbers")
10103 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
10104 (setq gnus-newsgroup-spam-marked
10105 (delq article gnus-newsgroup-spam-marked))
10106 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
10107 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))
10108 (setq gnus-newsgroup-reads (delq article gnus-newsgroup-reads))
10109 (cond ((= mark gnus-ticked-mark)
10110 (setq gnus-newsgroup-marked
10111 (gnus-add-to-sorted-list gnus-newsgroup-marked
10112 article)))
10113 ((= mark gnus-spam-mark)
10114 (setq gnus-newsgroup-spam-marked
10115 (gnus-add-to-sorted-list gnus-newsgroup-spam-marked
10116 article)))
10117 ((= mark gnus-dormant-mark)
10118 (setq gnus-newsgroup-dormant
10119 (gnus-add-to-sorted-list gnus-newsgroup-dormant
10120 article)))
10122 (setq gnus-newsgroup-unreads
10123 (gnus-add-to-sorted-list gnus-newsgroup-unreads
10124 article))))
10125 (gnus-pull article gnus-newsgroup-reads)
10127 ;; See whether the article is to be put in the cache.
10128 (and gnus-use-cache
10129 (vectorp (gnus-summary-article-header article))
10131 (gnus-cache-possibly-enter-article
10132 gnus-newsgroup-name article
10133 (= mark gnus-ticked-mark)
10134 (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
10137 (gnus-summary-update-mark mark 'unread)
10140 (defun gnus-summary-mark-article (&optional article mark no-expire)
10145 If ARTICLE is nil, then the article on the current line will be
10153 (setq mark gnus-del-mark))
10155 gnus-newsgroup-auto-expire
10156 (memq mark gnus-auto-expirable-marks))
10157 (setq mark gnus-expirable-mark))
10158 (let ((article (or article (gnus-summary-article-number)))
10159 (old-mark (gnus-summary-article-mark article)))
10161 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark))
10164 (unless article
10165 (error "No article on current line"))
10166 (if (not (if (or (= mark gnus-unread-mark)
10167 (= mark gnus-ticked-mark)
10168 (= mark gnus-spam-mark)
10169 (= mark gnus-dormant-mark))
10170 (gnus-mark-article-as-unread article mark)
10171 (gnus-mark-article-as-read article mark)))
10173 ;; See whether the article is to be put in the cache.
10174 (and gnus-use-cache
10175 (not (= mark gnus-canceled-mark))
10176 (vectorp (gnus-summary-article-header article))
10178 (gnus-cache-possibly-enter-article
10179 gnus-newsgroup-name article
10180 (= mark gnus-ticked-mark)
10181 (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
10183 (when (gnus-summary-goto-subject article nil t)
10185 (gnus-summary-show-thread)
10187 (gnus-summary-update-mark mark 'unread)
10190 (defun gnus-summary-update-secondary-mark (article)
10192 (gnus-summary-update-mark
10193 (cond ((memq article gnus-newsgroup-processable)
10194 gnus-process-mark)
10195 ((memq article gnus-newsgroup-cached)
10196 gnus-cached-mark)
10197 ((memq article gnus-newsgroup-replied)
10198 gnus-replied-mark)
10199 ((memq article gnus-newsgroup-forwarded)
10200 gnus-forwarded-mark)
10201 ((memq article gnus-newsgroup-saved)
10202 gnus-saved-mark)
10203 ((memq article gnus-newsgroup-recent)
10204 gnus-recent-mark)
10205 ((memq article gnus-newsgroup-unseen)
10206 gnus-unseen-mark)
10207 (t gnus-no-mark))
10209 (when (gnus-visual-p 'summary-highlight 'highlight)
10210 (gnus-run-hooks 'gnus-summary-update-hook))
10213 (defun gnus-summary-update-download-mark (article)
10215 (gnus-summary-update-mark
10216 (cond ((memq article gnus-newsgroup-undownloaded)
10217 gnus-undownloaded-mark)
10218 (gnus-newsgroup-agentized
10219 gnus-downloaded-mark)
10221 gnus-no-mark))
10223 (gnus-summary-update-line t)
10226 (defun gnus-summary-update-mark (mark type)
10227 (let ((forward (cdr (assq type gnus-summary-mark-positions)))
10229 (re-search-backward "[\n\r]" (gnus-point-at-bol) 'move-to-limit)
10240 (gnus-data-set-mark
10241 (gnus-data-find (gnus-summary-article-number)) mark)
10242 (gnus-summary-update-line (eq mark gnus-unread-mark)))))))
10244 (defun gnus-mark-article-as-read (article &optional mark)
10246 ;; Make the article expirable.
10247 (let ((mark (or mark gnus-del-mark)))
10248 (setq gnus-newsgroup-expirable
10249 (if (= mark gnus-expirable-mark)
10250 (gnus-add-to-sorted-list gnus-newsgroup-expirable article)
10251 (delq article gnus-newsgroup-expirable)))
10253 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
10254 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
10255 (setq gnus-newsgroup-spam-marked (delq article gnus-newsgroup-spam-marked))
10256 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
10257 (push (cons article mark) gnus-newsgroup-reads)
10259 (when gnus-use-cache
10260 (gnus-cache-enter-remove-article article))
10263 (defun gnus-mark-article-as-unread (article &optional mark)
10265 (let ((mark (or mark gnus-ticked-mark)))
10266 (if (<= article 0)
10268 (gnus-error 1 "Can't mark negative article numbers")
10270 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)
10271 gnus-newsgroup-spam-marked (delq article gnus-newsgroup-spam-marked)
10272 gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)
10273 gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)
10274 gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
10277 (when gnus-suppress-duplicates
10278 (gnus-dup-unsuppress-article article))
10280 (cond ((= mark gnus-ticked-mark)
10281 (setq gnus-newsgroup-marked
10282 (gnus-add-to-sorted-list gnus-newsgroup-marked article)))
10283 ((= mark gnus-spam-mark)
10284 (setq gnus-newsgroup-spam-marked
10285 (gnus-add-to-sorted-list gnus-newsgroup-spam-marked
10286 article)))
10287 ((= mark gnus-dormant-mark)
10288 (setq gnus-newsgroup-dormant
10289 (gnus-add-to-sorted-list gnus-newsgroup-dormant article)))
10291 (setq gnus-newsgroup-unreads
10292 (gnus-add-to-sorted-list gnus-newsgroup-unreads article))))
10293 (gnus-pull article gnus-newsgroup-reads)
10296 (defalias 'gnus-summary-mark-as-unread-forward
10297 'gnus-summary-tick-article-forward)
10298 (make-obsolete 'gnus-summary-mark-as-unread-forward
10299 'gnus-summary-tick-article-forward)
10300 (defun gnus-summary-tick-article-forward (n)
10305 (gnus-summary-mark-forward n gnus-ticked-mark))
10307 (defalias 'gnus-summary-mark-as-unread-backward
10308 'gnus-summary-tick-article-backward)
10309 (make-obsolete 'gnus-summary-mark-as-unread-backward
10310 'gnus-summary-tick-article-backward)
10311 (defun gnus-summary-tick-article-backward (n)
10315 (gnus-summary-mark-forward (- n) gnus-ticked-mark))
10317 (defalias 'gnus-summary-mark-as-unread 'gnus-summary-tick-article)
10318 (make-obsolete 'gnus-summary-mark-as-unread 'gnus-summary-tick-article)
10319 (defun gnus-summary-tick-article (&optional article clear-mark)
10320 "Mark current article as unread.
10321 Optional 1st argument ARTICLE specifies article number to be marked as unread.
10324 (gnus-summary-mark-article article (if clear-mark gnus-unread-mark
10325 gnus-ticked-mark)))
10327 (defun gnus-summary-mark-as-read-forward (n)
10333 (gnus-summary-mark-forward n gnus-del-mark gnus-inhibit-user-auto-expire))
10335 (defun gnus-summary-mark-as-read-backward (n)
10340 (gnus-summary-mark-forward
10341 (- n) gnus-del-mark gnus-inhibit-user-auto-expire))
10343 (defun gnus-summary-mark-as-read (&optional article mark)
10344 "Mark current article as read.
10345 ARTICLE specifies the article to be marked as read.
10347 (gnus-summary-mark-article article mark))
10349 (defun gnus-summary-clear-mark-forward (n)
10354 (gnus-summary-mark-forward n gnus-unread-mark))
10356 (defun gnus-summary-clear-mark-backward (n)
10360 (gnus-summary-mark-forward (- n) gnus-unread-mark))
10362 (defun gnus-summary-mark-unread-as-read ()
10363 "Intended to be used by `gnus-summary-mark-article-hook'."
10364 (when (memq gnus-current-article gnus-newsgroup-unreads)
10365 (gnus-summary-mark-article gnus-current-article gnus-read-mark)))
10367 (defun gnus-summary-mark-read-and-unread-as-read (&optional new-mark)
10368 "Intended to be used by `gnus-summary-mark-article-hook'."
10369 (let ((mark (gnus-summary-article-mark)))
10370 (when (or (gnus-unread-mark-p mark)
10371 (gnus-read-mark-p mark))
10372 (gnus-summary-mark-article gnus-current-article
10373 (or new-mark gnus-read-mark)))))
10375 (defun gnus-summary-mark-current-read-and-unread-as-read (&optional new-mark)
10376 "Intended to be used by `gnus-summary-mark-article-hook'."
10377 (let ((mark (gnus-summary-article-mark)))
10378 (when (or (gnus-unread-mark-p mark)
10379 (gnus-read-mark-p mark))
10380 (gnus-summary-mark-article (gnus-summary-article-number)
10381 (or new-mark gnus-read-mark)))))
10383 (defun gnus-summary-mark-unread-as-ticked ()
10384 "Intended to be used by `gnus-summary-mark-article-hook'."
10385 (when (memq gnus-current-article gnus-newsgroup-unreads)
10386 (gnus-summary-mark-article gnus-current-article gnus-ticked-mark)))
10388 (defun gnus-summary-mark-region-as-read (point mark all)
10394 (let (article)
10401 (memq (setq article (gnus-summary-article-number))
10402 gnus-newsgroup-unreads))
10403 (gnus-summary-mark-article article gnus-del-mark))
10405 (gnus-summary-find-next))))))
10407 (defun gnus-summary-mark-below (score mark)
10412 (or gnus-summary-default-score 0)))
10414 (set-buffer gnus-summary-buffer)
10418 (and (< (gnus-summary-article-score) score)
10419 (gnus-summary-mark-article nil mark))
10420 (gnus-summary-find-next)))))
10422 (defun gnus-summary-kill-below (&optional score)
10425 (gnus-summary-mark-below score gnus-killed-mark))
10427 (defun gnus-summary-clear-above (&optional score)
10430 (gnus-summary-mark-above score gnus-unread-mark))
10432 (defun gnus-summary-tick-above (&optional score)
10435 (gnus-summary-mark-above score gnus-ticked-mark))
10437 (defun gnus-summary-mark-above (score mark)
10442 (or gnus-summary-default-score 0)))
10444 (set-buffer gnus-summary-buffer)
10447 (when (> (gnus-summary-article-score) score)
10448 (gnus-summary-mark-article nil mark))
10450 (gnus-summary-find-next)))))
10453 (defalias 'gnus-summary-show-all-expunged 'gnus-summary-limit-include-expunged)
10454 (defun gnus-summary-limit-include-expunged (&optional no-error)
10458 (let ((scored gnus-newsgroup-scored)
10461 (unless (gnus-summary-article-header (caar scored))
10462 (and (setq h (gnus-number-to-header (caar scored)))
10463 (< (cdar scored) gnus-summary-expunge-below)
10470 (push gnus-newsgroup-limit gnus-newsgroup-limits)
10471 (setq gnus-newsgroup-limit (copy-sequence gnus-newsgroup-limit))
10473 gnus-newsgroup-limit))
10475 (gnus-summary-prepare-unthreaded (nreverse headers))
10477 (gnus-summary-position-point)
10480 (defun gnus-summary-catchup (&optional all quietly to-here not-mark reverse)
10490 Note that this function will only catch up the unread article
10498 (not gnus-interactive-catchup) ;Without confirmation?
10499 gnus-expert-user
10500 (gnus-y-or-n-p
10505 (not gnus-newsgroup-adaptive)
10506 (not gnus-newsgroup-auto-expire)
10507 (not gnus-suppress-duplicates)
10508 (or (not gnus-use-cache)
10509 (eq gnus-use-cache 'passive)))
10512 (setq gnus-newsgroup-marked nil
10513 gnus-newsgroup-spam-marked nil
10514 gnus-newsgroup-dormant nil))
10515 (setq gnus-newsgroup-unreads
10516 (gnus-sorted-nunion
10517 (gnus-sorted-intersection gnus-newsgroup-unreads
10518 gnus-newsgroup-downloadable)
10519 gnus-newsgroup-unfetched)))
10522 (gnus-summary-show-all-threads)
10526 (gnus-summary-mark-current-read-and-unread-as-read
10527 gnus-catchup-mark)
10528 (while (gnus-summary-find-next (not all))
10529 (gnus-summary-mark-article-as-read gnus-catchup-mark)))
10530 (when (gnus-summary-first-subject (not all))
10533 (gnus-summary-mark-article-as-read gnus-catchup-mark)
10534 (gnus-summary-find-next (not all))))))
10535 (gnus-set-mode-line 'summary))
10537 (gnus-summary-position-point)))
10539 (defun gnus-summary-catchup-to-here (&optional all)
10544 (gnus-save-hidden-threads
10547 (when (or all (gnus-summary-find-prev))
10548 (gnus-summary-catchup all t beg)))))
10549 (gnus-summary-position-point))
10551 (defun gnus-summary-catchup-from-here (&optional all)
10556 (gnus-save-hidden-threads
10559 (when (or all (gnus-summary-find-next))
10560 (gnus-summary-catchup all t beg nil t)))))
10561 (gnus-summary-position-point))
10563 (defun gnus-summary-catchup-all (&optional quietly)
10565 This command is dangerous. Normally, you want \\[gnus-summary-catchup]
10568 (gnus-summary-catchup t quietly))
10570 (defun gnus-summary-catchup-and-exit (&optional all quietly)
10575 (when (gnus-summary-catchup all quietly nil 'fast)
10577 (if (and (not (gnus-group-quit-config gnus-newsgroup-name))
10578 (eq gnus-auto-select-next 'quietly))
10579 (gnus-summary-next-group nil)
10580 (gnus-summary-exit))))
10582 (defun gnus-summary-catchup-all-and-exit (&optional quietly)
10584 This command is dangerous. Normally, you want \\[gnus-summary-catchup-and-exit]
10587 (gnus-summary-catchup-and-exit t quietly))
10589 (defun gnus-summary-catchup-and-goto-next-group (&optional all)
10595 (gnus-summary-catchup all))
10596 (gnus-summary-next-group))
10599 ;;; with article
10602 (defmacro gnus-with-article (article &rest forms)
10603 "Select ARTICLE and perform FORMS in the original article buffer.
10604 Then replace the article with the result."
10606 ;; We don't want the article to be marked as read.
10607 (let (gnus-mark-article-hook)
10608 (gnus-summary-select-article t t nil ,article))
10609 (set-buffer gnus-original-article-buffer)
10611 (if (not (gnus-check-backend-function
10612 'request-replace-article (car gnus-article-current)))
10613 (gnus-message 5 "Read-only group; not replacing")
10614 (unless (gnus-request-replace-article
10615 ,article (car gnus-article-current)
10617 (error "Couldn't replace article")))
10619 (when gnus-keep-backlog
10620 (gnus-backlog-remove-article
10621 (car gnus-article-current) (cdr gnus-article-current)))
10622 (when gnus-use-cache
10623 (gnus-cache-update-article
10624 (car gnus-article-current) (cdr gnus-article-current)))))
10626 (put 'gnus-with-article 'lisp-indent-function 1)
10627 (put 'gnus-with-article 'edebug-form-spec '(form body))
10631 (defun gnus-summary-articles-in-thread (&optional article)
10634 with that article."
10635 (let* ((article (or article (gnus-summary-article-number)))
10636 (data (gnus-data-find-list article))
10637 (top-level (gnus-data-level (car data)))
10639 (cond ((null gnus-thread-operation-ignore-subject)
10640 (gnus-simplify-subject-re
10641 (mail-header-subject (gnus-data-header (car data)))))
10642 ((eq gnus-thread-operation-ignore-subject 'fuzzy)
10643 (gnus-simplify-subject-fuzzy
10644 (mail-header-subject (gnus-data-header (car data)))))
10647 (if (gnus-summary-go-to-next-thread)
10651 (< (gnus-data-pos (car data)) end-point))
10654 (if (eq gnus-thread-operation-ignore-subject 'fuzzy)
10655 (gnus-simplify-subject-fuzzy
10657 (gnus-data-header (car data))))
10658 (gnus-simplify-subject-re
10660 (gnus-data-header (car data)))))))
10661 (push (gnus-data-number (car data)) articles))
10663 (> (gnus-data-level (car data)) top-level))
10668 (defun gnus-summary-rethread-current ()
10669 "Rethread the thread the current article is part of."
10671 (let* ((gnus-show-threads t)
10672 (article (gnus-summary-article-number))
10673 (id (mail-header-id (gnus-summary-article-header)))
10674 (gnus-newsgroup-threads (list (gnus-id-to-thread (gnus-root-id id)))))
10676 (error "No article on the current line"))
10677 (gnus-rebuild-thread id)
10678 (gnus-summary-goto-subject article)))
10680 (defun gnus-summary-reparent-thread ()
10681 "Make the current article child of the marked (or previous) article.
10683 Note that the re-threading will only work if `gnus-thread-ignore-subject'
10686 (unless (not (gnus-group-read-only-p))
10687 (error "The current newsgroup does not support article editing"))
10688 (unless (<= (length gnus-newsgroup-processable) 1)
10689 (error "No more than one article may be marked"))
10691 (let ((gnus-article-buffer " *reparent*")
10692 (current-article (gnus-summary-article-number))
10693 ;; First grab the marked article, otherwise one line up.
10694 (parent-article (if (not (null gnus-newsgroup-processable))
10695 (car gnus-newsgroup-processable)
10698 (gnus-summary-article-number)
10700 (unless (not (eq current-article parent-article))
10701 (error "An article may not be self-referential"))
10703 (gnus-summary-article-header parent-article))))
10706 (gnus-with-article current-article
10717 (set-buffer gnus-summary-buffer)
10718 (gnus-summary-unmark-all-processable)
10719 (gnus-summary-update-article current-article)
10720 (if (gnus-summary-goto-subject (cdr gnus-article-current) nil t)
10721 (gnus-summary-update-secondary-mark (cdr gnus-article-current)))
10722 (gnus-summary-rethread-current)
10723 (gnus-message 3 "Article %d is now the child of article %d"
10724 current-article parent-article)))))
10726 (defun gnus-summary-toggle-threads (&optional arg)
10730 (let ((current (or (gnus-summary-article-number) gnus-newsgroup-end)))
10731 (setq gnus-show-threads
10732 (if (null arg) (not gnus-show-threads)
10734 (gnus-summary-prepare)
10735 (gnus-summary-goto-subject current)
10736 (gnus-message 6 "Threading is now %s" (if gnus-show-threads "on" "off"))
10737 (gnus-summary-position-point)))
10739 (defun gnus-summary-show-all-threads ()
10745 (gnus-summary-position-point))
10747 (defun gnus-summary-show-thread ()
10753 (end (gnus-point-at-eol))
10761 (gnus-summary-position-point))))
10763 (defun gnus-summary-maybe-hide-threads ()
10765 (when (and gnus-show-threads
10766 gnus-thread-hide-subtree)
10767 (gnus-summary-hide-all-threads
10768 (if (or (consp gnus-thread-hide-subtree)
10769 (functionp gnus-thread-hide-subtree))
10770 (gnus-make-predicate gnus-thread-hide-subtree)
10775 (defun gnus-article-unread-p (header)
10776 (memq (mail-header-number header) gnus-newsgroup-unreads))
10778 (defun gnus-article-unseen-p (header)
10779 (memq (mail-header-number header) gnus-newsgroup-unseen))
10781 (defun gnus-map-articles (predicate articles)
10783 (apply 'gnus-or (mapcar predicate
10785 (gnus-summary-article-header number))
10788 (defun gnus-summary-hide-all-threads (&optional predicate)
10798 (gnus-map-articles
10799 predicate (gnus-summary-article-children)))
10800 (gnus-summary-hide-thread))
10801 (setq end (not (zerop (gnus-summary-next-thread 1 t)))))))
10802 (gnus-summary-position-point))
10804 (defun gnus-summary-hide-thread ()
10812 (article (gnus-summary-article-number)))
10817 (or (zerop (gnus-summary-next-thread 1 t))
10824 (gnus-summary-goto-subject article))
10828 (defun gnus-summary-go-to-next-thread (&optional previous)
10831 Return the article number moved to, or nil if moving was impossible."
10832 (let ((level (gnus-summary-thread-level))
10837 (< level (gnus-summary-thread-level)))
10845 (gnus-summary-article-number)
10848 (defun gnus-summary-next-thread (n &optional silent)
10859 (gnus-summary-go-to-next-thread backward))
10862 (gnus-summary-position-point))
10864 (gnus-message 7 "No more threads"))
10867 (defun gnus-summary-prev-thread (n)
10872 (gnus-summary-next-thread (- n)))
10874 (defun gnus-summary-go-down-thread ()
10876 (let ((children (gnus-summary-article-children)))
10878 (gnus-summary-goto-subject (car children)))))
10880 (defun gnus-summary-go-up-thread ()
10882 (let ((parent (gnus-summary-article-parent)))
10884 (gnus-summary-goto-subject parent))))
10886 (defun gnus-summary-down-thread (n)
10895 (if up (gnus-summary-go-up-thread)
10896 (gnus-summary-go-down-thread)))
10898 (gnus-summary-position-point)
10900 (gnus-message 7 "Can't go further"))
10903 (defun gnus-summary-up-thread (n)
10909 (gnus-summary-down-thread (- n)))
10911 (defun gnus-summary-top-thread ()
10914 (while (gnus-summary-go-up-thread))
10915 (gnus-summary-article-number))
10917 (defun gnus-summary-kill-thread (&optional unmark)
10924 (let ((articles (gnus-summary-articles-in-thread)))
10927 (gnus-summary-show-thread)
10930 (gnus-summary-goto-subject (car articles))
10932 (gnus-summary-mark-article-as-read gnus-killed-mark))
10934 (gnus-summary-mark-article-as-unread gnus-unread-mark))
10936 (gnus-summary-mark-article-as-unread gnus-ticked-mark)))
10940 gnus-thread-hide-killed
10941 (gnus-summary-hide-thread))
10945 (gnus-summary-next-subject 1 t)))
10946 (gnus-set-mode-line 'summary))
10950 (defun gnus-summary-sort-by-number (&optional reverse)
10951 "Sort the summary buffer by article number.
10954 (gnus-summary-sort 'number reverse))
10956 (defun gnus-summary-sort-by-random (&optional reverse)
10960 (gnus-summary-sort 'random reverse))
10962 (defun gnus-summary-sort-by-author (&optional reverse)
10967 (gnus-summary-sort 'author reverse))
10969 (defun gnus-summary-sort-by-subject (&optional reverse)
10974 (gnus-summary-sort 'subject reverse))
10976 (defun gnus-summary-sort-by-date (&optional reverse)
10980 (gnus-summary-sort 'date reverse))
10982 (defun gnus-summary-sort-by-score (&optional reverse)
10986 (gnus-summary-sort 'score reverse))
10988 (defun gnus-summary-sort-by-lines (&optional reverse)
10992 (gnus-summary-sort 'lines reverse))
10994 (defun gnus-summary-sort-by-chars (&optional reverse)
10995 "Sort the summary buffer by article length.
10998 (gnus-summary-sort 'chars reverse))
11000 (defun gnus-summary-sort-by-original (&optional reverse)
11005 (gnus-summary-prepare-hook nil))
11007 (gnus-summary-prepare)
11009 (gnus-summary-maybe-hide-threads)))
11011 (defun gnus-summary-sort (predicate reverse)
11013 (let* ((thread (intern (format "gnus-thread-sort-by-%s" predicate)))
11014 (article (intern (format "gnus-article-sort-by-%s" predicate)))
11015 (gnus-thread-sort-functions
11020 (gnus-sort-gathered-threads-function
11021 gnus-thread-sort-functions)
11022 (gnus-article-sort-functions
11024 article
11026 (,article t2 t1))))
11028 (gnus-summary-prepare-hook nil))
11030 (gnus-summary-prepare)
11032 (gnus-summary-maybe-hide-threads)))
11036 (defun gnus-summary-save-article (&optional n not-saved)
11037 "Save the current article using the default saver function.
11042 The variable `gnus-default-article-saver' specifies the saver function.
11047 (require 'gnus-art)
11048 (let* ((articles (gnus-summary-work-articles n))
11053 (decode (when gnus-article-save-coding-system
11054 (get gnus-default-article-saver :decode)))
11057 (saver2 (get gnus-default-article-saver :function))
11058 (gnus-prompt-before-saving (if saver2
11060 gnus-prompt-before-saving))
11061 (gnus-default-article-saver gnus-default-article-saver)
11063 (dolist (article articles)
11064 (setq header (gnus-summary-article-header article))
11066 ;; This is a pseudo-article.
11068 (gnus-copy-file (cdr (assq 'name header)))
11069 (gnus-message 1 "Article %d is unsaveable" article))
11070 ;; This is a real article.
11072 (let ((gnus-display-mime-function (when decode
11073 gnus-display-mime-function))
11074 (gnus-article-prepare-hook (when decode
11075 gnus-article-prepare-hook)))
11076 (gnus-summary-select-article t nil nil article)
11077 (gnus-summary-goto-subject article)))
11082 gnus-article-buffer
11083 gnus-original-article-buffer)))
11084 (setq file (gnus-article-save save-buffer file num))
11085 (gnus-summary-remove-process-mark article)
11087 (gnus-summary-set-saved-mark article)))
11089 (setq gnus-default-article-saver saver2
11091 (gnus-kill-buffer save-buffer)
11092 (gnus-summary-position-point)
11093 (gnus-set-mode-line 'summary)
11096 (defun gnus-summary-pipe-output (&optional arg headers)
11097 "Pipe the current article to a subprocess.
11103 (interactive (gnus-interactive "P\ny"))
11104 (require 'gnus-art)
11105 (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe)
11106 (gnus-save-all-headers (or headers gnus-save-all-headers)))
11107 (gnus-summary-save-article arg t))
11111 (gnus-configure-windows 'pipe))))
11113 (defun gnus-summary-save-article-mail (&optional arg)
11114 "Append the current article to a Unix mail box file.
11120 (require 'gnus-art)
11121 (let ((gnus-default-article-saver 'gnus-summary-save-in-mail))
11122 (gnus-summary-save-article arg)))
11124 (defun gnus-summary-save-article-rmail (&optional arg)
11125 "Append the current article to an rmail file.
11131 (require 'gnus-art)
11132 (let ((gnus-default-article-saver 'gnus-summary-save-in-rmail))
11133 (gnus-summary-save-article arg)))
11135 (defun gnus-summary-save-article-file (&optional arg)
11136 "Append the current article to a file.
11142 (require 'gnus-art)
11143 (let ((gnus-default-article-saver 'gnus-summary-save-in-file))
11144 (gnus-summary-save-article arg)))
11146 (defun gnus-summary-write-article-file (&optional arg)
11147 "Write the current article to a file, deleting the previous file.
11153 (require 'gnus-art)
11154 (let ((gnus-default-article-saver 'gnus-summary-write-to-file))
11155 (gnus-summary-save-article arg)))
11157 (defun gnus-summary-save-article-body-file (&optional arg)
11158 "Append the current article body to a file.
11164 (require 'gnus-art)
11165 (let ((gnus-default-article-saver 'gnus-summary-save-body-in-file))
11166 (gnus-summary-save-article arg)))
11168 (defun gnus-summary-write-article-body-file (&optional arg)
11169 "Write the current article body to a file, deleting the previous file.
11175 (require 'gnus-art)
11176 (let ((gnus-default-article-saver 'gnus-summary-write-body-to-file))
11177 (gnus-summary-save-article arg)))
11179 (defun gnus-summary-muttprint (&optional arg)
11180 "Print the current article using Muttprint.
11186 (require 'gnus-art)
11187 (let ((gnus-default-article-saver 'gnus-summary-pipe-to-muttprint))
11188 (gnus-summary-save-article arg t)))
11190 (defun gnus-summary-pipe-message (program)
11191 "Pipe the current article through PROGRAM."
11193 (gnus-summary-select-article)
11195 (gnus-eval-in-buffer-window gnus-article-buffer
11203 (defun gnus-get-split-value (methods)
11208 (set-buffer gnus-original-article-buffer)
11224 (setq result (funcall match gnus-newsgroup-name))))
11233 result gnus-article-save-directory)
11239 (defun gnus-valid-move-group-p (group)
11243 (gnus-get-function (gnus-find-method-for-group
11244 (symbol-name group)) 'request-accept-article t)))
11246 (defun gnus-read-move-group-name (prompt default articles prefix)
11248 (let* ((split-name (gnus-get-split-value gnus-move-split-methods))
11255 "this article")))
11259 (gnus-completing-read-with-default
11261 gnus-active-hashtb
11262 'gnus-valid-move-group-p
11264 'gnus-group-history))
11266 (gnus-completing-read-with-default
11268 gnus-active-hashtb
11269 'gnus-valid-move-group-p
11271 'gnus-group-history))
11273 (gnus-completing-read-with-default
11278 'gnus-group-history))))
11279 (to-method (gnus-server-to-method (gnus-group-method to-newsgroup))))
11286 (or (gnus-active to-newsgroup)
11287 (gnus-activate-group to-newsgroup nil nil to-method)
11288 (if (gnus-y-or-n-p (format "No such group: %s. Create it? "
11290 (or (and (gnus-request-create-group to-newsgroup to-method)
11291 (gnus-activate-group
11293 (gnus-subscribe-group to-newsgroup))
11298 (defun gnus-summary-save-parts (type dir n &optional reverse)
11303 (or (car gnus-summary-save-parts-type-history)
11304 gnus-summary-save-parts-default-mime)
11305 'gnus-summary-save-parts-type-history)
11306 (setq gnus-summary-save-parts-last-directory
11308 gnus-summary-save-parts-last-directory
11311 (gnus-summary-iterate n
11312 (let ((gnus-display-mime-function nil)
11313 (gnus-inhibit-treatment t))
11314 (gnus-summary-select-article))
11316 (set-buffer gnus-article-buffer)
11317 (let ((handles (or gnus-article-mime-handles
11318 (mm-dissect-buffer nil gnus-article-loose-mime)
11319 (and gnus-article-emulate-mime
11322 (gnus-summary-save-parts-1 type dir handles reverse)
11323 (unless gnus-article-mime-handles ;; Don't destroy this case.
11326 (defun gnus-summary-save-parts-1 (type dir handle reverse)
11328 (mapcar (lambda (h) (gnus-summary-save-parts-1 type dir h reverse))
11334 (gnus-map-function
11342 (concat gnus-newsgroup-name
11344 (cdr gnus-article-current))))))
11351 (defun gnus-summary-insert-pseudos (pslist &optional not-view)
11353 (article (gnus-summary-article-number))
11354 after-article b e)
11355 (unless (gnus-summary-goto-subject article)
11356 (error "No such article: %d" article))
11357 (gnus-summary-position-point)
11360 (unless gnus-view-pseudos-separately
11361 (let ((ps (setq pslist (sort pslist 'gnus-pseudos<)))
11387 (if (and gnus-view-pseudos (not not-view))
11390 (gnus-execute-command (cdr (assq 'execute (car pslist)))
11391 (eq gnus-view-pseudos 'not-confirm)))
11395 (setq after-article (or (cdr (assq 'article (car pslist)))
11396 (gnus-summary-article-number)))
11397 (gnus-summary-goto-subject after-article)
11405 (gnus-add-text-properties
11406 b (1- e) (list 'gnus-number gnus-reffed-article-number
11407 gnus-mouse-face-prop gnus-mouse-face))
11408 (gnus-data-enter
11409 after-article gnus-reffed-article-number
11410 gnus-unread-mark b (car pslist) 0 (- e b))
11411 (setq gnus-newsgroup-unreads
11412 (gnus-add-to-sorted-list gnus-newsgroup-unreads
11413 gnus-reffed-article-number))
11414 (setq gnus-reffed-article-number (1- gnus-reffed-article-number))
11417 (defun gnus-pseudos< (p1 p2)
11422 (defun gnus-request-pseudo-article (props)
11424 (gnus-execute-command (cdr (assq 'execute props)))))
11425 (let ((gnus-current-article (gnus-summary-article-number)))
11426 (gnus-run-hooks 'gnus-mark-article-hook)))
11428 (defun gnus-execute-command (command &optional automatic)
11430 (gnus-article-setup-buffer)
11431 (set-buffer gnus-article-buffer)
11437 (if gnus-view-pseudo-asynchronously
11438 (start-process "gnus-execute" (current-buffer) shell-file-name
11445 (defun gnus-summary-edit-global-kill (article)
11447 (interactive (list (gnus-summary-article-number)))
11448 (gnus-group-edit-global-kill article))
11450 (defun gnus-summary-edit-local-kill ()
11453 (setq gnus-current-headers (gnus-summary-article-header))
11454 (gnus-group-edit-local-kill
11455 (gnus-summary-article-number) gnus-newsgroup-name))
11459 (defun gnus-read-header (id &optional header)
11460 "Read the headers of article ID and enter them into the Gnus system."
11461 (let ((group gnus-newsgroup-name)
11462 (gnus-override-method
11464 gnus-override-method
11465 (and (gnus-news-group-p gnus-newsgroup-name)
11466 (car (gnus-refer-article-methods)))))
11472 (setq header (or header (gnus-id-to-header id)))
11473 ;; This is an article number.
11474 (setq header (or header (gnus-summary-article-header id))))
11476 (not (gnus-summary-article-sparse-p (mail-header-number header))))
11479 ;; We have to really fetch the header to this article.
11482 (when (setq where (gnus-request-head id group))
11492 (t gnus-reffed-article-number))
11496 (not (setq header (car (gnus-get-newsgroup-headers nil t)))))
11498 (unless (gnus-summary-article-sparse-p (mail-header-number header))
11500 (not (string= (gnus-group-real-name group)
11502 ;; If we fetched by Message-ID and the article came
11503 ;; from a different group, we fudge some bogus article
11504 ;; numbers for this article.
11505 (mail-header-set-number header gnus-reffed-article-number))
11507 (set-buffer gnus-summary-buffer)
11508 (decf gnus-reffed-article-number)
11509 (gnus-remove-header (mail-header-number header))
11510 (push header gnus-newsgroup-headers)
11511 (setq gnus-current-headers header)
11512 (push (mail-header-number header) gnus-newsgroup-limit)))
11515 (defun gnus-remove-header (number)
11516 "Remove header NUMBER from `gnus-newsgroup-headers'."
11517 (if (and gnus-newsgroup-headers
11518 (= number (mail-header-number (car gnus-newsgroup-headers))))
11519 (pop gnus-newsgroup-headers)
11520 (let ((headers gnus-newsgroup-headers))
11531 (defun gnus-highlight-selected-summary ()
11532 "Highlight selected article in summary buffer."
11534 (when gnus-summary-selected-face
11536 (let* ((beg (gnus-point-at-bol))
11537 (end (gnus-point-at-eol))
11539 (from (if (get-text-property beg gnus-mouse-face-prop)
11542 beg gnus-mouse-face-prop nil end)
11548 from gnus-mouse-face-prop nil end)
11550 ;; If no mouse-face prop on line we will have to = from = end,
11555 (if gnus-newsgroup-selected-overlay
11557 (gnus-move-overlay
11558 gnus-newsgroup-selected-overlay from to (current-buffer))
11560 (gnus-overlay-put
11561 (setq gnus-newsgroup-selected-overlay (gnus-make-overlay from to))
11562 'face gnus-summary-selected-face))))))
11564 (defvar gnus-summary-highlight-line-cached nil)
11565 (defvar gnus-summary-highlight-line-trigger nil)
11567 (defun gnus-summary-highlight-line-0 ()
11568 (if (and (eq gnus-summary-highlight-line-trigger
11569 gnus-summary-highlight)
11570 gnus-summary-highlight-line-cached)
11571 gnus-summary-highlight-line-cached
11572 (setq gnus-summary-highlight-line-trigger gnus-summary-highlight
11573 gnus-summary-highlight-line-cached
11576 (list gnus-summary-highlight))
11582 (gnus-byte-compile (list 'lambda nil cond))))))
11584 (defun gnus-summary-highlight-line ()
11585 "Highlight current line according to `gnus-summary-highlight'."
11586 (let* ((beg (gnus-point-at-bol))
11587 (article (or (gnus-summary-article-number) gnus-current-article))
11588 (score (or (cdr (assq article
11589 gnus-newsgroup-scored))
11590 gnus-summary-default-score 0))
11591 (mark (or (gnus-summary-article-mark) gnus-unread-mark))
11593 (default gnus-summary-default-score)
11594 (default-high gnus-summary-default-high-score)
11595 (default-low gnus-summary-default-low-score)
11596 (uncached (and gnus-summary-use-undownloaded-faces
11597 (memq article gnus-newsgroup-undownloaded)
11598 (not (memq article gnus-newsgroup-cached)))))
11599 (let ((face (funcall (gnus-summary-highlight-line-0))))
11600 (unless (eq face (get-text-property beg 'face))
11601 (gnus-put-text-property-excluding-characters-with-faces
11602 beg (gnus-point-at-eol) 'face
11603 (setq face (if (boundp face) (symbol-value face) face)))
11604 (when gnus-summary-highlight-line-function
11605 (funcall gnus-summary-highlight-line-function article face))))))
11607 (defun gnus-update-read-articles (group unread &optional compute)
11610 (let* ((active (or gnus-newsgroup-active (gnus-active group)))
11611 (entry (gnus-gethash group gnus-newsrc-hashtb))
11625 ;; Remove any expired article numbers
11645 (when (gnus-check-backend-function 'request-set-mark group)
11646 (let ((del (gnus-remove-from-range (gnus-info-read info) read))
11647 (add (gnus-remove-from-range read (gnus-info-read info))))
11649 (unless (gnus-check-group group)
11651 (gnus-request-set-mark
11655 `(gnus-request-set-mark
11660 (set-buffer gnus-group-buffer)
11661 (gnus-undo-register
11663 (gnus-info-set-marks ',info ',(gnus-info-marks info) t)
11664 (gnus-info-set-read ',info ',(gnus-info-read info))
11665 (gnus-get-unread-articles-in-group ',info
11666 (gnus-active ,group))
11667 (gnus-group-update-group ,group t)
11670 (gnus-info-set-read info read)
11671 ;; Set the number of unread articles in gnus-newsrc-hashtb.
11672 (gnus-get-unread-articles-in-group info (gnus-active group))
11675 (defun gnus-offer-save-summaries ()
11685 (and (eq major-mode 'gnus-summary-mode)
11687 gnus-newsgroup-prepared
11690 (not gnus-dead-summary-mode))))
11699 (gnus-summary-exit))
11702 (defun gnus-summary-setup-default-charset ()
11704 (if (member gnus-newsgroup-name '("nndraft:delayed" "nndraft:drafts"))
11705 (setq gnus-newsgroup-charset nil)
11707 (or gnus-newsgroup-ephemeral-ignored-charsets
11709 (and gnus-newsgroup-name
11710 (gnus-parameter-ignored-charsets gnus-newsgroup-name))
11711 gnus-newsgroup-ignored-charsets))))
11712 (setq gnus-newsgroup-charset
11713 (or gnus-newsgroup-ephemeral-charset
11714 (and gnus-newsgroup-name
11715 (gnus-parameter-charset gnus-newsgroup-name))
11716 gnus-default-charset))
11717 (set (make-local-variable 'gnus-newsgroup-ignored-charsets)
11724 (defun gnus-summary-display-buttonized (&optional show-all-parts)
11725 "Display the current article buffer fully MIME-buttonized.
11729 (require 'gnus-art)
11730 (let ((gnus-unbuttonized-mime-types nil)
11731 (gnus-mime-display-multipart-as-mixed show-all-parts))
11732 (gnus-summary-show-article)))
11734 (defun gnus-summary-repair-multipart (article)
11735 "Add a Content-Type header to a multipart article without one."
11736 (interactive (list (gnus-summary-article-number)))
11737 (gnus-with-article article
11744 (let ((separator (buffer-substring (point) (gnus-point-at-eol))))
11751 (let (gnus-mark-article-hook)
11752 (gnus-summary-select-article t t nil article)))
11754 (defun gnus-summary-toggle-display-buttonized ()
11755 "Toggle the buttonizing of the article buffer."
11757 (require 'gnus-art)
11758 (if (setq gnus-inhibit-mime-unbuttonizing
11759 (not gnus-inhibit-mime-unbuttonizing))
11760 (let ((gnus-unbuttonized-mime-types nil))
11761 (gnus-summary-show-article))
11762 (gnus-summary-show-article)))
11768 (defvar gnus-summary-marking-alist
11769 '((read gnus-del-mark "d")
11770 (unread gnus-unread-mark "u")
11771 (ticked gnus-ticked-mark "!")
11772 (dormant gnus-dormant-mark "?")
11773 (expirable gnus-expirable-mark "e"))
11776 (defvar gnus-summary-generic-mark-map (make-sparse-keymap))
11777 (defvar gnus-summary-mark-map)
11779 (defun gnus-summary-make-all-marking-commands ()
11780 (define-key gnus-summary-mark-map "M" gnus-summary-generic-mark-map)
11781 (dolist (elem gnus-summary-marking-alist)
11782 (apply 'gnus-summary-make-marking-command elem)))
11784 (defun gnus-summary-make-marking-command (name mark keystroke)
11786 (define-key gnus-summary-generic-mark-map keystroke map)
11792 (let ((func (gnus-summary-make-marking-command-1
11797 (defun gnus-summary-make-marking-command-1 (mark way lway name)
11799 (format "gnus-summary-put-mark-as-%s%s"
11805 "Mark the current article as %s%s.
11812 (gnus-summary-generic-mark n ,mark ',(nth 2 lway) ,(nth 3 lway))))
11814 (defun gnus-summary-generic-mark (n mark move unread)
11816 (unless (eq major-mode 'gnus-summary-mode)
11818 (gnus-summary-show-thread)
11830 (gnus-summary-mark-article nil mark)
11831 (zerop (gnus-summary-next-subject nummove unread t)))
11834 (gnus-message 7 "No more %sarticles" (if mark "" "unread ")))
11835 (gnus-summary-recenter)
11836 (gnus-summary-position-point)
11837 (gnus-set-mode-line 'summary)
11840 (defun gnus-summary-insert-articles (articles)
11842 (gnus-sorted-difference articles
11845 gnus-newsgroup-headers)))
11846 (setq gnus-newsgroup-headers
11847 (gnus-merge 'list
11848 gnus-newsgroup-headers
11849 (gnus-fetch-headers articles)
11850 'gnus-article-sort-by-number))
11852 (when gnus-suppress-duplicates
11853 (gnus-dup-suppress-articles))
11856 (when (and gnus-fetch-old-headers
11857 (eq gnus-headers-retrieved-by 'nov))
11858 (if (eq gnus-fetch-old-headers 'invisible)
11859 (gnus-build-all-threads)
11860 (gnus-build-old-threads)))
11862 (when gnus-agent
11863 (gnus-agent-get-undownloaded-list))
11865 (when gnus-list-identifiers
11866 (gnus-summary-remove-list-identifiers))
11867 ;; First and last article in this newsgroup.
11868 (when gnus-newsgroup-headers
11869 (setq gnus-newsgroup-begin
11870 (mail-header-number (car gnus-newsgroup-headers))
11871 gnus-newsgroup-end
11873 (gnus-last-element gnus-newsgroup-headers))))
11874 (when gnus-use-scoring
11875 (gnus-possibly-score-headers))))
11877 (defun gnus-summary-insert-old-articles (&optional all)
11883 (let ((old (sort (mapcar 'car gnus-newsgroup-data) '<))
11889 (gnus-range-difference (list gnus-newsgroup-active) old))
11890 (setq len (gnus-range-length older))
11907 (setq older (gnus-uncompress-range older))))
11909 (setq older (gnus-uncompress-range older)))
11911 (when (and (numberp gnus-large-newsgroup)
11912 (> len gnus-large-newsgroup))
11914 (initial (gnus-parameter-large-newsgroup-initial
11915 gnus-newsgroup-name))
11920 (gnus-limit-string
11921 (gnus-group-decoded-name gnus-newsgroup-name) 35)
11942 (setq older (gnus-uncompress-range older))))
11945 (gnus-summary-insert-articles older)
11946 (gnus-summary-limit (gnus-sorted-nunion old older))))
11947 (gnus-summary-position-point)))
11949 (defun gnus-summary-insert-new-articles ()
11953 (let ((old (sort (mapcar 'car gnus-newsgroup-data) '<))
11954 (old-active gnus-newsgroup-active)
11957 (setq gnus-newsgroup-active
11958 (gnus-activate-group gnus-newsgroup-name 'scan))
11959 (setq i (cdr gnus-newsgroup-active))
11964 (message "No gnus is bad news.")
11965 (gnus-summary-insert-articles new)
11966 (setq gnus-newsgroup-unreads
11967 (gnus-sorted-nunion gnus-newsgroup-unreads new))
11968 (gnus-summary-limit (gnus-sorted-nunion old new))))
11969 (gnus-summary-position-point)))
11971 (gnus-summary-make-all-marking-commands)
11973 (gnus-ems-redefine)
11975 (provide 'gnus-sum)
11977 (run-hooks 'gnus-sum-load-hook)
11984 ;;; gnus-sum.el ends here