annotate lisp/gnus/gnus-sum.el @ 20:859a2309aef8 r19-15b93

Import from CVS: tag r19-15b93
author cvs
date Mon, 13 Aug 2007 08:50:05 +0200
parents d95e72db5c07
children 8fc7fe29b841
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1 ;;; gnus-sum.el --- summary mode commands for Gnus
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2 ;; Copyright (C) 1996,97 Free Software Foundation, Inc.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5 ;; Keywords: news
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
12 ;; any later version.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
13
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
17 ;; GNU General Public License for more details.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
18
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
22 ;; Boston, MA 02111-1307, USA.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
23
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
24 ;;; Commentary:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
25
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
26 ;;; Code:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
27
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
28 (require 'gnus)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
29 (require 'gnus-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
30 (require 'gnus-spec)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
31 (require 'gnus-range)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
32 (require 'gnus-int)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
33 (require 'gnus-undo)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
34
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
35 (defcustom gnus-kill-summary-on-exit t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
36 "*If non-nil, kill the summary buffer when you exit from it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
37 If nil, the summary will become a \"*Dead Summary*\" buffer, and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
38 it will be killed sometime later."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
39 :group 'gnus-summary-exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
40 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
41
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
42 (defcustom gnus-fetch-old-headers nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
43 "*Non-nil means that Gnus will try to build threads by grabbing old headers.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
44 If an unread article in the group refers to an older, already read (or
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
45 just marked as read) article, the old article will not normally be
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
46 displayed in the Summary buffer. If this variable is non-nil, Gnus
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
47 will attempt to grab the headers to the old articles, and thereby
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
48 build complete threads. If it has the value `some', only enough
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
49 headers to connect otherwise loose threads will be displayed.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
50 This variable can also be a number. In that case, no more than that
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
51 number of old headers will be fetched.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
52
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
53 The server has to support NOV for any of this to work."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
54 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
55 :type '(choice (const :tag "off" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
56 (const some)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
57 number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
58 (sexp :menu-tag "other" t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
59
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
60 (defcustom gnus-summary-make-false-root 'adopt
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
61 "*nil means that Gnus won't gather loose threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
62 If the root of a thread has expired or been read in a previous
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
63 session, the information necessary to build a complete thread has been
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
64 lost. Instead of having many small sub-threads from this original thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
65 scattered all over the summary buffer, Gnus can gather them.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
66
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
67 If non-nil, Gnus will try to gather all loose sub-threads from an
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
68 original thread into one large thread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
69
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
70 If this variable is non-nil, it should be one of `none', `adopt',
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
71 `dummy' or `empty'.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
72
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
73 If this variable is `none', Gnus will not make a false root, but just
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
74 present the sub-threads after another.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
75 If this variable is `dummy', Gnus will create a dummy root that will
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
76 have all the sub-threads as children.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
77 If this variable is `adopt', Gnus will make one of the \"children\"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
78 the parent and mark all the step-children as such.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
79 If this variable is `empty', the \"children\" are printed with empty
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
80 subject fields. (Or rather, they will be printed with a string
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
81 given by the `gnus-summary-same-subject' variable.)"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
82 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
83 :type '(choice (const :tag "off" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
84 (const none)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
85 (const dummy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
86 (const adopt)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
87 (const empty)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
88
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
89 (defcustom gnus-summary-gather-exclude-subject "^ *$\\|^(none)$"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
90 "*A regexp to match subjects to be excluded from loose thread gathering.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
91 As loose thread gathering is done on subjects only, that means that
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
92 there can be many false gatherings performed. By rooting out certain
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
93 common subjects, gathering might become saner."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
94 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
95 :type 'regexp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
96
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
97 (defcustom gnus-summary-gather-subject-limit nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
98 "*Maximum length of subject comparisons when gathering loose threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
99 Use nil to compare full subjects. Setting this variable to a low
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
100 number will help gather threads that have been corrupted by
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
101 newsreaders chopping off subject lines, but it might also mean that
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
102 unrelated articles that have subject that happen to begin with the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
103 same few characters will be incorrectly gathered.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
104
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
105 If this variable is `fuzzy', Gnus will use a fuzzy algorithm when
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
106 comparing subjects."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
107 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
108 :type '(choice (const :tag "off" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
109 (const fuzzy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
110 (sexp :menu-tag "on" t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
111
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
112 (defcustom gnus-simplify-ignored-prefixes nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
113 "*Regexp, matches for which are removed from subject lines when simplifying fuzzily."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
114 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
115 :type '(choice (const :tag "off" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
116 regexp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
117
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
118 (defcustom gnus-build-sparse-threads nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
119 "*If non-nil, fill in the gaps in threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
120 If `some', only fill in the gaps that are needed to tie loose threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
121 together. If `more', fill in all leaf nodes that Gnus can find. If
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
122 non-nil and non-`some', fill in all gaps that Gnus manages to guess."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
123 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
124 :type '(choice (const :tag "off" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
125 (const some)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
126 (const more)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
127 (sexp :menu-tag "all" t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
128
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
129 (defcustom gnus-summary-thread-gathering-function 'gnus-gather-threads-by-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
130 "Function used for gathering loose threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
131 There are two pre-defined functions: `gnus-gather-threads-by-subject',
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
132 which only takes Subjects into consideration; and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
133 `gnus-gather-threads-by-references', which compared the References
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
134 headers of the articles to find matches."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
135 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
136 :type '(set (function-item gnus-gather-threads-by-subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
137 (function-item gnus-gather-threads-by-references)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
138 (function :tag "other")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
139
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
140 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
141 (defcustom gnus-summary-same-subject ""
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
142 "*String indicating that the current article has the same subject as the previous.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
143 This variable will only be used if the value of
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
144 `gnus-summary-make-false-root' is `empty'."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
145 :group 'gnus-summary-format
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
146 :type 'string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
147
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
148 (defcustom gnus-summary-goto-unread t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
149 "*If t, marking commands will go to the next unread article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
150 If `never', commands that usually go to the next unread article, will
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
151 go to the next article, whether it is read or not.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
152 If nil, only the marking commands will go to the next (un)read article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
153 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
154 :link '(custom-manual "(gnus)Setting Marks")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
155 :type '(choice (const :tag "off" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
156 (const never)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
157 (sexp :menu-tag "on" t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
158
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
159 (defcustom gnus-summary-default-score 0
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
160 "*Default article score level.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
161 If this variable is nil, scoring will be disabled."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
162 :group 'gnus-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
163 :type '(choice (const :tag "disable")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
164 integer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
165
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
166 (defcustom gnus-summary-zcore-fuzz 0
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
167 "*Fuzziness factor for the zcore in the summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
168 Articles with scores closer than this to `gnus-summary-default-score'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
169 will not be marked."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
170 :group 'gnus-summary-format
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
171 :type 'integer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
172
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
173 (defcustom gnus-simplify-subject-fuzzy-regexp nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
174 "*Strings to be removed when doing fuzzy matches.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
175 This can either be a regular expression or list of regular expressions
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
176 that will be removed from subject strings if fuzzy subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
177 simplification is selected."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
178 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
179 :type '(repeat regexp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
180
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
181 (defcustom gnus-show-threads t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
182 "*If non-nil, display threads in summary mode."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
183 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
184 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
185
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
186 (defcustom gnus-thread-hide-subtree nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
187 "*If non-nil, hide all threads initially.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
188 If threads are hidden, you have to run the command
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
189 `gnus-summary-show-thread' by hand or use `gnus-select-article-hook'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
190 to expose hidden threads."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
191 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
192 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
193
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
194 (defcustom gnus-thread-hide-killed t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
195 "*If non-nil, hide killed threads automatically."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
196 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
197 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
198
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
199 (defcustom gnus-thread-ignore-subject nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
200 "*If non-nil, ignore subjects and do all threading based on the Reference header.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
201 If nil, which is the default, articles that have different subjects
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
202 from their parents will start separate threads."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
203 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
204 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
205
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
206 (defcustom gnus-thread-operation-ignore-subject t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
207 "*If non-nil, subjects will be ignored when doing thread commands.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
208 This affects commands like `gnus-summary-kill-thread' and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
209 `gnus-summary-lower-thread'.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
210
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
211 If this variable is nil, articles in the same thread with different
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
212 subjects will not be included in the operation in question. If this
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
213 variable is `fuzzy', only articles that have subjects that are fuzzily
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
214 equal will be included."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
215 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
216 :type '(choice (const :tag "off" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
217 (const fuzzy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
218 (sexp :tag "on" t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
219
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
220 (defcustom gnus-thread-indent-level 4
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
221 "*Number that says how much each sub-thread should be indented."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
222 :group 'gnus-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
223 :type 'integer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
224
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
225 (defcustom gnus-auto-extend-newsgroup t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
226 "*If non-nil, extend newsgroup forward and backward when requested."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
227 :group 'gnus-summary-choose
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
228 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
229
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
230 (defcustom gnus-auto-select-first t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
231 "*If nil, don't select the first unread article when entering a group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
232 If this variable is `best', select the highest-scored unread article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
233 in the group. If neither nil nor `best', select the first unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
234 article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
235
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
236 If you want to prevent automatic selection of the first unread article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
237 in some newsgroups, set the variable to nil in
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
238 `gnus-select-group-hook'."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
239 :group 'gnus-group-select
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
240 :type '(choice (const :tag "none" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
241 (const best)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
242 (sexp :menu-tag "first" t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
243
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
244 (defcustom gnus-auto-select-next t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
245 "*If non-nil, offer to go to the next group from the end of the previous.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
246 If the value is t and the next newsgroup is empty, Gnus will exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
247 summary mode and go back to group mode. If the value is neither nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
248 nor t, Gnus will select the following unread newsgroup. In
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
249 particular, if the value is the symbol `quietly', the next unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
250 newsgroup will be selected without any confirmation, and if it is
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
251 `almost-quietly', the next group will be selected without any
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
252 confirmation if you are located on the last article in the group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
253 Finally, if this variable is `slightly-quietly', the `Z n' command
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
254 will go to the next group without confirmation."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
255 :group 'gnus-summary-maneuvering
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
256 :type '(choice (const :tag "off" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
257 (const quietly)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
258 (const almost-quietly)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
259 (const slightly-quietly)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
260 (sexp :menu-tag "on" t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
261
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
262 (defcustom gnus-auto-select-same nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
263 "*If non-nil, select the next article with the same subject."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
264 :group 'gnus-summary-maneuvering
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
265 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
266
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
267 (defcustom gnus-summary-check-current nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
268 "*If non-nil, consider the current article when moving.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
269 The \"unread\" movement commands will stay on the same line if the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
270 current article is unread."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
271 :group 'gnus-summary-maneuvering
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
272 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
273
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
274 (defcustom gnus-auto-center-summary t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
275 "*If non-nil, always center the current summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
276 In particular, if `vertical' do only vertical recentering. If non-nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
277 and non-`vertical', do both horizontal and vertical recentering."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
278 :group 'gnus-summary-maneuvering
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
279 :type '(choice (const :tag "none" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
280 (const vertical)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
281 (sexp :menu-tag "both" t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
282
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
283 (defcustom gnus-show-all-headers nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
284 "*If non-nil, don't hide any headers."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
285 :group 'gnus-article-hiding
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
286 :group 'gnus-article-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
287 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
288
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
289 (defcustom gnus-single-article-buffer t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
290 "*If non-nil, display all articles in the same buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
291 If nil, each group will get its own article buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
292 :group 'gnus-article-various
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
293 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
294
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
295 (defcustom gnus-break-pages t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
296 "*If non-nil, do page breaking on articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
297 The page delimiter is specified by the `gnus-page-delimiter'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
298 variable."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
299 :group 'gnus-article-various
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
300 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
301
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
302 (defcustom gnus-show-mime nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
303 "*If non-nil, do mime processing of articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
304 The articles will simply be fed to the function given by
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
305 `gnus-show-mime-method'."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
306 :group 'gnus-article-mime
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
307 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
308
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
309 (defcustom gnus-move-split-methods nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
310 "*Variable used to suggest where articles are to be moved to.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
311 It uses the same syntax as the `gnus-split-methods' variable."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
312 :group 'gnus-summary-mail
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
313 :type '(repeat (choice (list function)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
314 (cons regexp (repeat string))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
315 sexp)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
316
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
317 ;; Mark variables suggested by Thomas Michanek
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
318 ;; <Thomas.Michanek@telelogic.se>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
319
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
320 (defcustom gnus-unread-mark ?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
321 "*Mark used for unread articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
322 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
323 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
324
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
325 (defcustom gnus-ticked-mark ?!
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
326 "*Mark used for ticked articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
327 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
328 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
329
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
330 (defcustom gnus-dormant-mark ??
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
331 "*Mark used for dormant articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
332 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
333 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
334
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
335 (defcustom gnus-del-mark ?r
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
336 "*Mark used for del'd articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
337 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
338 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
339
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
340 (defcustom gnus-read-mark ?R
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
341 "*Mark used for read articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
342 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
343 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
344
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
345 (defcustom gnus-expirable-mark ?E
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
346 "*Mark used for expirable articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
347 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
348 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
349
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
350 (defcustom gnus-killed-mark ?K
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
351 "*Mark used for killed articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
352 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
353 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
354
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
355 (defcustom gnus-souped-mark ?F
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
356 "*Mark used for killed articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
357 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
358 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
359
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
360 (defcustom gnus-kill-file-mark ?X
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
361 "*Mark used for articles killed by kill files."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
362 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
363 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
364
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
365 (defcustom gnus-low-score-mark ?Y
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
366 "*Mark used for articles with a low score."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
367 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
368 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
369
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
370 (defcustom gnus-catchup-mark ?C
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
371 "*Mark used for articles that are caught up."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
372 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
373 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
374
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
375 (defcustom gnus-replied-mark ?A
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
376 "*Mark used for articles that have been replied to."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
377 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
378 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
379
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
380 (defcustom gnus-cached-mark ?*
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
381 "*Mark used for articles that are in the cache."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
382 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
383 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
384
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
385 (defcustom gnus-saved-mark ?S
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
386 "*Mark used for articles that have been saved to."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
387 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
388 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
389
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
390 (defcustom gnus-ancient-mark ?O
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
391 "*Mark used for ancient articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
392 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
393 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
394
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
395 (defcustom gnus-sparse-mark ?Q
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
396 "*Mark used for sparsely reffed articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
397 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
398 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
399
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
400 (defcustom gnus-canceled-mark ?G
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
401 "*Mark used for canceled articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
402 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
403 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
404
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
405 (defcustom gnus-duplicate-mark ?M
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
406 "*Mark used for duplicate articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
407 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
408 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
409
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
410 (defcustom gnus-score-over-mark ?+
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
411 "*Score mark used for articles with high scores."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
412 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
413 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
414
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
415 (defcustom gnus-score-below-mark ?-
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
416 "*Score mark used for articles with low scores."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
417 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
418 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
419
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
420 (defcustom gnus-empty-thread-mark ?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
421 "*There is no thread under the article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
422 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
423 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
424
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
425 (defcustom gnus-not-empty-thread-mark ?=
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
426 "*There is a thread under the article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
427 :group 'gnus-summary-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
428 :type 'character)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
429
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
430 (defcustom gnus-view-pseudo-asynchronously nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
431 "*If non-nil, Gnus will view pseudo-articles asynchronously."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
432 :group 'gnus-extract-view
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
433 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
434
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
435 (defcustom gnus-view-pseudos nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
436 "*If `automatic', pseudo-articles will be viewed automatically.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
437 If `not-confirm', pseudos will be viewed automatically, and the user
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
438 will not be asked to confirm the command."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
439 :group 'gnus-extract-view
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
440 :type '(choice (const :tag "off" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
441 (const automatic)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
442 (const not-confirm)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
443
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
444 (defcustom gnus-view-pseudos-separately t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
445 "*If non-nil, one pseudo-article will be created for each file to be viewed.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
446 If nil, all files that use the same viewing command will be given as a
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
447 list of parameters to that command."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
448 :group 'gnus-extract-view
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
449 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
450
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
451 (defcustom gnus-insert-pseudo-articles t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
452 "*If non-nil, insert pseudo-articles when decoding articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
453 :group 'gnus-extract-view
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
454 :type 'boolean)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
455
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
456 (defcustom gnus-summary-dummy-line-format
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
457 "* %(: :%) %S\n"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
458 "*The format specification for the dummy roots in the summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
459 It works along the same lines as a normal formatting string,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
460 with some simple extensions.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
461
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
462 %S The subject"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
463 :group 'gnus-threading
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
464 :type 'string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
465
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
466 (defcustom gnus-summary-mode-line-format "Gnus: %%b [%A] %Z"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
467 "*The format specification for the summary mode line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
468 It works along the same lines as a normal formatting string,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
469 with some simple extensions:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
470
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
471 %G Group name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
472 %p Unprefixed group name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
473 %A Current article number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
474 %V Gnus version
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
475 %U Number of unread articles in the group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
476 %e Number of unselected articles in the group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
477 %Z A string with unread/unselected article counts
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
478 %g Shortish group name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
479 %S Subject of the current article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
480 %u User-defined spec
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
481 %s Current score file name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
482 %d Number of dormant articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
483 %r Number of articles that have been marked as read in this session
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
484 %E Number of articles expunged by the score files"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
485 :group 'gnus-summary-format
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
486 :type 'string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
487
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
488 (defcustom gnus-summary-mark-below 0
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
489 "*Mark all articles with a score below this variable as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
490 This variable is local to each summary buffer and usually set by the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
491 score file."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
492 :group 'gnus-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
493 :type 'integer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
494
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
495 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
496 "*List of functions used for sorting articles in the summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
497 This variable is only used when not using a threaded display."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
498 :group 'gnus-summary-sort
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
499 :type '(repeat (choice (function-item gnus-article-sort-by-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
500 (function-item gnus-article-sort-by-author)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
501 (function-item gnus-article-sort-by-subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
502 (function-item gnus-article-sort-by-date)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
503 (function-item gnus-article-sort-by-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
504 (function :tag "other"))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
505
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
506 (defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
507 "*List of functions used for sorting threads in the summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
508 By default, threads are sorted by article number.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
509
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
510 Each function takes two threads and return non-nil if the first thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
511 should be sorted before the other. If you use more than one function,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
512 the primary sort function should be the last. You should probably
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
513 always include `gnus-thread-sort-by-number' in the list of sorting
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
514 functions -- preferably first.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
515
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
516 Ready-made functions include `gnus-thread-sort-by-number',
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
517 `gnus-thread-sort-by-author', `gnus-thread-sort-by-subject',
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
518 `gnus-thread-sort-by-date', `gnus-thread-sort-by-score' and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
519 `gnus-thread-sort-by-total-score' (see `gnus-thread-score-function')."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
520 :group 'gnus-summary-sort
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
521 :type '(repeat (choice (function-item gnus-thread-sort-by-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
522 (function-item gnus-thread-sort-by-author)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
523 (function-item gnus-thread-sort-by-subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
524 (function-item gnus-thread-sort-by-date)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
525 (function-item gnus-thread-sort-by-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
526 (function-item gnus-thread-sort-by-total-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
527 (function :tag "other"))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
528
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
529 (defcustom gnus-thread-score-function '+
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
530 "*Function used for calculating the total score of a thread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
531
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
532 The function is called with the scores of the article and each
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
533 subthread and should then return the score of the thread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
534
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
535 Some functions you can use are `+', `max', or `min'."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
536 :group 'gnus-summary-sort
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
537 :type 'function)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
538
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
539 (defcustom gnus-summary-expunge-below nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
540 "All articles that have a score less than this variable will be expunged."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
541 :group 'gnus-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
542 :type '(choice (const :tag "off" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
543 integer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
544
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
545 (defcustom gnus-thread-expunge-below nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
546 "All threads that have a total score less than this variable will be expunged.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
547 See `gnus-thread-score-function' for en explanation of what a
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
548 \"thread score\" is."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
549 :group 'gnus-treading
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
550 :group 'gnus-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
551 :type '(choice (const :tag "off" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
552 integer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
553
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
554 (defcustom gnus-summary-mode-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
555 "*A hook for Gnus summary mode.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
556 This hook is run before any variables are set in the summary buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
557 :group 'gnus-summary-various
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
558 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
559
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
560 (defcustom gnus-summary-menu-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
561 "*Hook run after the creation of the summary mode menu."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
562 :group 'gnus-summary-visual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
563 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
564
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
565 (defcustom gnus-summary-exit-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
566 "*A hook called on exit from the summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
567 It will be called with point in the group buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
568 :group 'gnus-summary-exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
569 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
570
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
571 (defcustom gnus-summary-prepare-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
572 "*A hook called after the summary buffer has been generated.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
573 If you want to modify the summary buffer, you can use this hook."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
574 :group 'gnus-summary-various
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
575 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
576
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
577 (defcustom gnus-summary-generate-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
578 "*A hook run just before generating the summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
579 This hook is commonly used to customize threading variables and the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
580 like."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
581 :group 'gnus-summary-various
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
582 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
583
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
584 (defcustom gnus-select-group-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
585 "*A hook called when a newsgroup is selected.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
586
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
587 If you'd like to simplify subjects like the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
588 `gnus-summary-next-same-subject' command does, you can use the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
589 following hook:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
590
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
591 (setq gnus-select-group-hook
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
592 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
593 (lambda ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
594 (mapcar (lambda (header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
595 (mail-header-set-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
596 header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
597 (gnus-simplify-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
598 (mail-header-subject header) 're-only)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
599 gnus-newsgroup-headers))))"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
600 :group 'gnus-group-select
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
601 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
602
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
603 (defcustom gnus-select-article-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
604 "*A hook called when an article is selected."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
605 :group 'gnus-summary-choose
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
606 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
607
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
608 (defcustom gnus-visual-mark-article-hook
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
609 (list 'gnus-highlight-selected-summary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
610 "*Hook run after selecting an article in the summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
611 It is meant to be used for highlighting the article in some way. It
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
612 is not run if `gnus-visual' is nil."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
613 :group 'gnus-summary-visual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
614 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
615
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
616 (defcustom gnus-parse-headers-hook
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
617 (list 'gnus-decode-rfc1522)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
618 "*A hook called before parsing the headers."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
619 :group 'gnus-various
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
620 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
621
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
622 (defcustom gnus-exit-group-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
623 "*A hook called when exiting (not quitting) summary mode."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
624 :group 'gnus-various
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
625 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
626
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
627 (defcustom gnus-summary-update-hook
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
628 (list 'gnus-summary-highlight-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
629 "*A hook called when a summary line is changed.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
630 The hook will not be called if `gnus-visual' is nil.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
631
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
632 The default function `gnus-summary-highlight-line' will
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
633 highlight the line according to the `gnus-summary-highlight'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
634 variable."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
635 :group 'gnus-summary-visual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
636 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
637
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
638 (defcustom gnus-mark-article-hook '(gnus-summary-mark-read-and-unread-as-read)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
639 "*A hook called when an article is selected for the first time.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
640 The hook is intended to mark an article as read (or unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
641 automatically when it is selected."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
642 :group 'gnus-summary-choose
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
643 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
644
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
645 (defcustom gnus-group-no-more-groups-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
646 "*A hook run when returning to group mode having no more (unread) groups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
647 :group 'gnus-group-select
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
648 :type 'hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
649
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
650 (defcustom gnus-summary-selected-face 'gnus-summary-selected-face
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
651 "Face used for highlighting the current article in the summary buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
652 :group 'gnus-summary-visual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
653 :type 'face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
654
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
655 (defcustom gnus-summary-highlight
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
656 '(((= mark gnus-canceled-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
657 . gnus-summary-cancelled-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
658 ((and (> score default)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
659 (or (= mark gnus-dormant-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
660 (= mark gnus-ticked-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
661 . gnus-summary-high-ticked-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
662 ((and (< score default)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
663 (or (= mark gnus-dormant-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
664 (= mark gnus-ticked-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
665 . gnus-summary-low-ticked-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
666 ((or (= mark gnus-dormant-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
667 (= mark gnus-ticked-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
668 . gnus-summary-normal-ticked-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
669 ((and (> score default) (= mark gnus-ancient-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
670 . gnus-summary-high-ancient-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
671 ((and (< score default) (= mark gnus-ancient-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
672 . gnus-summary-low-ancient-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
673 ((= mark gnus-ancient-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
674 . gnus-summary-normal-ancient-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
675 ((and (> score default) (= mark gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
676 . gnus-summary-high-unread-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
677 ((and (< score default) (= mark gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
678 . gnus-summary-low-unread-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
679 ((and (= mark gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
680 . gnus-summary-normal-unread-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
681 ((> score default)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
682 . gnus-summary-high-read-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
683 ((< score default)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
684 . gnus-summary-low-read-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
685 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
686 . gnus-summary-normal-read-face))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
687 "Controls the highlighting of summary buffer lines.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
688
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
689 A list of (FORM . FACE) pairs. When deciding how a a particular
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
690 summary line should be displayed, each form is evaluated. The content
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
691 of the face field after the first true form is used. You can change
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
692 how those summary lines are displayed, by editing the face field.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
693
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
694 You can use the following variables in the FORM field.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
695
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
696 score: The articles score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
697 default: The default article score.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
698 below: The score below which articles are automatically marked as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
699 mark: The articles mark."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
700 :group 'gnus-summary-visual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
701 :type '(repeat (cons (sexp :tag "Form" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
702 face)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
703
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
704 ;;; Internal variables
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
705
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
706 (defvar gnus-scores-exclude-files nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
707
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
708 (defvar gnus-summary-display-table
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
709 ;; Change the display table. Odd characters have a tendency to mess
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
710 ;; up nicely formatted displays - we make all possible glyphs
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
711 ;; display only a single character.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
712
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
713 ;; We start from the standard display table, if any.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
714 (let ((table (or (copy-sequence standard-display-table)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
715 (make-display-table)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
716 ;; Nix out all the control chars...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
717 (i 32))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
718 (while (>= (setq i (1- i)) 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
719 (aset table i [??]))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
720 ;; ... but not newline and cr, of course. (cr is necessary for the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
721 ;; selective display).
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
722 (aset table ?\n nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
723 (aset table ?\r nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
724 ;; We nix out any glyphs over 126 that are not set already.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
725 (let ((i 256))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
726 (while (>= (setq i (1- i)) 127)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
727 ;; Only modify if the entry is nil.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
728 (or (aref table i)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
729 (aset table i [??]))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
730 table)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
731 "Display table used in summary mode buffers.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
732
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
733 (defvar gnus-original-article nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
734 (defvar gnus-article-internal-prepare-hook nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
735 (defvar gnus-newsgroup-process-stack nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
736
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
737 (defvar gnus-thread-indent-array nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
738 (defvar gnus-thread-indent-array-level gnus-thread-indent-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
739
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
740 ;; Avoid highlighting in kill files.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
741 (defvar gnus-summary-inhibit-highlight nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
742 (defvar gnus-newsgroup-selected-overlay nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
743 (defvar gnus-inhibit-limiting nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
744 (defvar gnus-newsgroup-adaptive-score-file nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
745 (defvar gnus-current-score-file nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
746 (defvar gnus-current-move-group nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
747 (defvar gnus-current-copy-group nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
748 (defvar gnus-current-crosspost-group nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
749
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
750 (defvar gnus-newsgroup-dependencies nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
751 (defvar gnus-newsgroup-adaptive nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
752 (defvar gnus-summary-display-article-function nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
753 (defvar gnus-summary-highlight-line-function nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
754 "Function called after highlighting a summary line.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
755
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
756 (defvar gnus-summary-line-format-alist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
757 `((?N ,(macroexpand '(mail-header-number gnus-tmp-header)) ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
758 (?S ,(macroexpand '(mail-header-subject gnus-tmp-header)) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
759 (?s gnus-tmp-subject-or-nil ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
760 (?n gnus-tmp-name ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
761 (?A (car (cdr (funcall gnus-extract-address-components gnus-tmp-from)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
762 ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
763 (?a (or (car (funcall gnus-extract-address-components gnus-tmp-from))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
764 gnus-tmp-from) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
765 (?F gnus-tmp-from ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
766 (?x ,(macroexpand '(mail-header-xref gnus-tmp-header)) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
767 (?D ,(macroexpand '(mail-header-date gnus-tmp-header)) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
768 (?d (gnus-dd-mmm (mail-header-date gnus-tmp-header)) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
769 (?o (gnus-date-iso8601 gnus-tmp-header) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
770 (?M ,(macroexpand '(mail-header-id gnus-tmp-header)) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
771 (?r ,(macroexpand '(mail-header-references gnus-tmp-header)) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
772 (?c (or (mail-header-chars gnus-tmp-header) 0) ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
773 (?L gnus-tmp-lines ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
774 (?I gnus-tmp-indentation ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
775 (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
776 (?R gnus-tmp-replied ?c)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
777 (?\[ gnus-tmp-opening-bracket ?c)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
778 (?\] gnus-tmp-closing-bracket ?c)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
779 (?\> (make-string gnus-tmp-level ? ) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
780 (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
781 (?i gnus-tmp-score ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
782 (?z gnus-tmp-score-char ?c)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
783 (?l (bbb-grouplens-score gnus-tmp-header) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
784 (?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
785 (?U gnus-tmp-unread ?c)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
786 (?t (gnus-summary-number-of-articles-in-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
787 (and (boundp 'thread) (car thread)) gnus-tmp-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
788 ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
789 (?e (gnus-summary-number-of-articles-in-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
790 (and (boundp 'thread) (car thread)) gnus-tmp-level t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
791 ?c)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
792 (?u gnus-tmp-user-defined ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
793 (?P (gnus-pick-line-number) ?d))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
794 "An alist of format specifications that can appear in summary lines,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
795 and what variables they correspond with, along with the type of the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
796 variable (string, integer, character, etc).")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
797
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
798 (defvar gnus-summary-dummy-line-format-alist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
799 `((?S gnus-tmp-subject ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
800 (?N gnus-tmp-number ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
801 (?u gnus-tmp-user-defined ?s)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
802
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
803 (defvar gnus-summary-mode-line-format-alist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
804 `((?G gnus-tmp-group-name ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
805 (?g (gnus-short-group-name gnus-tmp-group-name) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
806 (?p (gnus-group-real-name gnus-tmp-group-name) ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
807 (?A gnus-tmp-article-number ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
808 (?Z gnus-tmp-unread-and-unselected ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
809 (?V gnus-version ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
810 (?U gnus-tmp-unread-and-unticked ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
811 (?S gnus-tmp-subject ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
812 (?e gnus-tmp-unselected ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
813 (?u gnus-tmp-user-defined ?s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
814 (?d (length gnus-newsgroup-dormant) ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
815 (?t (length gnus-newsgroup-marked) ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
816 (?r (length gnus-newsgroup-reads) ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
817 (?E gnus-newsgroup-expunged-tally ?d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
818 (?s (gnus-current-score-file-nondirectory) ?s)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
819
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
820 (defvar gnus-last-search-regexp nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
821 "Default regexp for article search command.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
822
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
823 (defvar gnus-last-shell-command nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
824 "Default shell command on article.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
825
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
826 (defvar gnus-newsgroup-begin nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
827 (defvar gnus-newsgroup-end nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
828 (defvar gnus-newsgroup-last-rmail nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
829 (defvar gnus-newsgroup-last-mail nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
830 (defvar gnus-newsgroup-last-folder nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
831 (defvar gnus-newsgroup-last-file nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
832 (defvar gnus-newsgroup-auto-expire nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
833 (defvar gnus-newsgroup-active nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
834
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
835 (defvar gnus-newsgroup-data nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
836 (defvar gnus-newsgroup-data-reverse nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
837 (defvar gnus-newsgroup-limit nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
838 (defvar gnus-newsgroup-limits nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
839
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
840 (defvar gnus-newsgroup-unreads nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
841 "List of unread articles in the current newsgroup.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
842
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
843 (defvar gnus-newsgroup-unselected nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
844 "List of unselected unread articles in the current newsgroup.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
845
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
846 (defvar gnus-newsgroup-reads nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
847 "Alist of read articles and article marks in the current newsgroup.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
848
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
849 (defvar gnus-newsgroup-expunged-tally nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
850
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
851 (defvar gnus-newsgroup-marked nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
852 "List of ticked articles in the current newsgroup (a subset of unread art).")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
853
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
854 (defvar gnus-newsgroup-killed nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
855 "List of ranges of articles that have been through the scoring process.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
856
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
857 (defvar gnus-newsgroup-cached nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
858 "List of articles that come from the article cache.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
859
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
860 (defvar gnus-newsgroup-saved nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
861 "List of articles that have been saved.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
862
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
863 (defvar gnus-newsgroup-kill-headers nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
864
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
865 (defvar gnus-newsgroup-replied nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
866 "List of articles that have been replied to in the current newsgroup.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
867
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
868 (defvar gnus-newsgroup-expirable nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
869 "List of articles in the current newsgroup that can be expired.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
870
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
871 (defvar gnus-newsgroup-processable nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
872 "List of articles in the current newsgroup that can be processed.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
873
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
874 (defvar gnus-newsgroup-bookmarks nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
875 "List of articles in the current newsgroup that have bookmarks.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
876
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
877 (defvar gnus-newsgroup-dormant nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
878 "List of dormant articles in the current newsgroup.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
879
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
880 (defvar gnus-newsgroup-scored nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
881 "List of scored articles in the current newsgroup.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
882
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
883 (defvar gnus-newsgroup-headers nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
884 "List of article headers in the current newsgroup.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
885
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
886 (defvar gnus-newsgroup-threads nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
887
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
888 (defvar gnus-newsgroup-prepared nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
889 "Whether the current group has been prepared properly.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
890
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
891 (defvar gnus-newsgroup-ancient nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
892 "List of `gnus-fetch-old-headers' articles in the current newsgroup.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
893
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
894 (defvar gnus-newsgroup-sparse nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
895
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
896 (defvar gnus-current-article nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
897 (defvar gnus-article-current nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
898 (defvar gnus-current-headers nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
899 (defvar gnus-have-all-headers nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
900 (defvar gnus-last-article nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
901 (defvar gnus-newsgroup-history nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
902
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
903 (defconst gnus-summary-local-variables
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
904 '(gnus-newsgroup-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
905 gnus-newsgroup-begin gnus-newsgroup-end
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
906 gnus-newsgroup-last-rmail gnus-newsgroup-last-mail
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
907 gnus-newsgroup-last-folder gnus-newsgroup-last-file
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
908 gnus-newsgroup-auto-expire gnus-newsgroup-unreads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
909 gnus-newsgroup-unselected gnus-newsgroup-marked
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
910 gnus-newsgroup-reads gnus-newsgroup-saved
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
911 gnus-newsgroup-replied gnus-newsgroup-expirable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
912 gnus-newsgroup-processable gnus-newsgroup-killed
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
913 gnus-newsgroup-bookmarks gnus-newsgroup-dormant
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
914 gnus-newsgroup-headers gnus-newsgroup-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
915 gnus-newsgroup-prepared gnus-summary-highlight-line-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
916 gnus-current-article gnus-current-headers gnus-have-all-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
917 gnus-last-article gnus-article-internal-prepare-hook
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
918 gnus-newsgroup-dependencies gnus-newsgroup-selected-overlay
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
919 gnus-newsgroup-scored gnus-newsgroup-kill-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
920 gnus-thread-expunge-below
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
921 gnus-score-alist gnus-current-score-file gnus-summary-expunge-below
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
922 (gnus-summary-mark-below . global)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
923 gnus-newsgroup-active gnus-scores-exclude-files
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
924 gnus-newsgroup-history gnus-newsgroup-ancient
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
925 gnus-newsgroup-sparse gnus-newsgroup-process-stack
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
926 (gnus-newsgroup-adaptive . gnus-use-adaptive-scoring)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
927 gnus-newsgroup-adaptive-score-file (gnus-reffed-article-number . -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
928 (gnus-newsgroup-expunged-tally . 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
929 gnus-cache-removable-articles gnus-newsgroup-cached
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
930 gnus-newsgroup-data gnus-newsgroup-data-reverse
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
931 gnus-newsgroup-limit gnus-newsgroup-limits)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
932 "Variables that are buffer-local to the summary buffers.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
933
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
934 ;; Byte-compiler warning.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
935 (defvar gnus-article-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
936
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
937 ;; Subject simplification.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
938
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
939 (defsubst gnus-simplify-subject-re (subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
940 "Remove \"Re:\" from subject lines."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
941 (if (string-match "^[Rr][Ee]: *" subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
942 (substring subject (match-end 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
943 subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
944
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
945 (defun gnus-simplify-subject (subject &optional re-only)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
946 "Remove `Re:' and words in parentheses.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
947 If RE-ONLY is non-nil, strip leading `Re:'s only."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
948 (let ((case-fold-search t)) ;Ignore case.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
949 ;; Remove `Re:', `Re^N:', `Re(n)', and `Re[n]:'.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
950 (when (string-match "\\`\\(re\\([[(^][0-9]+[])]?\\)?:[ \t]*\\)+" subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
951 (setq subject (substring subject (match-end 0))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
952 ;; Remove uninteresting prefixes.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
953 (when (and (not re-only)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
954 gnus-simplify-ignored-prefixes
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
955 (string-match gnus-simplify-ignored-prefixes subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
956 (setq subject (substring subject (match-end 0))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
957 ;; Remove words in parentheses from end.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
958 (unless re-only
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
959 (while (string-match "[ \t\n]*([^()]*)[ \t\n]*\\'" subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
960 (setq subject (substring subject 0 (match-beginning 0)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
961 ;; Return subject string.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
962 subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
963
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
964 ;; Remove any leading "re:"s, any trailing paren phrases, and simplify
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
965 ;; all whitespace.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
966 (defsubst gnus-simplify-buffer-fuzzy-step (regexp &optional newtext)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
967 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
968 (while (re-search-forward regexp nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
969 (replace-match (or newtext ""))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
970
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
971 (defun gnus-simplify-buffer-fuzzy ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
972 "Simplify string in the buffer fuzzily.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
973 The string in the accessible portion of the current buffer is simplified.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
974 It is assumed to be a single-line subject.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
975 Whitespace is generally cleaned up, and miscellaneous leading/trailing
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
976 matter is removed. Additional things can be deleted by setting
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
977 gnus-simplify-subject-fuzzy-regexp."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
978 (let ((case-fold-search t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
979 (modified-tick))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
980 (gnus-simplify-buffer-fuzzy-step "\t" " ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
981
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
982 (while (not (eq modified-tick (buffer-modified-tick)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
983 (setq modified-tick (buffer-modified-tick))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
984 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
985 ((listp gnus-simplify-subject-fuzzy-regexp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
986 (mapcar 'gnus-simplify-buffer-fuzzy-step
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
987 gnus-simplify-subject-fuzzy-regexp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
988 (gnus-simplify-subject-fuzzy-regexp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
989 (gnus-simplify-buffer-fuzzy-step gnus-simplify-subject-fuzzy-regexp)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
990 (gnus-simplify-buffer-fuzzy-step "^ *\\[[-+?*!][-+?*!]\\] *")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
991 (gnus-simplify-buffer-fuzzy-step
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
992 "^ *\\(re\\|fw\\|fwd\\)[[{(^0-9]*[])}]?[:;] *")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
993 (gnus-simplify-buffer-fuzzy-step "^[[].*:\\( .*\\)[]]$" "\\1"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
994
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
995 (gnus-simplify-buffer-fuzzy-step " *[[{(][^()\n]*[]})] *$")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
996 (gnus-simplify-buffer-fuzzy-step " +" " ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
997 (gnus-simplify-buffer-fuzzy-step " $")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
998 (gnus-simplify-buffer-fuzzy-step "^ +")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
999
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1000 (defun gnus-simplify-subject-fuzzy (subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1001 "Simplify a subject string fuzzily.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1002 See gnus-simplify-buffer-fuzzy for details."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1003 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1004 (gnus-set-work-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1005 (let ((case-fold-search t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1006 (insert subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1007 (inline (gnus-simplify-buffer-fuzzy))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1008 (buffer-string))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1009
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1010 (defsubst gnus-simplify-subject-fully (subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1011 "Simplify a subject string according to gnus-summary-gather-subject-limit."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1012 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1013 ((null gnus-summary-gather-subject-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1014 (gnus-simplify-subject-re subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1015 ((eq gnus-summary-gather-subject-limit 'fuzzy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1016 (gnus-simplify-subject-fuzzy subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1017 ((numberp gnus-summary-gather-subject-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1018 (gnus-limit-string (gnus-simplify-subject-re subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1019 gnus-summary-gather-subject-limit))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1020 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1021 subject)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1022
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1023 (defsubst gnus-subject-equal (s1 s2 &optional simple-first)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1024 "Check whether two subjects are equal. If optional argument
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1025 simple-first is t, first argument is already simplified."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1026 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1027 ((null simple-first)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1028 (equal (gnus-simplify-subject-fully s1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1029 (gnus-simplify-subject-fully s2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1030 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1031 (equal s1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1032 (gnus-simplify-subject-fully s2)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1033
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1034 (defun gnus-offer-save-summaries ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1035 "Offer to save all active summary buffers."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1036 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1037 (let ((buflist (buffer-list))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1038 buffers bufname)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1039 ;; Go through all buffers and find all summaries.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1040 (while buflist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1041 (and (setq bufname (buffer-name (car buflist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1042 (string-match "Summary" bufname)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1043 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1044 (set-buffer bufname)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1045 ;; We check that this is, indeed, a summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1046 (and (eq major-mode 'gnus-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1047 ;; Also make sure this isn't bogus.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1048 gnus-newsgroup-prepared))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1049 (push bufname buffers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1050 (setq buflist (cdr buflist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1051 ;; Go through all these summary buffers and offer to save them.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1052 (when buffers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1053 (map-y-or-n-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1054 "Update summary buffer %s? "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1055 (lambda (buf) (set-buffer buf) (gnus-summary-exit))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1056 buffers)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1057
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1058 (defun gnus-summary-bubble-group ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1059 "Increase the score of the current group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1060 This is a handy function to add to `gnus-summary-exit-hook' to
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1061 increase the score of each group you read."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1062 (gnus-group-add-score gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1063
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1064
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1065 ;;;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1066 ;;; Gnus summary mode
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1067 ;;;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1068
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1069 (put 'gnus-summary-mode 'mode-class 'special)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1070
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1071 (when t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1072 ;; Non-orthogonal keys
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1073
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1074 (gnus-define-keys gnus-summary-mode-map
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1075 " " gnus-summary-next-page
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1076 "\177" gnus-summary-prev-page
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1077 [delete] gnus-summary-prev-page
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1078 "\r" gnus-summary-scroll-up
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1079 "n" gnus-summary-next-unread-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1080 "p" gnus-summary-prev-unread-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1081 "N" gnus-summary-next-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1082 "P" gnus-summary-prev-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1083 "\M-\C-n" gnus-summary-next-same-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1084 "\M-\C-p" gnus-summary-prev-same-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1085 "\M-n" gnus-summary-next-unread-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1086 "\M-p" gnus-summary-prev-unread-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1087 "." gnus-summary-first-unread-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1088 "," gnus-summary-best-unread-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1089 "\M-s" gnus-summary-search-article-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1090 "\M-r" gnus-summary-search-article-backward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1091 "<" gnus-summary-beginning-of-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1092 ">" gnus-summary-end-of-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1093 "j" gnus-summary-goto-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1094 "^" gnus-summary-refer-parent-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1095 "\M-^" gnus-summary-refer-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1096 "u" gnus-summary-tick-article-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1097 "!" gnus-summary-tick-article-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1098 "U" gnus-summary-tick-article-backward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1099 "d" gnus-summary-mark-as-read-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1100 "D" gnus-summary-mark-as-read-backward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1101 "E" gnus-summary-mark-as-expirable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1102 "\M-u" gnus-summary-clear-mark-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1103 "\M-U" gnus-summary-clear-mark-backward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1104 "k" gnus-summary-kill-same-subject-and-select
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1105 "\C-k" gnus-summary-kill-same-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1106 "\M-\C-k" gnus-summary-kill-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1107 "\M-\C-l" gnus-summary-lower-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1108 "e" gnus-summary-edit-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1109 "#" gnus-summary-mark-as-processable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1110 "\M-#" gnus-summary-unmark-as-processable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1111 "\M-\C-t" gnus-summary-toggle-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1112 "\M-\C-s" gnus-summary-show-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1113 "\M-\C-h" gnus-summary-hide-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1114 "\M-\C-f" gnus-summary-next-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1115 "\M-\C-b" gnus-summary-prev-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1116 "\M-\C-u" gnus-summary-up-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1117 "\M-\C-d" gnus-summary-down-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1118 "&" gnus-summary-execute-command
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1119 "c" gnus-summary-catchup-and-exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1120 "\C-w" gnus-summary-mark-region-as-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1121 "\C-t" gnus-summary-toggle-truncation
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1122 "?" gnus-summary-mark-as-dormant
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1123 "\C-c\M-\C-s" gnus-summary-limit-include-expunged
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1124 "\C-c\C-s\C-n" gnus-summary-sort-by-number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1125 "\C-c\C-s\C-l" gnus-summary-sort-by-lines
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1126 "\C-c\C-s\C-a" gnus-summary-sort-by-author
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1127 "\C-c\C-s\C-s" gnus-summary-sort-by-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1128 "\C-c\C-s\C-d" gnus-summary-sort-by-date
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1129 "\C-c\C-s\C-i" gnus-summary-sort-by-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1130 "=" gnus-summary-expand-window
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1131 "\C-x\C-s" gnus-summary-reselect-current-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1132 "\M-g" gnus-summary-rescan-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1133 "w" gnus-summary-stop-page-breaking
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1134 "\C-c\C-r" gnus-summary-caesar-message
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1135 "\M-t" gnus-summary-toggle-mime
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1136 "f" gnus-summary-followup
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1137 "F" gnus-summary-followup-with-original
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1138 "C" gnus-summary-cancel-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1139 "r" gnus-summary-reply
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1140 "R" gnus-summary-reply-with-original
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1141 "\C-c\C-f" gnus-summary-mail-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1142 "o" gnus-summary-save-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1143 "\C-o" gnus-summary-save-article-mail
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1144 "|" gnus-summary-pipe-output
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1145 "\M-k" gnus-summary-edit-local-kill
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1146 "\M-K" gnus-summary-edit-global-kill
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1147 ;; "V" gnus-version
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1148 "\C-c\C-d" gnus-summary-describe-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1149 "q" gnus-summary-exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1150 "Q" gnus-summary-exit-no-update
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1151 "\C-c\C-i" gnus-info-find-node
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1152 gnus-mouse-2 gnus-mouse-pick-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1153 "m" gnus-summary-mail-other-window
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1154 "a" gnus-summary-post-news
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1155 "x" gnus-summary-limit-to-unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1156 "s" gnus-summary-isearch-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1157 "t" gnus-article-hide-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1158 "g" gnus-summary-show-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1159 "l" gnus-summary-goto-last-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1160 "\C-c\C-v\C-v" gnus-uu-decode-uu-view
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1161 "\C-d" gnus-summary-enter-digest-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1162 "\M-\C-d" gnus-summary-read-document
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1163 "\C-c\C-b" gnus-bug
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1164 "*" gnus-cache-enter-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1165 "\M-*" gnus-cache-remove-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1166 "\M-&" gnus-summary-universal-argument
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1167 "\C-l" gnus-recenter
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1168 "I" gnus-summary-increase-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1169 "L" gnus-summary-lower-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1170
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1171 "V" gnus-summary-score-map
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1172 "X" gnus-uu-extract-map
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1173 "S" gnus-summary-send-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1174
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1175 ;; Sort of orthogonal keymap
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1176 (gnus-define-keys (gnus-summary-mark-map "M" gnus-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1177 "t" gnus-summary-tick-article-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1178 "!" gnus-summary-tick-article-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1179 "d" gnus-summary-mark-as-read-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1180 "r" gnus-summary-mark-as-read-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1181 "c" gnus-summary-clear-mark-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1182 " " gnus-summary-clear-mark-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1183 "e" gnus-summary-mark-as-expirable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1184 "x" gnus-summary-mark-as-expirable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1185 "?" gnus-summary-mark-as-dormant
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1186 "b" gnus-summary-set-bookmark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1187 "B" gnus-summary-remove-bookmark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1188 "#" gnus-summary-mark-as-processable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1189 "\M-#" gnus-summary-unmark-as-processable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1190 "S" gnus-summary-limit-include-expunged
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1191 "C" gnus-summary-catchup
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1192 "H" gnus-summary-catchup-to-here
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1193 "\C-c" gnus-summary-catchup-all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1194 "k" gnus-summary-kill-same-subject-and-select
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1195 "K" gnus-summary-kill-same-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1196 "P" gnus-uu-mark-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1197
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1198 (gnus-define-keys (gnus-summary-mscore-map "V" gnus-summary-mark-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1199 "c" gnus-summary-clear-above
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1200 "u" gnus-summary-tick-above
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1201 "m" gnus-summary-mark-above
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1202 "k" gnus-summary-kill-below)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1203
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1204 (gnus-define-keys (gnus-summary-limit-map "/" gnus-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1205 "/" gnus-summary-limit-to-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1206 "n" gnus-summary-limit-to-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1207 "w" gnus-summary-pop-limit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1208 "s" gnus-summary-limit-to-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1209 "a" gnus-summary-limit-to-author
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1210 "u" gnus-summary-limit-to-unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1211 "m" gnus-summary-limit-to-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1212 "v" gnus-summary-limit-to-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1213 "D" gnus-summary-limit-include-dormant
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1214 "d" gnus-summary-limit-exclude-dormant
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1215 "t" gnus-summary-limit-to-age
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1216 "E" gnus-summary-limit-include-expunged
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1217 "c" gnus-summary-limit-exclude-childless-dormant
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1218 "C" gnus-summary-limit-mark-excluded-as-read)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1219
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1220 (gnus-define-keys (gnus-summary-goto-map "G" gnus-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1221 "n" gnus-summary-next-unread-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1222 "p" gnus-summary-prev-unread-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1223 "N" gnus-summary-next-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1224 "P" gnus-summary-prev-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1225 "\C-n" gnus-summary-next-same-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1226 "\C-p" gnus-summary-prev-same-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1227 "\M-n" gnus-summary-next-unread-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1228 "\M-p" gnus-summary-prev-unread-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1229 "f" gnus-summary-first-unread-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1230 "b" gnus-summary-best-unread-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1231 "j" gnus-summary-goto-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1232 "g" gnus-summary-goto-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1233 "l" gnus-summary-goto-last-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1234 "p" gnus-summary-pop-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1235
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1236 (gnus-define-keys (gnus-summary-thread-map "T" gnus-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1237 "k" gnus-summary-kill-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1238 "l" gnus-summary-lower-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1239 "i" gnus-summary-raise-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1240 "T" gnus-summary-toggle-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1241 "t" gnus-summary-rethread-current
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1242 "^" gnus-summary-reparent-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1243 "s" gnus-summary-show-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1244 "S" gnus-summary-show-all-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1245 "h" gnus-summary-hide-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1246 "H" gnus-summary-hide-all-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1247 "n" gnus-summary-next-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1248 "p" gnus-summary-prev-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1249 "u" gnus-summary-up-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1250 "o" gnus-summary-top-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1251 "d" gnus-summary-down-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1252 "#" gnus-uu-mark-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1253 "\M-#" gnus-uu-unmark-thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1254
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1255 (gnus-define-keys (gnus-summary-buffer-map "Y" gnus-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1256 "g" gnus-summary-prepare
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1257 "c" gnus-summary-insert-cached-articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1258
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1259 (gnus-define-keys (gnus-summary-exit-map "Z" gnus-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1260 "c" gnus-summary-catchup-and-exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1261 "C" gnus-summary-catchup-all-and-exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1262 "E" gnus-summary-exit-no-update
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1263 "Q" gnus-summary-exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1264 "Z" gnus-summary-exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1265 "n" gnus-summary-catchup-and-goto-next-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1266 "R" gnus-summary-reselect-current-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1267 "G" gnus-summary-rescan-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1268 "N" gnus-summary-next-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1269 "s" gnus-summary-save-newsrc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1270 "P" gnus-summary-prev-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1271
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1272 (gnus-define-keys (gnus-summary-article-map "A" gnus-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1273 " " gnus-summary-next-page
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1274 "n" gnus-summary-next-page
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1275 "\177" gnus-summary-prev-page
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1276 [delete] gnus-summary-prev-page
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1277 "p" gnus-summary-prev-page
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1278 "\r" gnus-summary-scroll-up
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1279 "<" gnus-summary-beginning-of-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1280 ">" gnus-summary-end-of-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1281 "b" gnus-summary-beginning-of-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1282 "e" gnus-summary-end-of-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1283 "^" gnus-summary-refer-parent-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1284 "r" gnus-summary-refer-parent-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1285 "R" gnus-summary-refer-references
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1286 "g" gnus-summary-show-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1287 "s" gnus-summary-isearch-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1288 "P" gnus-summary-print-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1289
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1290 (gnus-define-keys (gnus-summary-wash-map "W" gnus-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1291 "b" gnus-article-add-buttons
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1292 "B" gnus-article-add-buttons-to-head
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1293 "o" gnus-article-treat-overstrike
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1294 "e" gnus-article-emphasize
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1295 "w" gnus-article-fill-cited-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1296 "c" gnus-article-remove-cr
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1297 "q" gnus-article-de-quoted-unreadable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1298 "f" gnus-article-display-x-face
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1299 "l" gnus-summary-stop-page-breaking
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1300 "r" gnus-summary-caesar-message
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1301 "t" gnus-article-hide-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1302 "v" gnus-summary-verbose-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1303 "m" gnus-summary-toggle-mime)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1304
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1305 (gnus-define-keys (gnus-summary-wash-hide-map "W" gnus-summary-wash-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1306 "a" gnus-article-hide
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1307 "h" gnus-article-hide-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1308 "b" gnus-article-hide-boring-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1309 "s" gnus-article-hide-signature
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1310 "c" gnus-article-hide-citation
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1311 "p" gnus-article-hide-pgp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1312 "P" gnus-article-hide-pem
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1313 "\C-c" gnus-article-hide-citation-maybe)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1314
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1315 (gnus-define-keys (gnus-summary-wash-highlight-map "H" gnus-summary-wash-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1316 "a" gnus-article-highlight
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1317 "h" gnus-article-highlight-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1318 "c" gnus-article-highlight-citation
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1319 "s" gnus-article-highlight-signature)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1320
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1321 (gnus-define-keys (gnus-summary-wash-time-map "T" gnus-summary-wash-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1322 "z" gnus-article-date-ut
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1323 "u" gnus-article-date-ut
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1324 "l" gnus-article-date-local
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1325 "e" gnus-article-date-lapsed
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1326 "o" gnus-article-date-original
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1327 "s" gnus-article-date-user)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1328
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1329 (gnus-define-keys (gnus-summary-wash-empty-map "E" gnus-summary-wash-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1330 "t" gnus-article-remove-trailing-blank-lines
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1331 "l" gnus-article-strip-leading-blank-lines
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1332 "m" gnus-article-strip-multiple-blank-lines
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1333 "a" gnus-article-strip-blank-lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1334
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1335 (gnus-define-keys (gnus-summary-help-map "H" gnus-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1336 "v" gnus-version
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1337 "f" gnus-summary-fetch-faq
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1338 "d" gnus-summary-describe-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1339 "h" gnus-summary-describe-briefly
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1340 "i" gnus-info-find-node)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1341
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1342 (gnus-define-keys (gnus-summary-backend-map "B" gnus-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1343 "e" gnus-summary-expire-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1344 "\M-\C-e" gnus-summary-expire-articles-now
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1345 "\177" gnus-summary-delete-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1346 [delete] gnus-summary-delete-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1347 "m" gnus-summary-move-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1348 "r" gnus-summary-respool-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1349 "w" gnus-summary-edit-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1350 "c" gnus-summary-copy-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1351 "B" gnus-summary-crosspost-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1352 "q" gnus-summary-respool-query
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1353 "i" gnus-summary-import-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1354 "p" gnus-summary-article-posted-p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1355
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1356 (gnus-define-keys (gnus-summary-save-map "O" gnus-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1357 "o" gnus-summary-save-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1358 "m" gnus-summary-save-article-mail
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1359 "F" gnus-summary-write-article-file
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1360 "r" gnus-summary-save-article-rmail
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1361 "f" gnus-summary-save-article-file
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1362 "b" gnus-summary-save-article-body-file
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1363 "h" gnus-summary-save-article-folder
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1364 "v" gnus-summary-save-article-vm
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1365 "p" gnus-summary-pipe-output
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1366 "s" gnus-soup-add-article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1367
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1368 (defun gnus-summary-make-menu-bar ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1369 (gnus-turn-off-edit-menu 'summary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1370
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1371 (unless (boundp 'gnus-summary-misc-menu)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1372
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1373 (easy-menu-define
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1374 gnus-summary-kill-menu gnus-summary-mode-map ""
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1375 (cons
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1376 "Score"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1377 (nconc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1378 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1379 ["Enter score..." gnus-summary-score-entry t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1380 ["Customize" gnus-score-customize t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1381 (gnus-make-score-map 'increase)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1382 (gnus-make-score-map 'lower)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1383 '(("Mark"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1384 ["Kill below" gnus-summary-kill-below t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1385 ["Mark above" gnus-summary-mark-above t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1386 ["Tick above" gnus-summary-tick-above t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1387 ["Clear above" gnus-summary-clear-above t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1388 ["Current score" gnus-summary-current-score t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1389 ["Set score" gnus-summary-set-score t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1390 ["Switch current score file..." gnus-score-change-score-file t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1391 ["Set mark below..." gnus-score-set-mark-below t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1392 ["Set expunge below..." gnus-score-set-expunge-below t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1393 ["Edit current score file" gnus-score-edit-current-scores t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1394 ["Edit score file" gnus-score-edit-file t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1395 ["Trace score" gnus-score-find-trace t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1396 ["Find words" gnus-score-find-favourite-words t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1397 ["Rescore buffer" gnus-summary-rescore t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1398 ["Increase score..." gnus-summary-increase-score t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1399 ["Lower score..." gnus-summary-lower-score t]))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1400
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1401 '(("Default header"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1402 ["Ask" (gnus-score-set-default 'gnus-score-default-header nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1403 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1404 :selected (null gnus-score-default-header)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1405 ["From" (gnus-score-set-default 'gnus-score-default-header 'a)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1406 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1407 :selected (eq gnus-score-default-header 'a)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1408 ["Subject" (gnus-score-set-default 'gnus-score-default-header 's)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1409 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1410 :selected (eq gnus-score-default-header 's)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1411 ["Article body"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1412 (gnus-score-set-default 'gnus-score-default-header 'b)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1413 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1414 :selected (eq gnus-score-default-header 'b )]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1415 ["All headers"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1416 (gnus-score-set-default 'gnus-score-default-header 'h)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1417 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1418 :selected (eq gnus-score-default-header 'h )]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1419 ["Message-ID" (gnus-score-set-default 'gnus-score-default-header 'i)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1420 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1421 :selected (eq gnus-score-default-header 'i )]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1422 ["Thread" (gnus-score-set-default 'gnus-score-default-header 't)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1423 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1424 :selected (eq gnus-score-default-header 't )]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1425 ["Crossposting"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1426 (gnus-score-set-default 'gnus-score-default-header 'x)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1427 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1428 :selected (eq gnus-score-default-header 'x )]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1429 ["Lines" (gnus-score-set-default 'gnus-score-default-header 'l)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1430 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1431 :selected (eq gnus-score-default-header 'l )]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1432 ["Date" (gnus-score-set-default 'gnus-score-default-header 'd)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1433 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1434 :selected (eq gnus-score-default-header 'd )]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1435 ["Followups to author"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1436 (gnus-score-set-default 'gnus-score-default-header 'f)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1437 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1438 :selected (eq gnus-score-default-header 'f )])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1439 ("Default type"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1440 ["Ask" (gnus-score-set-default 'gnus-score-default-type nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1441 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1442 :selected (null gnus-score-default-type)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1443 ;; The `:active' key is commented out in the following,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1444 ;; because the GNU Emacs hack to support radio buttons use
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1445 ;; active to indicate which button is selected.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1446 ["Substring" (gnus-score-set-default 'gnus-score-default-type 's)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1447 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1448 ;; :active (not (memq gnus-score-default-header '(l d)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1449 :selected (eq gnus-score-default-type 's)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1450 ["Regexp" (gnus-score-set-default 'gnus-score-default-type 'r)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1451 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1452 ;; :active (not (memq gnus-score-default-header '(l d)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1453 :selected (eq gnus-score-default-type 'r)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1454 ["Exact" (gnus-score-set-default 'gnus-score-default-type 'e)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1455 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1456 ;; :active (not (memq gnus-score-default-header '(l d)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1457 :selected (eq gnus-score-default-type 'e)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1458 ["Fuzzy" (gnus-score-set-default 'gnus-score-default-type 'f)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1459 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1460 ;; :active (not (memq gnus-score-default-header '(l d)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1461 :selected (eq gnus-score-default-type 'f)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1462 ["Before date" (gnus-score-set-default 'gnus-score-default-type 'b)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1463 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1464 ;; :active (eq (gnus-score-default-header 'd))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1465 :selected (eq gnus-score-default-type 'b)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1466 ["At date" (gnus-score-set-default 'gnus-score-default-type 'n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1467 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1468 ;; :active (eq (gnus-score-default-header 'd))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1469 :selected (eq gnus-score-default-type 'n)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1470 ["After date" (gnus-score-set-default 'gnus-score-default-type 'a)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1471 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1472 ;; :active (eq (gnus-score-default-header 'd))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1473 :selected (eq gnus-score-default-type 'a)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1474 ["Less than number"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1475 (gnus-score-set-default 'gnus-score-default-type '<)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1476 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1477 ;; :active (eq (gnus-score-default-header 'l))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1478 :selected (eq gnus-score-default-type '<)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1479 ["Equal to number"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1480 (gnus-score-set-default 'gnus-score-default-type '=)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1481 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1482 ;; :active (eq (gnus-score-default-header 'l))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1483 :selected (eq gnus-score-default-type '=)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1484 ["Greater than number"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1485 (gnus-score-set-default 'gnus-score-default-type '>)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1486 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1487 ;; :active (eq (gnus-score-default-header 'l))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1488 :selected (eq gnus-score-default-type '>)])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1489 ["Default fold" gnus-score-default-fold-toggle
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1490 :style toggle
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1491 :selected gnus-score-default-fold]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1492 ("Default duration"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1493 ["Ask" (gnus-score-set-default 'gnus-score-default-duration nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1494 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1495 :selected (null gnus-score-default-duration)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1496 ["Permanent"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1497 (gnus-score-set-default 'gnus-score-default-duration 'p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1498 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1499 :selected (eq gnus-score-default-duration 'p)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1500 ["Temporary"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1501 (gnus-score-set-default 'gnus-score-default-duration 't)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1502 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1503 :selected (eq gnus-score-default-duration 't)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1504 ["Immediate"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1505 (gnus-score-set-default 'gnus-score-default-duration 'i)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1506 :style radio
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1507 :selected (eq gnus-score-default-duration 'i)]))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1508
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1509 (easy-menu-define
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1510 gnus-summary-article-menu gnus-summary-mode-map ""
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1511 '("Article"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1512 ("Hide"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1513 ["All" gnus-article-hide t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1514 ["Headers" gnus-article-hide-headers t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1515 ["Signature" gnus-article-hide-signature t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1516 ["Citation" gnus-article-hide-citation t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1517 ["PGP" gnus-article-hide-pgp t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1518 ["Boring headers" gnus-article-hide-boring-headers t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1519 ("Highlight"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1520 ["All" gnus-article-highlight t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1521 ["Headers" gnus-article-highlight-headers t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1522 ["Signature" gnus-article-highlight-signature t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1523 ["Citation" gnus-article-highlight-citation t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1524 ("Date"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1525 ["Local" gnus-article-date-local t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1526 ["UT" gnus-article-date-ut t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1527 ["Original" gnus-article-date-original t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1528 ["Lapsed" gnus-article-date-lapsed t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1529 ["User-defined" gnus-article-date-user t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1530 ("Washing"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1531 ("Remove Blanks"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1532 ["Leading" gnus-article-strip-leading-blank-lines t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1533 ["Multiple" gnus-article-strip-multiple-blank-lines t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1534 ["Trailing" gnus-article-remove-trailing-blank-lines t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1535 ["All of the above" gnus-article-strip-blank-lines t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1536 ["Overstrike" gnus-article-treat-overstrike t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1537 ["Emphasis" gnus-article-emphasize t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1538 ["Word wrap" gnus-article-fill-cited-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1539 ["CR" gnus-article-remove-cr t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1540 ["Show X-Face" gnus-article-display-x-face t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1541 ["Quoted-Printable" gnus-article-de-quoted-unreadable t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1542 ["Rot 13" gnus-summary-caesar-message t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1543 ["Unix pipe" gnus-summary-pipe-message t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1544 ["Add buttons" gnus-article-add-buttons t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1545 ["Add buttons to head" gnus-article-add-buttons-to-head t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1546 ["Stop page breaking" gnus-summary-stop-page-breaking t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1547 ["Toggle MIME" gnus-summary-toggle-mime t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1548 ["Verbose header" gnus-summary-verbose-headers t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1549 ["Toggle header" gnus-summary-toggle-header t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1550 ("Output"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1551 ["Save in default format" gnus-summary-save-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1552 ["Save in file" gnus-summary-save-article-file t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1553 ["Save in Unix mail format" gnus-summary-save-article-mail t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1554 ["Write to file" gnus-summary-write-article-mail t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1555 ["Save in MH folder" gnus-summary-save-article-folder t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1556 ["Save in VM folder" gnus-summary-save-article-vm t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1557 ["Save in RMAIL mbox" gnus-summary-save-article-rmail t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1558 ["Save body in file" gnus-summary-save-article-body-file t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1559 ["Pipe through a filter" gnus-summary-pipe-output t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1560 ["Add to SOUP packet" gnus-soup-add-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1561 ["Print" gnus-summary-print-article t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1562 ("Backend"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1563 ["Respool article..." gnus-summary-respool-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1564 ["Move article..." gnus-summary-move-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1565 (gnus-check-backend-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1566 'request-move-article gnus-newsgroup-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1567 ["Copy article..." gnus-summary-copy-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1568 ["Crosspost article..." gnus-summary-crosspost-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1569 (gnus-check-backend-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1570 'request-replace-article gnus-newsgroup-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1571 ["Import file..." gnus-summary-import-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1572 ["Check if posted" gnus-summary-article-posted-p t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1573 ["Edit article" gnus-summary-edit-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1574 (not (gnus-group-read-only-p))]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1575 ["Delete article" gnus-summary-delete-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1576 (gnus-check-backend-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1577 'request-expire-articles gnus-newsgroup-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1578 ["Query respool" gnus-summary-respool-query t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1579 ["Delete expirable articles" gnus-summary-expire-articles-now
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1580 (gnus-check-backend-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1581 'request-expire-articles gnus-newsgroup-name)])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1582 ("Extract"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1583 ["Uudecode" gnus-uu-decode-uu t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1584 ["Uudecode and save" gnus-uu-decode-uu-and-save t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1585 ["Unshar" gnus-uu-decode-unshar t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1586 ["Unshar and save" gnus-uu-decode-unshar-and-save t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1587 ["Save" gnus-uu-decode-save t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1588 ["Binhex" gnus-uu-decode-binhex t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1589 ["Postscript" gnus-uu-decode-postscript t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1590 ("Cache"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1591 ["Enter article" gnus-cache-enter-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1592 ["Remove article" gnus-cache-remove-article t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1593 ["Enter digest buffer" gnus-summary-enter-digest-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1594 ["Isearch article..." gnus-summary-isearch-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1595 ["Beginning of the article" gnus-summary-beginning-of-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1596 ["End of the article" gnus-summary-end-of-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1597 ["Fetch parent of article" gnus-summary-refer-parent-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1598 ["Fetch referenced articles" gnus-summary-refer-references t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1599 ["Fetch article with id..." gnus-summary-refer-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1600 ["Redisplay" gnus-summary-show-article t]))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1601
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1602 (easy-menu-define
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1603 gnus-summary-thread-menu gnus-summary-mode-map ""
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1604 '("Threads"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1605 ["Toggle threading" gnus-summary-toggle-threads t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1606 ["Hide threads" gnus-summary-hide-all-threads t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1607 ["Show threads" gnus-summary-show-all-threads t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1608 ["Hide thread" gnus-summary-hide-thread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1609 ["Show thread" gnus-summary-show-thread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1610 ["Go to next thread" gnus-summary-next-thread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1611 ["Go to previous thread" gnus-summary-prev-thread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1612 ["Go down thread" gnus-summary-down-thread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1613 ["Go up thread" gnus-summary-up-thread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1614 ["Top of thread" gnus-summary-top-thread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1615 ["Mark thread as read" gnus-summary-kill-thread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1616 ["Lower thread score" gnus-summary-lower-thread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1617 ["Raise thread score" gnus-summary-raise-thread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1618 ["Rethread current" gnus-summary-rethread-current t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1619 ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1620
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1621 (easy-menu-define
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1622 gnus-summary-post-menu gnus-summary-mode-map ""
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1623 '("Post"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1624 ["Post an article" gnus-summary-post-news t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1625 ["Followup" gnus-summary-followup t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1626 ["Followup and yank" gnus-summary-followup-with-original t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1627 ["Supersede article" gnus-summary-supersede-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1628 ["Cancel article" gnus-summary-cancel-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1629 ["Reply" gnus-summary-reply t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1630 ["Reply and yank" gnus-summary-reply-with-original t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1631 ["Wide reply" gnus-summary-wide-reply t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1632 ["Wide reply and yank" gnus-summary-wide-reply-with-original t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1633 ["Mail forward" gnus-summary-mail-forward t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1634 ["Post forward" gnus-summary-post-forward t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1635 ["Digest and mail" gnus-uu-digest-mail-forward t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1636 ["Digest and post" gnus-uu-digest-post-forward t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1637 ["Resend message" gnus-summary-resend-message t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1638 ["Send bounced mail" gnus-summary-resend-bounced-mail t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1639 ["Send a mail" gnus-summary-mail-other-window t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1640 ["Uuencode and post" gnus-uu-post-news t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1641 ["Followup via news" gnus-summary-followup-to-mail t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1642 ["Followup via news and yank"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1643 gnus-summary-followup-to-mail-with-original t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1644 ;;("Draft"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1645 ;;["Send" gnus-summary-send-draft t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1646 ;;["Send bounced" gnus-resend-bounced-mail t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1647 ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1648
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1649 (easy-menu-define
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1650 gnus-summary-misc-menu gnus-summary-mode-map ""
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1651 '("Misc"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1652 ("Mark Read"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1653 ["Mark as read" gnus-summary-mark-as-read-forward t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1654 ["Mark same subject and select"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1655 gnus-summary-kill-same-subject-and-select t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1656 ["Mark same subject" gnus-summary-kill-same-subject t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1657 ["Catchup" gnus-summary-catchup t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1658 ["Catchup all" gnus-summary-catchup-all t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1659 ["Catchup to here" gnus-summary-catchup-to-here t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1660 ["Catchup region" gnus-summary-mark-region-as-read t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1661 ["Mark excluded" gnus-summary-limit-mark-excluded-as-read t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1662 ("Mark Various"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1663 ["Tick" gnus-summary-tick-article-forward t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1664 ["Mark as dormant" gnus-summary-mark-as-dormant t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1665 ["Remove marks" gnus-summary-clear-mark-forward t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1666 ["Set expirable mark" gnus-summary-mark-as-expirable t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1667 ["Set bookmark" gnus-summary-set-bookmark t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1668 ["Remove bookmark" gnus-summary-remove-bookmark t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1669 ("Mark Limit"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1670 ["Marks..." gnus-summary-limit-to-marks t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1671 ["Subject..." gnus-summary-limit-to-subject t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1672 ["Author..." gnus-summary-limit-to-author t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1673 ["Age..." gnus-summary-limit-to-age t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1674 ["Score" gnus-summary-limit-to-score t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1675 ["Unread" gnus-summary-limit-to-unread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1676 ["Non-dormant" gnus-summary-limit-exclude-dormant t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1677 ["Articles" gnus-summary-limit-to-articles t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1678 ["Pop limit" gnus-summary-pop-limit t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1679 ["Show dormant" gnus-summary-limit-include-dormant t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1680 ["Hide childless dormant"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1681 gnus-summary-limit-exclude-childless-dormant t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1682 ;;["Hide thread" gnus-summary-limit-exclude-thread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1683 ["Show expunged" gnus-summary-show-all-expunged t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1684 ("Process Mark"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1685 ["Set mark" gnus-summary-mark-as-processable t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1686 ["Remove mark" gnus-summary-unmark-as-processable t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1687 ["Remove all marks" gnus-summary-unmark-all-processable t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1688 ["Mark above" gnus-uu-mark-over t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1689 ["Mark series" gnus-uu-mark-series t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1690 ["Mark region" gnus-uu-mark-region t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1691 ["Mark by regexp..." gnus-uu-mark-by-regexp t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1692 ["Mark all" gnus-uu-mark-all t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1693 ["Mark buffer" gnus-uu-mark-buffer t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1694 ["Mark sparse" gnus-uu-mark-sparse t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1695 ["Mark thread" gnus-uu-mark-thread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1696 ["Unmark thread" gnus-uu-unmark-thread t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1697 ("Process Mark Sets"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1698 ["Kill" gnus-summary-kill-process-mark t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1699 ["Yank" gnus-summary-yank-process-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1700 gnus-newsgroup-process-stack]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1701 ["Save" gnus-summary-save-process-mark t]))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1702 ("Scroll article"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1703 ["Page forward" gnus-summary-next-page t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1704 ["Page backward" gnus-summary-prev-page t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1705 ["Line forward" gnus-summary-scroll-up t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1706 ("Move"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1707 ["Next unread article" gnus-summary-next-unread-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1708 ["Previous unread article" gnus-summary-prev-unread-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1709 ["Next article" gnus-summary-next-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1710 ["Previous article" gnus-summary-prev-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1711 ["Next unread subject" gnus-summary-next-unread-subject t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1712 ["Previous unread subject" gnus-summary-prev-unread-subject t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1713 ["Next article same subject" gnus-summary-next-same-subject t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1714 ["Previous article same subject" gnus-summary-prev-same-subject t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1715 ["First unread article" gnus-summary-first-unread-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1716 ["Best unread article" gnus-summary-best-unread-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1717 ["Go to subject number..." gnus-summary-goto-subject t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1718 ["Go to article number..." gnus-summary-goto-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1719 ["Go to the last article" gnus-summary-goto-last-article t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1720 ["Pop article off history" gnus-summary-pop-article t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1721 ("Sort"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1722 ["Sort by number" gnus-summary-sort-by-number t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1723 ["Sort by author" gnus-summary-sort-by-author t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1724 ["Sort by subject" gnus-summary-sort-by-subject t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1725 ["Sort by date" gnus-summary-sort-by-date t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1726 ["Sort by score" gnus-summary-sort-by-score t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1727 ["Sort by lines" gnus-summary-sort-by-lines t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1728 ("Help"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1729 ["Fetch group FAQ" gnus-summary-fetch-faq t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1730 ["Describe group" gnus-summary-describe-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1731 ["Read manual" gnus-info-find-node t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1732 ("Modes"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1733 ["Pick and read" gnus-pick-mode t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1734 ["Binary" gnus-binary-mode t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1735 ("Regeneration"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1736 ["Regenerate" gnus-summary-prepare t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1737 ["Insert cached articles" gnus-summary-insert-cached-articles t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1738 ["Toggle threading" gnus-summary-toggle-threads t])
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1739 ["Filter articles..." gnus-summary-execute-command t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1740 ["Run command on subjects..." gnus-summary-universal-argument t]
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
1741 ["Search articles forward..." gnus-summary-search-article-forward t]
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
1742 ["Search articles backward..." gnus-summary-search-article-backward t]
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1743 ["Toggle line truncation" gnus-summary-toggle-truncation t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1744 ["Expand window" gnus-summary-expand-window t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1745 ["Expire expirable articles" gnus-summary-expire-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1746 (gnus-check-backend-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1747 'request-expire-articles gnus-newsgroup-name)]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1748 ["Edit local kill file" gnus-summary-edit-local-kill t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1749 ["Edit main kill file" gnus-summary-edit-global-kill t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1750 ("Exit"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1751 ["Catchup and exit" gnus-summary-catchup-and-exit t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1752 ["Catchup all and exit" gnus-summary-catchup-and-exit t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1753 ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1754 ["Exit group" gnus-summary-exit t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1755 ["Exit group without updating" gnus-summary-exit-no-update t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1756 ["Exit and goto next group" gnus-summary-next-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1757 ["Exit and goto prev group" gnus-summary-prev-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1758 ["Reselect group" gnus-summary-reselect-current-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1759 ["Rescan group" gnus-summary-rescan-group t]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1760 ["Update dribble" gnus-summary-save-newsrc t])))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1761
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1762 (run-hooks 'gnus-summary-menu-hook)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1763
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1764 (defun gnus-score-set-default (var value)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1765 "A version of set that updates the GNU Emacs menu-bar."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1766 (set var value)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1767 ;; It is the message that forces the active status to be updated.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1768 (message ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1769
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1770 (defun gnus-make-score-map (type)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1771 "Make a summary score map of type TYPE."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1772 (if t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1773 nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1774 (let ((headers '(("author" "from" string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1775 ("subject" "subject" string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1776 ("article body" "body" string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1777 ("article head" "head" string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1778 ("xref" "xref" string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1779 ("lines" "lines" number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1780 ("followups to author" "followup" string)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1781 (types '((number ("less than" <)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1782 ("greater than" >)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1783 ("equal" =))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1784 (string ("substring" s)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1785 ("exact string" e)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1786 ("fuzzy string" f)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1787 ("regexp" r))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1788 (perms '(("temporary" (current-time-string))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1789 ("permanent" nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1790 ("immediate" now)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1791 header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1792 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1793 (apply
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1794 'nconc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1795 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1796 (if (eq type 'lower)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1797 "Lower score"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1798 "Increase score"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1799 (let (outh)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1800 (while headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1801 (setq header (car headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1802 (setq outh
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1803 (cons
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1804 (apply
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1805 'nconc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1806 (list (car header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1807 (let ((ts (cdr (assoc (nth 2 header) types)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1808 outt)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1809 (while ts
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1810 (setq outt
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1811 (cons
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1812 (apply
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1813 'nconc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1814 (list (caar ts))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1815 (let ((ps perms)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1816 outp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1817 (while ps
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1818 (setq outp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1819 (cons
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1820 (vector
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1821 (caar ps)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1822 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1823 'gnus-summary-score-entry
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1824 (nth 1 header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1825 (if (or (string= (nth 1 header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1826 "head")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1827 (string= (nth 1 header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1828 "body"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1829 ""
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1830 (list 'gnus-summary-header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1831 (nth 1 header)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1832 (list 'quote (nth 1 (car ts)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1833 (list 'gnus-score-default nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1834 (nth 1 (car ps))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1835 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1836 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1837 outp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1838 (setq ps (cdr ps)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1839 (list (nreverse outp))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1840 outt))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1841 (setq ts (cdr ts)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1842 (list (nreverse outt))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1843 outh))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1844 (setq headers (cdr headers)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1845 (list (nreverse outh))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1846
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1847
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1848
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1849 (defun gnus-summary-mode (&optional group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1850 "Major mode for reading articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1851
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1852 All normal editing commands are switched off.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1853 \\<gnus-summary-mode-map>
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1854 Each line in this buffer represents one article. To read an
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1855 article, you can, for instance, type `\\[gnus-summary-next-page]'. To move forwards
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1856 and backwards while displaying articles, type `\\[gnus-summary-next-unread-article]' and `\\[gnus-summary-prev-unread-article]',
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1857 respectively.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1858
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1859 You can also post articles and send mail from this buffer. To
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1860 follow up an article, type `\\[gnus-summary-followup]'. To mail a reply to the author
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1861 of an article, type `\\[gnus-summary-reply]'.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1862
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1863 There are approx. one gazillion commands you can execute in this
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1864 buffer; read the info pages for more information (`\\[gnus-info-find-node]').
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1865
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1866 The following commands are available:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1867
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1868 \\{gnus-summary-mode-map}"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1869 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1870 (when (gnus-visual-p 'summary-menu 'menu)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1871 (gnus-summary-make-menu-bar))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1872 (kill-all-local-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1873 (gnus-summary-make-local-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1874 (gnus-make-thread-indent-array)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1875 (gnus-simplify-mode-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1876 (setq major-mode 'gnus-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1877 (setq mode-name "Summary")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1878 (make-local-variable 'minor-mode-alist)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1879 (use-local-map gnus-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1880 (buffer-disable-undo (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1881 (setq buffer-read-only t) ;Disable modification
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1882 (setq truncate-lines t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1883 (setq selective-display t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1884 (setq selective-display-ellipses t) ;Display `...'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1885 (setq buffer-display-table gnus-summary-display-table)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1886 (gnus-set-default-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1887 (setq gnus-newsgroup-name group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1888 (make-local-variable 'gnus-summary-line-format)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1889 (make-local-variable 'gnus-summary-line-format-spec)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1890 (make-local-variable 'gnus-summary-mark-positions)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1891 (gnus-make-local-hook 'post-command-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1892 (gnus-add-hook 'post-command-hook 'gnus-clear-inboxes-moved nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1893 (run-hooks 'gnus-summary-mode-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1894 (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1895 (gnus-update-summary-mark-positions))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1896
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1897 (defun gnus-summary-make-local-variables ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1898 "Make all the local summary buffer variables."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1899 (let ((locals gnus-summary-local-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1900 global local)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1901 (while (setq local (pop locals))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1902 (if (consp local)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1903 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1904 (if (eq (cdr local) 'global)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1905 ;; Copy the global value of the variable.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1906 (setq global (symbol-value (car local)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1907 ;; Use the value from the list.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1908 (setq global (eval (cdr local))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1909 (make-local-variable (car local))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1910 (set (car local) global))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1911 ;; Simple nil-valued local variable.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1912 (make-local-variable local)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1913 (set local nil)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1914
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1915 (defun gnus-summary-clear-local-variables ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1916 (let ((locals gnus-summary-local-variables))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1917 (while locals
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1918 (if (consp (car locals))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1919 (and (vectorp (caar locals))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1920 (set (caar locals) nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1921 (and (vectorp (car locals))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1922 (set (car locals) nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1923 (setq locals (cdr locals)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1924
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1925 ;; Summary data functions.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1926
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1927 (defmacro gnus-data-number (data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1928 `(car ,data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1929
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1930 (defmacro gnus-data-set-number (data number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1931 `(setcar ,data ,number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1932
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1933 (defmacro gnus-data-mark (data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1934 `(nth 1 ,data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1935
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1936 (defmacro gnus-data-set-mark (data mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1937 `(setcar (nthcdr 1 ,data) ,mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1938
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1939 (defmacro gnus-data-pos (data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1940 `(nth 2 ,data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1941
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1942 (defmacro gnus-data-set-pos (data pos)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1943 `(setcar (nthcdr 2 ,data) ,pos))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1944
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1945 (defmacro gnus-data-header (data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1946 `(nth 3 ,data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1947
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
1948 (defmacro gnus-data-set-header (data header)
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
1949 `(setf (nth 3 ,data) ,header))
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
1950
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1951 (defmacro gnus-data-level (data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1952 `(nth 4 ,data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1953
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1954 (defmacro gnus-data-unread-p (data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1955 `(= (nth 1 ,data) gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1956
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1957 (defmacro gnus-data-read-p (data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1958 `(/= (nth 1 ,data) gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1959
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1960 (defmacro gnus-data-pseudo-p (data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1961 `(consp (nth 3 ,data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1962
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1963 (defmacro gnus-data-find (number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1964 `(assq ,number gnus-newsgroup-data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1965
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1966 (defmacro gnus-data-find-list (number &optional data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1967 `(let ((bdata ,(or data 'gnus-newsgroup-data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1968 (memq (assq ,number bdata)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1969 bdata)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1970
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1971 (defmacro gnus-data-make (number mark pos header level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1972 `(list ,number ,mark ,pos ,header ,level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1973
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1974 (defun gnus-data-enter (after-article number mark pos header level offset)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1975 (let ((data (gnus-data-find-list after-article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1976 (unless data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1977 (error "No such article: %d" after-article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1978 (setcdr data (cons (gnus-data-make number mark pos header level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1979 (cdr data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1980 (setq gnus-newsgroup-data-reverse nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1981 (gnus-data-update-list (cddr data) offset)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1982
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1983 (defun gnus-data-enter-list (after-article list &optional offset)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1984 (when list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1985 (let ((data (and after-article (gnus-data-find-list after-article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1986 (ilist list))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1987 (or data (not after-article) (error "No such article: %d" after-article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1988 ;; Find the last element in the list to be spliced into the main
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1989 ;; list.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1990 (while (cdr list)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1991 (setq list (cdr list)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1992 (if (not data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1993 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1994 (setcdr list gnus-newsgroup-data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1995 (setq gnus-newsgroup-data ilist)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1996 (when offset
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1997 (gnus-data-update-list (cdr list) offset)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1998 (setcdr list (cdr data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
1999 (setcdr data ilist)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2000 (when offset
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2001 (gnus-data-update-list (cdr list) offset)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2002 (setq gnus-newsgroup-data-reverse nil))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2003
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2004 (defun gnus-data-remove (article &optional offset)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2005 (let ((data gnus-newsgroup-data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2006 (if (= (gnus-data-number (car data)) article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2007 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2008 (setq gnus-newsgroup-data (cdr gnus-newsgroup-data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2009 gnus-newsgroup-data-reverse nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2010 (when offset
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2011 (gnus-data-update-list gnus-newsgroup-data offset)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2012 (while (cdr data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2013 (when (= (gnus-data-number (cadr data)) article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2014 (setcdr data (cddr data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2015 (when offset
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2016 (gnus-data-update-list (cdr data) offset))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2017 (setq data nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2018 gnus-newsgroup-data-reverse nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2019 (setq data (cdr data))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2020
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2021 (defmacro gnus-data-list (backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2022 `(if ,backward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2023 (or gnus-newsgroup-data-reverse
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2024 (setq gnus-newsgroup-data-reverse
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2025 (reverse gnus-newsgroup-data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2026 gnus-newsgroup-data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2027
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2028 (defun gnus-data-update-list (data offset)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2029 "Add OFFSET to the POS of all data entries in DATA."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2030 (while data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2031 (setcar (nthcdr 2 (car data)) (+ offset (nth 2 (car data))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2032 (setq data (cdr data))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2033
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2034 (defun gnus-data-compute-positions ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2035 "Compute the positions of all articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2036 (let ((data gnus-newsgroup-data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2037 pos)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2038 (while data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2039 (when (setq pos (text-property-any
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2040 (point-min) (point-max)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2041 'gnus-number (gnus-data-number (car data))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2042 (gnus-data-set-pos (car data) (+ pos 3)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2043 (setq data (cdr data)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2044
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2045 (defun gnus-summary-article-pseudo-p (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2046 "Say whether this article is a pseudo article or not."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2047 (not (vectorp (gnus-data-header (gnus-data-find article)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2048
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2049 (defmacro gnus-summary-article-sparse-p (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2050 "Say whether this article is a sparse article or not."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2051 ` (memq ,article gnus-newsgroup-sparse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2052
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2053 (defmacro gnus-summary-article-ancient-p (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2054 "Say whether this article is a sparse article or not."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2055 `(memq ,article gnus-newsgroup-ancient))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2056
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2057 (defun gnus-article-parent-p (number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2058 "Say whether this article is a parent or not."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2059 (let ((data (gnus-data-find-list number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2060 (and (cdr data) ; There has to be an article after...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2061 (< (gnus-data-level (car data)) ; And it has to have a higher level.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2062 (gnus-data-level (nth 1 data))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2063
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2064 (defun gnus-article-children (number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2065 "Return a list of all children to NUMBER."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2066 (let* ((data (gnus-data-find-list number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2067 (level (gnus-data-level (car data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2068 children)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2069 (setq data (cdr data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2070 (while (and data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2071 (= (gnus-data-level (car data)) (1+ level)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2072 (push (gnus-data-number (car data)) children)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2073 (setq data (cdr data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2074 children))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2075
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2076 (defmacro gnus-summary-skip-intangible ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2077 "If the current article is intangible, then jump to a different article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2078 '(let ((to (get-text-property (point) 'gnus-intangible)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2079 (and to (gnus-summary-goto-subject to))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2080
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2081 (defmacro gnus-summary-article-intangible-p ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2082 "Say whether this article is intangible or not."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2083 '(get-text-property (point) 'gnus-intangible))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2084
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2085 (defun gnus-article-read-p (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2086 "Say whether ARTICLE is read or not."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2087 (not (or (memq article gnus-newsgroup-marked)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2088 (memq article gnus-newsgroup-unreads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2089 (memq article gnus-newsgroup-unselected)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2090 (memq article gnus-newsgroup-dormant))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2091
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2092 ;; Some summary mode macros.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2093
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2094 (defmacro gnus-summary-article-number ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2095 "The article number of the article on the current line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2096 If there isn's an article number here, then we return the current
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2097 article number."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2098 '(progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2099 (gnus-summary-skip-intangible)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2100 (or (get-text-property (point) 'gnus-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2101 (gnus-summary-last-subject))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2102
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2103 (defmacro gnus-summary-article-header (&optional number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2104 `(gnus-data-header (gnus-data-find
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2105 ,(or number '(gnus-summary-article-number)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2106
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2107 (defmacro gnus-summary-thread-level (&optional number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2108 `(if (and (eq gnus-summary-make-false-root 'dummy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2109 (get-text-property (point) 'gnus-intangible))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2110 0
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2111 (gnus-data-level (gnus-data-find
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2112 ,(or number '(gnus-summary-article-number))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2113
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2114 (defmacro gnus-summary-article-mark (&optional number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2115 `(gnus-data-mark (gnus-data-find
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2116 ,(or number '(gnus-summary-article-number)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2117
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2118 (defmacro gnus-summary-article-pos (&optional number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2119 `(gnus-data-pos (gnus-data-find
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2120 ,(or number '(gnus-summary-article-number)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2121
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2122 (defalias 'gnus-summary-subject-string 'gnus-summary-article-subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2123 (defmacro gnus-summary-article-subject (&optional number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2124 "Return current subject string or nil if nothing."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2125 `(let ((headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2126 ,(if number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2127 `(gnus-data-header (assq ,number gnus-newsgroup-data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2128 '(gnus-data-header (assq (gnus-summary-article-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2129 gnus-newsgroup-data)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2130 (and headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2131 (vectorp headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2132 (mail-header-subject headers))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2133
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2134 (defmacro gnus-summary-article-score (&optional number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2135 "Return current article score."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2136 `(or (cdr (assq ,(or number '(gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2137 gnus-newsgroup-scored))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2138 gnus-summary-default-score 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2139
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2140 (defun gnus-summary-article-children (&optional number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2141 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2142 (level (gnus-data-level (car data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2143 l children)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2144 (while (and (setq data (cdr data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2145 (> (setq l (gnus-data-level (car data))) level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2146 (and (= (1+ level) l)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2147 (push (gnus-data-number (car data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2148 children)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2149 (nreverse children)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2150
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2151 (defun gnus-summary-article-parent (&optional number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2152 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2153 (gnus-data-list t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2154 (level (gnus-data-level (car data))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2155 (if (zerop level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2156 () ; This is a root.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2157 ;; We search until we find an article with a level less than
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2158 ;; this one. That function has to be the parent.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2159 (while (and (setq data (cdr data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2160 (not (< (gnus-data-level (car data)) level))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2161 (and data (gnus-data-number (car data))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2162
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2163 (defun gnus-unread-mark-p (mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2164 "Say whether MARK is the unread mark."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2165 (= mark gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2166
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2167 (defun gnus-read-mark-p (mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2168 "Say whether MARK is one of the marks that mark as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2169 This is all marks except unread, ticked, dormant, and expirable."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2170 (not (or (= mark gnus-unread-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2171 (= mark gnus-ticked-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2172 (= mark gnus-dormant-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2173 (= mark gnus-expirable-mark))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2174
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2175 (defmacro gnus-article-mark (number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2176 `(cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2177 ((memq ,number gnus-newsgroup-unreads) gnus-unread-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2178 ((memq ,number gnus-newsgroup-marked) gnus-ticked-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2179 ((memq ,number gnus-newsgroup-dormant) gnus-dormant-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2180 ((memq ,number gnus-newsgroup-expirable) gnus-expirable-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2181 (t (or (cdr (assq ,number gnus-newsgroup-reads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2182 gnus-ancient-mark))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2183
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2184 ;; Saving hidden threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2185
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2186 (put 'gnus-save-hidden-threads 'lisp-indent-function 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2187 (put 'gnus-save-hidden-threads 'edebug-form-spec '(body))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2188
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2189 (defmacro gnus-save-hidden-threads (&rest forms)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2190 "Save hidden threads, eval FORMS, and restore the hidden threads."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2191 (let ((config (make-symbol "config")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2192 `(let ((,config (gnus-hidden-threads-configuration)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2193 (unwind-protect
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2194 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2195 ,@forms)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2196 (gnus-restore-hidden-threads-configuration ,config)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2197
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2198 (defun gnus-hidden-threads-configuration ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2199 "Return the current hidden threads configuration."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2200 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2201 (let (config)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2202 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2203 (while (search-forward "\r" nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2204 (push (1- (point)) config))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2205 config)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2206
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2207 (defun gnus-restore-hidden-threads-configuration (config)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2208 "Restore hidden threads configuration from CONFIG."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2209 (let (point buffer-read-only)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2210 (while (setq point (pop config))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2211 (when (and (< point (point-max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2212 (goto-char point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2213 (= (following-char) ?\n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2214 (subst-char-in-region point (1+ point) ?\n ?\r)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2215
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2216 ;; Various summary mode internalish functions.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2217
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2218 (defun gnus-mouse-pick-article (e)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2219 (interactive "e")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2220 (mouse-set-point e)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2221 (gnus-summary-next-page nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2222
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2223 (defun gnus-summary-setup-buffer (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2224 "Initialize summary buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2225 (let ((buffer (concat "*Summary " group "*")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2226 (if (get-buffer buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2227 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2228 (set-buffer buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2229 (setq gnus-summary-buffer (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2230 (not gnus-newsgroup-prepared))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2231 ;; Fix by Sudish Joseph <joseph@cis.ohio-state.edu>
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2232 (setq gnus-summary-buffer (set-buffer (get-buffer-create buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2233 (gnus-add-current-to-buffer-list)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2234 (gnus-summary-mode group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2235 (when gnus-carpal
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2236 (gnus-carpal-setup-buffer 'summary))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2237 (unless gnus-single-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2238 (make-local-variable 'gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2239 (make-local-variable 'gnus-article-current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2240 (make-local-variable 'gnus-original-article-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2241 (setq gnus-newsgroup-name group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2242 t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2243
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2244 (defun gnus-set-global-variables ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2245 ;; Set the global equivalents of the summary buffer-local variables
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2246 ;; to the latest values they had. These reflect the summary buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2247 ;; that was in action when the last article was fetched.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2248 (when (eq major-mode 'gnus-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2249 (setq gnus-summary-buffer (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2250 (let ((name gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2251 (marked gnus-newsgroup-marked)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2252 (unread gnus-newsgroup-unreads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2253 (headers gnus-current-headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2254 (data gnus-newsgroup-data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2255 (summary gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2256 (article-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2257 (original gnus-original-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2258 (gac gnus-article-current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2259 (reffed gnus-reffed-article-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2260 (score-file gnus-current-score-file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2261 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2262 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2263 (setq gnus-newsgroup-name name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2264 (setq gnus-newsgroup-marked marked)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2265 (setq gnus-newsgroup-unreads unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2266 (setq gnus-current-headers headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2267 (setq gnus-newsgroup-data data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2268 (setq gnus-article-current gac)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2269 (setq gnus-summary-buffer summary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2270 (setq gnus-article-buffer article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2271 (setq gnus-original-article-buffer original)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2272 (setq gnus-reffed-article-number reffed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2273 (setq gnus-current-score-file score-file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2274 ;; The article buffer also has local variables.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2275 (when (gnus-buffer-live-p gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2276 (set-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2277 (setq gnus-summary-buffer summary))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2278
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2279 (defun gnus-summary-article-unread-p (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2280 "Say whether ARTICLE is unread or not."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2281 (memq article gnus-newsgroup-unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2282
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2283 (defun gnus-summary-first-article-p (&optional article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2284 "Return whether ARTICLE is the first article in the buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2285 (if (not (setq article (or article (gnus-summary-article-number))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2286 nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2287 (eq article (caar gnus-newsgroup-data))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2288
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2289 (defun gnus-summary-last-article-p (&optional article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2290 "Return whether ARTICLE is the last article in the buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2291 (if (not (setq article (or article (gnus-summary-article-number))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2292 t ; All non-existent numbers are the last article. :-)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2293 (not (cdr (gnus-data-find-list article)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2294
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2295 (defun gnus-make-thread-indent-array ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2296 (let ((n 200))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2297 (unless (and gnus-thread-indent-array
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2298 (= gnus-thread-indent-level gnus-thread-indent-array-level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2299 (setq gnus-thread-indent-array (make-vector 201 "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2300 gnus-thread-indent-array-level gnus-thread-indent-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2301 (while (>= n 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2302 (aset gnus-thread-indent-array n
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2303 (make-string (* n gnus-thread-indent-level) ? ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2304 (setq n (1- n))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2305
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2306 (defun gnus-update-summary-mark-positions ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2307 "Compute where the summary marks are to go."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2308 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2309 (when (and gnus-summary-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2310 (get-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2311 (buffer-name (get-buffer gnus-summary-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2312 (set-buffer gnus-summary-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2313 (let ((gnus-replied-mark 129)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2314 (gnus-score-below-mark 130)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2315 (gnus-score-over-mark 130)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2316 (spec gnus-summary-line-format-spec)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2317 thread gnus-visual pos)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2318 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2319 (gnus-set-work-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2320 (let ((gnus-summary-line-format-spec spec))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2321 (gnus-summary-insert-line
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2322 [0 "" "" "" "" "" 0 0 ""] 0 nil 128 t nil "" nil 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2323 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2324 (setq pos (list (cons 'unread (and (search-forward "\200" nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2325 (- (point) 2)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2326 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2327 (push (cons 'replied (and (search-forward "\201" nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2328 (- (point) 2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2329 pos)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2330 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2331 (push (cons 'score (and (search-forward "\202" nil t) (- (point) 2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2332 pos)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2333 (setq gnus-summary-mark-positions pos))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2334
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2335 (defun gnus-summary-insert-dummy-line (gnus-tmp-subject gnus-tmp-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2336 "Insert a dummy root in the summary buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2337 (beginning-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2338 (gnus-add-text-properties
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2339 (point) (progn (eval gnus-summary-dummy-line-format-spec) (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2340 (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2341
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2342 (defun gnus-summary-insert-line (gnus-tmp-header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2343 gnus-tmp-level gnus-tmp-current
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2344 gnus-tmp-unread gnus-tmp-replied
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2345 gnus-tmp-expirable gnus-tmp-subject-or-nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2346 &optional gnus-tmp-dummy gnus-tmp-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2347 gnus-tmp-process)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2348 (let* ((gnus-tmp-indentation (aref gnus-thread-indent-array gnus-tmp-level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2349 (gnus-tmp-lines (mail-header-lines gnus-tmp-header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2350 (gnus-tmp-score (or gnus-tmp-score gnus-summary-default-score 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2351 (gnus-tmp-score-char
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2352 (if (or (null gnus-summary-default-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2353 (<= (abs (- gnus-tmp-score gnus-summary-default-score))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2354 gnus-summary-zcore-fuzz))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2355 ?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2356 (if (< gnus-tmp-score gnus-summary-default-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2357 gnus-score-below-mark gnus-score-over-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2358 (gnus-tmp-replied
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2359 (cond (gnus-tmp-process gnus-process-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2360 ((memq gnus-tmp-current gnus-newsgroup-cached)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2361 gnus-cached-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2362 (gnus-tmp-replied gnus-replied-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2363 ((memq gnus-tmp-current gnus-newsgroup-saved)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2364 gnus-saved-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2365 (t gnus-unread-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2366 (gnus-tmp-from (mail-header-from gnus-tmp-header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2367 (gnus-tmp-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2368 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2369 ((string-match "<[^>]+> *$" gnus-tmp-from)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2370 (let ((beg (match-beginning 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2371 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2372 (substring gnus-tmp-from (1+ (match-beginning 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2373 (1- (match-end 0))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2374 (substring gnus-tmp-from 0 beg))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2375 ((string-match "(.+)" gnus-tmp-from)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2376 (substring gnus-tmp-from
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2377 (1+ (match-beginning 0)) (1- (match-end 0))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2378 (t gnus-tmp-from)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2379 (gnus-tmp-subject (mail-header-subject gnus-tmp-header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2380 (gnus-tmp-number (mail-header-number gnus-tmp-header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2381 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2382 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\]))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2383 (buffer-read-only nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2384 (when (string= gnus-tmp-name "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2385 (setq gnus-tmp-name gnus-tmp-from))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2386 (unless (numberp gnus-tmp-lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2387 (setq gnus-tmp-lines 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2388 (gnus-put-text-property
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2389 (point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2390 (progn (eval gnus-summary-line-format-spec) (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2391 'gnus-number gnus-tmp-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2392 (when (gnus-visual-p 'summary-highlight 'highlight)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2393 (forward-line -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2394 (run-hooks 'gnus-summary-update-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2395 (forward-line 1))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2396
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2397 (defun gnus-summary-update-line (&optional dont-update)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2398 ;; Update summary line after change.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2399 (when (and gnus-summary-default-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2400 (not gnus-summary-inhibit-highlight))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2401 (let* ((gnus-summary-inhibit-highlight t) ; Prevent recursion.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2402 (article (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2403 (score (gnus-summary-article-score article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2404 (unless dont-update
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2405 (if (and gnus-summary-mark-below
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2406 (< (gnus-summary-article-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2407 gnus-summary-mark-below))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2408 ;; This article has a low score, so we mark it as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2409 (when (memq article gnus-newsgroup-unreads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2410 (gnus-summary-mark-article-as-read gnus-low-score-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2411 (when (eq (gnus-summary-article-mark) gnus-low-score-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2412 ;; This article was previously marked as read on account
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2413 ;; of a low score, but now it has risen, so we mark it as
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2414 ;; unread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2415 (gnus-summary-mark-article-as-unread gnus-unread-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2416 (gnus-summary-update-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2417 (if (or (null gnus-summary-default-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2418 (<= (abs (- score gnus-summary-default-score))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2419 gnus-summary-zcore-fuzz))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2420 ?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2421 (if (< score gnus-summary-default-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2422 gnus-score-below-mark gnus-score-over-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2423 'score))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2424 ;; Do visual highlighting.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2425 (when (gnus-visual-p 'summary-highlight 'highlight)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2426 (run-hooks 'gnus-summary-update-hook)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2427
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2428 (defvar gnus-tmp-new-adopts nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2429
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2430 (defun gnus-summary-number-of-articles-in-thread (thread &optional level char)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2431 "Return the number of articles in THREAD.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2432 This may be 0 in some cases -- if none of the articles in
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2433 the thread are to be displayed."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2434 (let* ((number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2435 ;; Fix by Luc Van Eycken <Luc.VanEycken@esat.kuleuven.ac.be>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2436 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2437 ((not (listp thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2438 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2439 ((and (consp thread) (cdr thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2440 (apply
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2441 '+ 1 (mapcar
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2442 'gnus-summary-number-of-articles-in-thread (cdr thread))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2443 ((null thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2444 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2445 ((memq (mail-header-number (car thread)) gnus-newsgroup-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2446 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2447 (t 0))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2448 (when (and level (zerop level) gnus-tmp-new-adopts)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2449 (incf number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2450 (apply '+ (mapcar
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2451 'gnus-summary-number-of-articles-in-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2452 gnus-tmp-new-adopts))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2453 (if char
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2454 (if (> number 1) gnus-not-empty-thread-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2455 gnus-empty-thread-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2456 number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2457
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2458 (defun gnus-summary-set-local-parameters (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2459 "Go through the local params of GROUP and set all variable specs in that list."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2460 (let ((params (gnus-group-find-parameter group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2461 elem)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2462 (while params
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2463 (setq elem (car params)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2464 params (cdr params))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2465 (and (consp elem) ; Has to be a cons.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2466 (consp (cdr elem)) ; The cdr has to be a list.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2467 (symbolp (car elem)) ; Has to be a symbol in there.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2468 (not (memq (car elem)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2469 '(quit-config to-address to-list to-group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2470 (progn ; So we set it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2471 (make-local-variable (car elem))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2472 (set (car elem) (eval (nth 1 elem))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2473
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2474 (defun gnus-summary-read-group (group &optional show-all no-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2475 kill-buffer no-display)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2476 "Start reading news in newsgroup GROUP.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2477 If SHOW-ALL is non-nil, already read articles are also listed.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2478 If NO-ARTICLE is non-nil, no article is selected initially.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2479 If NO-DISPLAY, don't generate a summary buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2480 ;; Killed foreign groups can't be entered.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2481 (when (and (not (gnus-group-native-p group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2482 (not (gnus-gethash group gnus-newsrc-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2483 (error "Dead non-native groups can't be entered"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2484 (gnus-message 5 "Retrieving newsgroup: %s..." group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2485 (let* ((new-group (gnus-summary-setup-buffer group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2486 (quit-config (gnus-group-quit-config group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2487 (did-select (and new-group (gnus-select-newsgroup group show-all))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2488 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2489 ;; This summary buffer exists already, so we just select it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2490 ((not new-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2491 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2492 (when kill-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2493 (gnus-kill-or-deaden-summary kill-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2494 (gnus-configure-windows 'summary 'force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2495 (gnus-set-mode-line 'summary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2496 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2497 (message "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2498 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2499 ;; We couldn't select this group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2500 ((null did-select)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2501 (when (and (eq major-mode 'gnus-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2502 (not (equal (current-buffer) kill-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2503 (kill-buffer (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2504 (if (not quit-config)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2505 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2506 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2507 (gnus-group-jump-to-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2508 (gnus-group-next-unread-group 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2509 (gnus-handle-ephemeral-exit quit-config)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2510 (gnus-message 3 "Can't select group")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2511 nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2512 ;; The user did a `C-g' while prompting for number of articles,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2513 ;; so we exit this group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2514 ((eq did-select 'quit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2515 (and (eq major-mode 'gnus-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2516 (not (equal (current-buffer) kill-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2517 (kill-buffer (current-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2518 (when kill-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2519 (gnus-kill-or-deaden-summary kill-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2520 (if (not quit-config)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2521 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2522 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2523 (gnus-group-jump-to-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2524 (gnus-group-next-unread-group 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2525 (gnus-configure-windows 'group 'force))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2526 (gnus-handle-ephemeral-exit quit-config))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2527 ;; Finally signal the quit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2528 (signal 'quit nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2529 ;; The group was successfully selected.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2530 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2531 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2532 ;; Save the active value in effect when the group was entered.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2533 (setq gnus-newsgroup-active
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2534 (gnus-copy-sequence
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2535 (gnus-active gnus-newsgroup-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2536 ;; You can change the summary buffer in some way with this hook.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2537 (run-hooks 'gnus-select-group-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2538 ;; Set any local variables in the group parameters.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2539 (gnus-summary-set-local-parameters gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2540 (gnus-update-format-specifications
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2541 nil 'summary 'summary-mode 'summary-dummy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2542 ;; Do score processing.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2543 (when gnus-use-scoring
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2544 (gnus-possibly-score-headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2545 ;; Check whether to fill in the gaps in the threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2546 (when gnus-build-sparse-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2547 (gnus-build-sparse-threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2548 ;; Find the initial limit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2549 (if gnus-show-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2550 (if show-all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2551 (let ((gnus-newsgroup-dormant nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2552 (gnus-summary-initial-limit show-all))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2553 (gnus-summary-initial-limit show-all))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2554 (setq gnus-newsgroup-limit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2555 (mapcar
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2556 (lambda (header) (mail-header-number header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2557 gnus-newsgroup-headers)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2558 ;; Generate the summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2559 (unless no-display
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2560 (gnus-summary-prepare))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2561 (when gnus-use-trees
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2562 (gnus-tree-open group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2563 (setq gnus-summary-highlight-line-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2564 'gnus-tree-highlight-article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2565 ;; If the summary buffer is empty, but there are some low-scored
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2566 ;; articles or some excluded dormants, we include these in the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2567 ;; buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2568 (when (and (zerop (buffer-size))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2569 (not no-display))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2570 (cond (gnus-newsgroup-dormant
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2571 (gnus-summary-limit-include-dormant))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2572 ((and gnus-newsgroup-scored show-all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2573 (gnus-summary-limit-include-expunged t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2574 ;; Function `gnus-apply-kill-file' must be called in this hook.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2575 (run-hooks 'gnus-apply-kill-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2576 (if (and (zerop (buffer-size))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2577 (not no-display))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2578 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2579 ;; This newsgroup is empty.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2580 (gnus-summary-catchup-and-exit nil t) ;Without confirmations.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2581 (gnus-message 6 "No unread news")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2582 (when kill-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2583 (gnus-kill-or-deaden-summary kill-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2584 ;; Return nil from this function.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2585 nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2586 ;; Hide conversation thread subtrees. We cannot do this in
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2587 ;; gnus-summary-prepare-hook since kill processing may not
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2588 ;; work with hidden articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2589 (and gnus-show-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2590 gnus-thread-hide-subtree
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2591 (gnus-summary-hide-all-threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2592 ;; Show first unread article if requested.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2593 (if (and (not no-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2594 (not no-display)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2595 gnus-newsgroup-unreads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2596 gnus-auto-select-first)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2597 (unless (if (eq gnus-auto-select-first 'best)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2598 (gnus-summary-best-unread-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2599 (gnus-summary-first-unread-article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2600 (gnus-configure-windows 'summary))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2601 ;; Don't select any articles, just move point to the first
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2602 ;; article in the group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2603 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2604 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2605 (gnus-set-mode-line 'summary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2606 (gnus-configure-windows 'summary 'force))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2607 (when kill-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2608 (gnus-kill-or-deaden-summary kill-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2609 (when (get-buffer-window gnus-group-buffer t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2610 ;; Gotta use windows, because recenter does weird stuff if
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2611 ;; the current buffer ain't the displayed window.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2612 (let ((owin (selected-window)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2613 (select-window (get-buffer-window gnus-group-buffer t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2614 (when (gnus-group-goto-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2615 (recenter))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2616 (select-window owin))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2617 ;; Mark this buffer as "prepared".
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2618 (setq gnus-newsgroup-prepared t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2619 t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2620
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2621 (defun gnus-summary-prepare ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2622 "Generate the summary buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2623 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2624 (let ((buffer-read-only nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2625 (erase-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2626 (setq gnus-newsgroup-data nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2627 gnus-newsgroup-data-reverse nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2628 (run-hooks 'gnus-summary-generate-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2629 ;; Generate the buffer, either with threads or without.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2630 (when gnus-newsgroup-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2631 (gnus-summary-prepare-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2632 (if gnus-show-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2633 (gnus-sort-gathered-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2634 (funcall gnus-summary-thread-gathering-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2635 (gnus-sort-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2636 (gnus-cut-threads (gnus-make-threads)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2637 ;; Unthreaded display.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2638 (gnus-sort-articles gnus-newsgroup-headers))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2639 (setq gnus-newsgroup-data (nreverse gnus-newsgroup-data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2640 ;; Call hooks for modifying summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2641 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2642 (run-hooks 'gnus-summary-prepare-hook)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2643
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2644 (defsubst gnus-general-simplify-subject (subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2645 "Simply subject by the same rules as gnus-gather-threads-by-subject."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2646 (setq subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2647 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2648 ;; Truncate the subject.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2649 ((numberp gnus-summary-gather-subject-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2650 (setq subject (gnus-simplify-subject-re subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2651 (if (> (length subject) gnus-summary-gather-subject-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2652 (substring subject 0 gnus-summary-gather-subject-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2653 subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2654 ;; Fuzzily simplify it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2655 ((eq 'fuzzy gnus-summary-gather-subject-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2656 (gnus-simplify-subject-fuzzy subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2657 ;; Just remove the leading "Re:".
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2658 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2659 (gnus-simplify-subject-re subject))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2660
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2661 (if (and gnus-summary-gather-exclude-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2662 (string-match gnus-summary-gather-exclude-subject subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2663 nil ; This article shouldn't be gathered
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2664 subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2665
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2666 (defun gnus-summary-simplify-subject-query ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2667 "Query where the respool algorithm would put this article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2668 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2669 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2670 (gnus-summary-select-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2671 (message (gnus-general-simplify-subject (gnus-summary-article-subject))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2672
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2673 (defun gnus-gather-threads-by-subject (threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2674 "Gather threads by looking at Subject headers."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2675 (if (not gnus-summary-make-false-root)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2676 threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2677 (let ((hashtb (gnus-make-hashtable 1024))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2678 (prev threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2679 (result threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2680 subject hthread whole-subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2681 (while threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2682 (setq subject (gnus-general-simplify-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2683 (setq whole-subject (mail-header-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2684 (caar threads)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2685 (when subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2686 (if (setq hthread (gnus-gethash subject hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2687 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2688 ;; We enter a dummy root into the thread, if we
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2689 ;; haven't done that already.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2690 (unless (stringp (caar hthread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2691 (setcar hthread (list whole-subject (car hthread))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2692 ;; We add this new gathered thread to this gathered
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2693 ;; thread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2694 (setcdr (car hthread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2695 (nconc (cdar hthread) (list (car threads))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2696 ;; Remove it from the list of threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2697 (setcdr prev (cdr threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2698 (setq threads prev))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2699 ;; Enter this thread into the hash table.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2700 (gnus-sethash subject threads hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2701 (setq prev threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2702 (setq threads (cdr threads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2703 result)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2704
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2705 (defun gnus-gather-threads-by-references (threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2706 "Gather threads by looking at References headers."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2707 (let ((idhashtb (gnus-make-hashtable 1024))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2708 (thhashtb (gnus-make-hashtable 1024))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2709 (prev threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2710 (result threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2711 ids references id gthread gid entered ref)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2712 (while threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2713 (when (setq references (mail-header-references (caar threads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2714 (setq id (mail-header-id (caar threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2715 ids (gnus-split-references references)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2716 entered nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2717 (while (setq ref (pop ids))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2718 (setq ids (delete ref ids))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2719 (if (not (setq gid (gnus-gethash ref idhashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2720 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2721 (gnus-sethash ref id idhashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2722 (gnus-sethash id threads thhashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2723 (setq gthread (gnus-gethash gid thhashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2724 (unless entered
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2725 ;; We enter a dummy root into the thread, if we
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2726 ;; haven't done that already.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2727 (unless (stringp (caar gthread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2728 (setcar gthread (list (mail-header-subject (caar gthread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2729 (car gthread))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2730 ;; We add this new gathered thread to this gathered
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2731 ;; thread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2732 (setcdr (car gthread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2733 (nconc (cdar gthread) (list (car threads)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2734 ;; Add it into the thread hash table.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2735 (gnus-sethash id gthread thhashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2736 (setq entered t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2737 ;; Remove it from the list of threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2738 (setcdr prev (cdr threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2739 (setq threads prev))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2740 (setq prev threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2741 (setq threads (cdr threads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2742 result))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2743
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2744 (defun gnus-sort-gathered-threads (threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2745 "Sort subtreads inside each gathered thread by article number."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2746 (let ((result threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2747 (while threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2748 (when (stringp (caar threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2749 (setcdr (car threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2750 (sort (cdar threads) 'gnus-thread-sort-by-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2751 (setq threads (cdr threads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2752 result))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2753
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2754 (defun gnus-thread-loop-p (root thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2755 "Say whether ROOT is in THREAD."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2756 (let ((th (cdr thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2757 (while (and th
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2758 (not (eq (caar th) root)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2759 (pop th))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2760 (if th
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2761 ;; We have found a loop.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2762 (let (ref-dep)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2763 (setcdr thread (delq (car th) (cdr thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2764 (if (boundp (setq ref-dep (intern "none"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2765 gnus-newsgroup-dependencies)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2766 (setcdr (symbol-value ref-dep)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2767 (nconc (cdr (symbol-value ref-dep))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2768 (list (car th))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2769 (set ref-dep (list nil (car th))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2770 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2771 ;; Recurse down into the sub-threads and look for loops.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2772 (apply '+
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2773 (mapcar
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2774 (lambda (thread) (gnus-thread-loop-p root thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2775 (cdr thread))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2776
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2777 (defun gnus-make-threads ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2778 "Go through the dependency hashtb and find the roots. Return all threads."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2779 (let (threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2780 (while (catch 'infloop
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2781 (mapatoms
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2782 (lambda (refs)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2783 ;; Deal with self-referencing References loops.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2784 (when (and (car (symbol-value refs))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2785 (not (zerop
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2786 (apply
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2787 '+
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2788 (mapcar
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2789 (lambda (thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2790 (gnus-thread-loop-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2791 (car (symbol-value refs)) thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2792 (cdr (symbol-value refs)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2793 (setq threads nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2794 (throw 'infloop t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2795 (unless (car (symbol-value refs))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2796 ;; These threads do not refer back to any other articles,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2797 ;; so they're roots.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2798 (setq threads (append (cdr (symbol-value refs)) threads))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2799 gnus-newsgroup-dependencies)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2800 threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2801
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2802 (defun gnus-build-sparse-threads ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2803 (let ((headers gnus-newsgroup-headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2804 (deps gnus-newsgroup-dependencies)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2805 header references generation relations
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2806 cthread subject child end pthread relation)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2807 ;; First we create an alist of generations/relations, where
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2808 ;; generations is how much we trust the relation, and the relation
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2809 ;; is parent/child.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2810 (gnus-message 7 "Making sparse threads...")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2811 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2812 (nnheader-set-temp-buffer " *gnus sparse threads*")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2813 (while (setq header (pop headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2814 (when (and (setq references (mail-header-references header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2815 (not (string= references "")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2816 (insert references)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2817 (setq child (mail-header-id header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2818 subject (mail-header-subject header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2819 (setq generation 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2820 (while (search-backward ">" nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2821 (setq end (1+ (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2822 (when (search-backward "<" nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2823 (push (list (incf generation)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2824 child (setq child (buffer-substring (point) end))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2825 subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2826 relations)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2827 (push (list (1+ generation) child nil subject) relations)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2828 (erase-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2829 (kill-buffer (current-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2830 ;; Sort over trustworthiness.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2831 (setq relations (sort relations (lambda (r1 r2) (< (car r1) (car r2)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2832 (while (setq relation (pop relations))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2833 (when (if (boundp (setq cthread (intern (cadr relation) deps)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2834 (unless (car (symbol-value cthread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2835 ;; Make this article the parent of these threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2836 (setcar (symbol-value cthread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2837 (vector gnus-reffed-article-number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2838 (cadddr relation)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2839 "" ""
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2840 (cadr relation)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2841 (or (caddr relation) "") 0 0 "")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2842 (set cthread (list (vector gnus-reffed-article-number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2843 (cadddr relation)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2844 "" "" (cadr relation)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2845 (or (caddr relation) "") 0 0 ""))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2846 (push gnus-reffed-article-number gnus-newsgroup-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2847 (push gnus-reffed-article-number gnus-newsgroup-sparse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2848 (push (cons gnus-reffed-article-number gnus-sparse-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2849 gnus-newsgroup-reads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2850 (decf gnus-reffed-article-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2851 ;; Make this new thread the child of its parent.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2852 (if (boundp (setq pthread (intern (or (caddr relation) "none") deps)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2853 (setcdr (symbol-value pthread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2854 (nconc (cdr (symbol-value pthread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2855 (list (symbol-value cthread))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2856 (set pthread (list nil (symbol-value cthread))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2857 (gnus-message 7 "Making sparse threads...done")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2858
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2859 (defun gnus-build-old-threads ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2860 ;; Look at all the articles that refer back to old articles, and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2861 ;; fetch the headers for the articles that aren't there. This will
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2862 ;; build complete threads - if the roots haven't been expired by the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2863 ;; server, that is.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2864 (let (id heads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2865 (mapatoms
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2866 (lambda (refs)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2867 (when (not (car (symbol-value refs)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2868 (setq heads (cdr (symbol-value refs)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2869 (while heads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2870 (if (memq (mail-header-number (caar heads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2871 gnus-newsgroup-dormant)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2872 (setq heads (cdr heads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2873 (setq id (symbol-name refs))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2874 (while (and (setq id (gnus-build-get-header id))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2875 (not (car (gnus-gethash
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2876 id gnus-newsgroup-dependencies)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2877 (setq heads nil)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2878 gnus-newsgroup-dependencies)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2879
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2880 (defun gnus-build-get-header (id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2881 ;; Look through the buffer of NOV lines and find the header to
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2882 ;; ID. Enter this line into the dependencies hash table, and return
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2883 ;; the id of the parent article (if any).
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2884 (let ((deps gnus-newsgroup-dependencies)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2885 found header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2886 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2887 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2888 (set-buffer nntp-server-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2889 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2890 (while (and (not found) (search-forward id nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2891 (beginning-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2892 (setq found (looking-at
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2893 (format "^[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t%s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2894 (regexp-quote id))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2895 (or found (beginning-of-line 2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2896 (when found
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2897 (beginning-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2898 (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2899 (setq header (gnus-nov-parse-line
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2900 (read (current-buffer)) deps))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2901 (gnus-parent-id (mail-header-references header)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2902 (when header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2903 (let ((number (mail-header-number header)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2904 (push number gnus-newsgroup-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2905 (push header gnus-newsgroup-headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2906 (if (memq number gnus-newsgroup-unselected)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2907 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2908 (push number gnus-newsgroup-unreads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2909 (setq gnus-newsgroup-unselected
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2910 (delq number gnus-newsgroup-unselected)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2911 (push number gnus-newsgroup-ancient)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2912
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2913 (defun gnus-summary-update-article-line (article header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2914 "Update the line for ARTICLE using HEADERS."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2915 (let* ((id (mail-header-id header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2916 (thread (gnus-id-to-thread id)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2917 (unless thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2918 (error "Article in no thread"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2919 ;; Update the thread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2920 (setcar thread header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2921 (gnus-summary-goto-subject article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2922 (let* ((datal (gnus-data-find-list article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2923 (data (car datal))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2924 (length (when (cdr datal)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2925 (- (gnus-data-pos data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2926 (gnus-data-pos (cadr datal)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2927 (buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2928 (level (gnus-summary-thread-level)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2929 (gnus-delete-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2930 (gnus-summary-insert-line
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2931 header level nil (gnus-article-mark article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2932 (memq article gnus-newsgroup-replied)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2933 (memq article gnus-newsgroup-expirable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2934 (mail-header-subject header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2935 nil (cdr (assq article gnus-newsgroup-scored))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2936 (memq article gnus-newsgroup-processable))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2937 (when length
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2938 (gnus-data-update-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2939 (cdr datal) (- length (- (gnus-data-pos data) (point))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2940
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2941 (defun gnus-summary-update-article (article &optional iheader)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2942 "Update ARTICLE in the summary buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2943 (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2944 (let* ((header (or iheader (gnus-summary-article-header article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2945 (id (mail-header-id header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2946 (data (gnus-data-find article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2947 (thread (gnus-id-to-thread id))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2948 (references (mail-header-references header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2949 (parent
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2950 (gnus-id-to-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2951 (or (gnus-parent-id
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2952 (when (and references
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2953 (not (equal "" references)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2954 references))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2955 "none")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2956 (buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2957 (old (car thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2958 (number (mail-header-number header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2959 pos)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2960 (when thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2961 ;; !!! Should this be in or not?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2962 (unless iheader
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2963 (setcar thread nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2964 (when parent
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2965 (delq thread parent))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2966 (if (gnus-summary-insert-subject id header iheader)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2967 ;; Set the (possibly) new article number in the data structure.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2968 (gnus-data-set-number data (gnus-id-to-article id))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2969 (setcar thread old)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2970 nil))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2971
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2972 (defun gnus-rebuild-thread (id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2973 "Rebuild the thread containing ID."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2974 (let ((buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2975 old-pos current thread data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2976 (if (not gnus-show-threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2977 (setq thread (list (car (gnus-id-to-thread id))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2978 ;; Get the thread this article is part of.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2979 (setq thread (gnus-remove-thread id)))
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
2980 (setq old-pos (gnus-point-at-bol))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2981 (setq current (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2982 (and (zerop (forward-line -1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2983 (gnus-summary-article-number))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2984 ;; If this is a gathered thread, we have to go some re-gathering.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2985 (when (stringp (car thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2986 (let ((subject (car thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2987 roots thr)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2988 (setq thread (cdr thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2989 (while thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2990 (unless (memq (setq thr (gnus-id-to-thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2991 (gnus-root-id
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2992 (mail-header-id (caar thread)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2993 roots)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2994 (push thr roots))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2995 (setq thread (cdr thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2996 ;; We now have all (unique) roots.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2997 (if (= (length roots) 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2998 ;; All the loose roots are now one solid root.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
2999 (setq thread (car roots))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3000 (setq thread (cons subject (gnus-sort-threads roots))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3001 (let (threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3002 ;; We then insert this thread into the summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3003 (let (gnus-newsgroup-data gnus-newsgroup-threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3004 (if gnus-show-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3005 (gnus-summary-prepare-threads (gnus-cut-threads (list thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3006 (gnus-summary-prepare-unthreaded thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3007 (setq data (nreverse gnus-newsgroup-data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3008 (setq threads gnus-newsgroup-threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3009 ;; We splice the new data into the data structure.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3010 (gnus-data-enter-list current data (- (point) old-pos))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3011 (setq gnus-newsgroup-threads (nconc threads gnus-newsgroup-threads)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3012
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3013 (defun gnus-number-to-header (number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3014 "Return the header for article NUMBER."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3015 (let ((headers gnus-newsgroup-headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3016 (while (and headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3017 (not (= number (mail-header-number (car headers)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3018 (pop headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3019 (when headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3020 (car headers))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3021
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3022 (defun gnus-parent-headers (headers &optional generation)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3023 "Return the headers of the GENERATIONeth parent of HEADERS."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3024 (unless generation
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3025 (setq generation 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3026 (let (references parent)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3027 (while (and headers (not (zerop generation)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3028 (setq references (mail-header-references headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3029 (when (and references
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3030 (setq parent (gnus-parent-id references))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3031 (setq headers (car (gnus-id-to-thread parent))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3032 (decf generation)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3033 headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3034
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3035 (defun gnus-id-to-thread (id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3036 "Return the (sub-)thread where ID appears."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3037 (gnus-gethash id gnus-newsgroup-dependencies))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3038
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3039 (defun gnus-id-to-article (id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3040 "Return the article number of ID."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3041 (let ((thread (gnus-id-to-thread id)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3042 (when (and thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3043 (car thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3044 (mail-header-number (car thread)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3045
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3046 (defun gnus-id-to-header (id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3047 "Return the article headers of ID."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3048 (car (gnus-id-to-thread id)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3049
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3050 (defun gnus-article-displayed-root-p (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3051 "Say whether ARTICLE is a root(ish) article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3052 (let ((level (gnus-summary-thread-level article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3053 (refs (mail-header-references (gnus-summary-article-header article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3054 particle)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3055 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3056 ((null level) nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3057 ((zerop level) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3058 ((null refs) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3059 ((null (gnus-parent-id refs)) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3060 ((and (= 1 level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3061 (null (setq particle (gnus-id-to-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3062 (gnus-parent-id refs))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3063 (null (gnus-summary-thread-level particle)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3064
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3065 (defun gnus-root-id (id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3066 "Return the id of the root of the thread where ID appears."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3067 (let (last-id prev)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3068 (while (and id (setq prev (car (gnus-gethash
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3069 id gnus-newsgroup-dependencies))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3070 (setq last-id id
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3071 id (gnus-parent-id (mail-header-references prev))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3072 last-id))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3073
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3074 (defun gnus-remove-thread (id &optional dont-remove)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3075 "Remove the thread that has ID in it."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3076 (let ((dep gnus-newsgroup-dependencies)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3077 headers thread last-id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3078 ;; First go up in this thread until we find the root.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3079 (setq last-id (gnus-root-id id))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3080 (setq headers (list (car (gnus-id-to-thread last-id))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3081 (caadr (gnus-id-to-thread last-id))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3082 ;; We have now found the real root of this thread. It might have
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3083 ;; been gathered into some loose thread, so we have to search
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3084 ;; through the threads to find the thread we wanted.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3085 (let ((threads gnus-newsgroup-threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3086 sub)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3087 (while threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3088 (setq sub (car threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3089 (if (stringp (car sub))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3090 ;; This is a gathered thread, so we look at the roots
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3091 ;; below it to find whether this article is in this
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3092 ;; gathered root.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3093 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3094 (setq sub (cdr sub))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3095 (while sub
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3096 (when (member (caar sub) headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3097 (setq thread (car threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3098 threads nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3099 sub nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3100 (setq sub (cdr sub))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3101 ;; It's an ordinary thread, so we check it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3102 (when (eq (car sub) (car headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3103 (setq thread sub
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3104 threads nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3105 (setq threads (cdr threads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3106 ;; If this article is in no thread, then it's a root.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3107 (if thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3108 (unless dont-remove
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3109 (setq gnus-newsgroup-threads (delq thread gnus-newsgroup-threads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3110 (setq thread (gnus-gethash last-id dep)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3111 (when thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3112 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3113 thread ; We return this thread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3114 (unless dont-remove
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3115 (if (stringp (car thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3116 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3117 ;; If we use dummy roots, then we have to remove the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3118 ;; dummy root as well.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3119 (when (eq gnus-summary-make-false-root 'dummy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3120 (gnus-delete-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3121 (gnus-data-compute-positions))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3122 (setq thread (cdr thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3123 (while thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3124 (gnus-remove-thread-1 (car thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3125 (setq thread (cdr thread))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3126 (gnus-remove-thread-1 thread))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3127
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3128 (defun gnus-remove-thread-1 (thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3129 "Remove the thread THREAD recursively."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3130 (let ((number (mail-header-number (pop thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3131 d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3132 (setq thread (reverse thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3133 (while thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3134 (gnus-remove-thread-1 (pop thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3135 (when (setq d (gnus-data-find number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3136 (goto-char (gnus-data-pos d))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3137 (gnus-data-remove
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3138 number
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
3139 (- (gnus-point-at-bol)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3140 (prog1
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
3141 (1+ (gnus-point-at-eol))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3142 (gnus-delete-line)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3143
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3144 (defun gnus-sort-threads (threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3145 "Sort THREADS."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3146 (if (not gnus-thread-sort-functions)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3147 threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3148 (gnus-message 7 "Sorting threads...")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3149 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3150 (sort threads (gnus-make-sort-function gnus-thread-sort-functions))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3151 (gnus-message 7 "Sorting threads...done"))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3152
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3153 (defun gnus-sort-articles (articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3154 "Sort ARTICLES."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3155 (when gnus-article-sort-functions
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3156 (gnus-message 7 "Sorting articles...")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3157 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3158 (setq gnus-newsgroup-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3159 (sort articles (gnus-make-sort-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3160 gnus-article-sort-functions)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3161 (gnus-message 7 "Sorting articles...done"))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3162
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3163 ;; Written by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3164 (defmacro gnus-thread-header (thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3165 ;; Return header of first article in THREAD.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3166 ;; Note that THREAD must never, ever be anything else than a variable -
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3167 ;; using some other form will lead to serious barfage.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3168 (or (symbolp thread) (signal 'wrong-type-argument '(symbolp thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3169 ;; (8% speedup to gnus-summary-prepare, just for fun :-)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3170 (list 'byte-code "\10\211:\203\17\0\211@;\203\16\0A@@\207" ;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3171 (vector thread) 2))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3172
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3173 (defsubst gnus-article-sort-by-number (h1 h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3174 "Sort articles by article number."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3175 (< (mail-header-number h1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3176 (mail-header-number h2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3177
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3178 (defun gnus-thread-sort-by-number (h1 h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3179 "Sort threads by root article number."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3180 (gnus-article-sort-by-number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3181 (gnus-thread-header h1) (gnus-thread-header h2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3182
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3183 (defsubst gnus-article-sort-by-lines (h1 h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3184 "Sort articles by article Lines header."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3185 (< (mail-header-lines h1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3186 (mail-header-lines h2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3187
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3188 (defun gnus-thread-sort-by-lines (h1 h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3189 "Sort threads by root article Lines header."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3190 (gnus-article-sort-by-lines
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3191 (gnus-thread-header h1) (gnus-thread-header h2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3192
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3193 (defsubst gnus-article-sort-by-author (h1 h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3194 "Sort articles by root author."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3195 (string-lessp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3196 (let ((extract (funcall
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3197 gnus-extract-address-components
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3198 (mail-header-from h1))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3199 (or (car extract) (cdr extract)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3200 (let ((extract (funcall
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3201 gnus-extract-address-components
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3202 (mail-header-from h2))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3203 (or (car extract) (cdr extract)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3204
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3205 (defun gnus-thread-sort-by-author (h1 h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3206 "Sort threads by root author."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3207 (gnus-article-sort-by-author
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3208 (gnus-thread-header h1) (gnus-thread-header h2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3209
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3210 (defsubst gnus-article-sort-by-subject (h1 h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3211 "Sort articles by root subject."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3212 (string-lessp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3213 (downcase (gnus-simplify-subject-re (mail-header-subject h1)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3214 (downcase (gnus-simplify-subject-re (mail-header-subject h2)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3215
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3216 (defun gnus-thread-sort-by-subject (h1 h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3217 "Sort threads by root subject."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3218 (gnus-article-sort-by-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3219 (gnus-thread-header h1) (gnus-thread-header h2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3220
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3221 (defsubst gnus-article-sort-by-date (h1 h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3222 "Sort articles by root article date."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3223 (gnus-time-less
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3224 (gnus-date-get-time (mail-header-date h1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3225 (gnus-date-get-time (mail-header-date h2))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3226
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3227 (defun gnus-thread-sort-by-date (h1 h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3228 "Sort threads by root article date."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3229 (gnus-article-sort-by-date
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3230 (gnus-thread-header h1) (gnus-thread-header h2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3231
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3232 (defsubst gnus-article-sort-by-score (h1 h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3233 "Sort articles by root article score.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3234 Unscored articles will be counted as having a score of zero."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3235 (> (or (cdr (assq (mail-header-number h1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3236 gnus-newsgroup-scored))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3237 gnus-summary-default-score 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3238 (or (cdr (assq (mail-header-number h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3239 gnus-newsgroup-scored))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3240 gnus-summary-default-score 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3241
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3242 (defun gnus-thread-sort-by-score (h1 h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3243 "Sort threads by root article score."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3244 (gnus-article-sort-by-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3245 (gnus-thread-header h1) (gnus-thread-header h2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3246
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3247 (defun gnus-thread-sort-by-total-score (h1 h2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3248 "Sort threads by the sum of all scores in the thread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3249 Unscored articles will be counted as having a score of zero."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3250 (> (gnus-thread-total-score h1) (gnus-thread-total-score h2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3251
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3252 (defun gnus-thread-total-score (thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3253 ;; This function find the total score of THREAD.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3254 (cond ((null thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3255 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3256 ((consp thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3257 (if (stringp (car thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3258 (apply gnus-thread-score-function 0
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3259 (mapcar 'gnus-thread-total-score-1 (cdr thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3260 (gnus-thread-total-score-1 thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3261 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3262 (gnus-thread-total-score-1 (list thread)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3263
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3264 (defun gnus-thread-total-score-1 (root)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3265 ;; This function find the total score of the thread below ROOT.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3266 (setq root (car root))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3267 (apply gnus-thread-score-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3268 (or (append
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3269 (mapcar 'gnus-thread-total-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3270 (cdr (gnus-gethash (mail-header-id root)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3271 gnus-newsgroup-dependencies)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3272 (when (> (mail-header-number root) 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3273 (list (or (cdr (assq (mail-header-number root)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3274 gnus-newsgroup-scored))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3275 gnus-summary-default-score 0))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3276 (list gnus-summary-default-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3277 '(0))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3278
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3279 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3280 (defvar gnus-tmp-prev-subject nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3281 (defvar gnus-tmp-false-parent nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3282 (defvar gnus-tmp-root-expunged nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3283 (defvar gnus-tmp-dummy-line nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3284
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3285 (defun gnus-summary-prepare-threads (threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3286 "Prepare summary buffer from THREADS and indentation LEVEL.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3287 THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3288 or a straight list of headers."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3289 (gnus-message 7 "Generating summary...")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3290
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3291 (setq gnus-newsgroup-threads threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3292 (beginning-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3293
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3294 (let ((gnus-tmp-level 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3295 (default-score (or gnus-summary-default-score 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3296 (gnus-visual-p (gnus-visual-p 'summary-highlight 'highlight))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3297 thread number subject stack state gnus-tmp-gathered beg-match
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3298 new-roots gnus-tmp-new-adopts thread-end
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3299 gnus-tmp-header gnus-tmp-unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3300 gnus-tmp-replied gnus-tmp-subject-or-nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3301 gnus-tmp-dummy gnus-tmp-indentation gnus-tmp-lines gnus-tmp-score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3302 gnus-tmp-score-char gnus-tmp-from gnus-tmp-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3303 gnus-tmp-number gnus-tmp-opening-bracket gnus-tmp-closing-bracket)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3304
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3305 (setq gnus-tmp-prev-subject nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3306
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3307 (if (vectorp (car threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3308 ;; If this is a straight (sic) list of headers, then a
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3309 ;; threaded summary display isn't required, so we just create
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3310 ;; an unthreaded one.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3311 (gnus-summary-prepare-unthreaded threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3312
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3313 ;; Do the threaded display.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3314
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3315 (while (or threads stack gnus-tmp-new-adopts new-roots)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3316
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3317 (if (and (= gnus-tmp-level 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3318 (not (setq gnus-tmp-dummy-line nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3319 (or (not stack)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3320 (= (caar stack) 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3321 (not gnus-tmp-false-parent)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3322 (or gnus-tmp-new-adopts new-roots))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3323 (if gnus-tmp-new-adopts
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3324 (setq gnus-tmp-level (if gnus-tmp-root-expunged 0 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3325 thread (list (car gnus-tmp-new-adopts))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3326 gnus-tmp-header (caar thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3327 gnus-tmp-new-adopts (cdr gnus-tmp-new-adopts))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3328 (when new-roots
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3329 (setq thread (list (car new-roots))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3330 gnus-tmp-header (caar thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3331 new-roots (cdr new-roots))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3332
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3333 (if threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3334 ;; If there are some threads, we do them before the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3335 ;; threads on the stack.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3336 (setq thread threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3337 gnus-tmp-header (caar thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3338 ;; There were no current threads, so we pop something off
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3339 ;; the stack.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3340 (setq state (car stack)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3341 gnus-tmp-level (car state)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3342 thread (cdr state)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3343 stack (cdr stack)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3344 gnus-tmp-header (caar thread))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3345
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3346 (setq gnus-tmp-false-parent nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3347 (setq gnus-tmp-root-expunged nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3348 (setq thread-end nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3349
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3350 (if (stringp gnus-tmp-header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3351 ;; The header is a dummy root.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3352 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3353 ((eq gnus-summary-make-false-root 'adopt)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3354 ;; We let the first article adopt the rest.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3355 (setq gnus-tmp-new-adopts (nconc gnus-tmp-new-adopts
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3356 (cddar thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3357 (setq gnus-tmp-gathered
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3358 (nconc (mapcar
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3359 (lambda (h) (mail-header-number (car h)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3360 (cddar thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3361 gnus-tmp-gathered))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3362 (setq thread (cons (list (caar thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3363 (cadar thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3364 (cdr thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3365 (setq gnus-tmp-level -1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3366 gnus-tmp-false-parent t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3367 ((eq gnus-summary-make-false-root 'empty)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3368 ;; We print adopted articles with empty subject fields.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3369 (setq gnus-tmp-gathered
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3370 (nconc (mapcar
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3371 (lambda (h) (mail-header-number (car h)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3372 (cddar thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3373 gnus-tmp-gathered))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3374 (setq gnus-tmp-level -1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3375 ((eq gnus-summary-make-false-root 'dummy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3376 ;; We remember that we probably want to output a dummy
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3377 ;; root.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3378 (setq gnus-tmp-dummy-line gnus-tmp-header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3379 (setq gnus-tmp-prev-subject gnus-tmp-header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3380 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3381 ;; We do not make a root for the gathered
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3382 ;; sub-threads at all.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3383 (setq gnus-tmp-level -1)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3384
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3385 (setq number (mail-header-number gnus-tmp-header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3386 subject (mail-header-subject gnus-tmp-header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3387
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3388 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3389 ;; If the thread has changed subject, we might want to make
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3390 ;; this subthread into a root.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3391 ((and (null gnus-thread-ignore-subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3392 (not (zerop gnus-tmp-level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3393 gnus-tmp-prev-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3394 (not (inline
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3395 (gnus-subject-equal gnus-tmp-prev-subject subject))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3396 (setq new-roots (nconc new-roots (list (car thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3397 thread-end t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3398 gnus-tmp-header nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3399 ;; If the article lies outside the current limit,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3400 ;; then we do not display it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3401 ((not (memq number gnus-newsgroup-limit))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3402 (setq gnus-tmp-gathered
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3403 (nconc (mapcar
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3404 (lambda (h) (mail-header-number (car h)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3405 (cdar thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3406 gnus-tmp-gathered))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3407 (setq gnus-tmp-new-adopts (if (cdar thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3408 (append gnus-tmp-new-adopts
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3409 (cdar thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3410 gnus-tmp-new-adopts)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3411 thread-end t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3412 gnus-tmp-header nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3413 (when (zerop gnus-tmp-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3414 (setq gnus-tmp-root-expunged t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3415 ;; Perhaps this article is to be marked as read?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3416 ((and gnus-summary-mark-below
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3417 (< (or (cdr (assq number gnus-newsgroup-scored))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3418 default-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3419 gnus-summary-mark-below)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3420 ;; Don't touch sparse articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3421 (not (gnus-summary-article-sparse-p number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3422 (not (gnus-summary-article-ancient-p number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3423 (setq gnus-newsgroup-unreads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3424 (delq number gnus-newsgroup-unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3425 (if gnus-newsgroup-auto-expire
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3426 (push number gnus-newsgroup-expirable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3427 (push (cons number gnus-low-score-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3428 gnus-newsgroup-reads))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3429
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3430 (when gnus-tmp-header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3431 ;; We may have an old dummy line to output before this
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3432 ;; article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3433 (when gnus-tmp-dummy-line
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3434 (gnus-summary-insert-dummy-line
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3435 gnus-tmp-dummy-line (mail-header-number gnus-tmp-header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3436 (setq gnus-tmp-dummy-line nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3437
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3438 ;; Compute the mark.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3439 (setq gnus-tmp-unread (gnus-article-mark number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3440
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3441 (push (gnus-data-make number gnus-tmp-unread (1+ (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3442 gnus-tmp-header gnus-tmp-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3443 gnus-newsgroup-data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3444
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3445 ;; Actually insert the line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3446 (setq
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3447 gnus-tmp-subject-or-nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3448 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3449 ((and gnus-thread-ignore-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3450 gnus-tmp-prev-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3451 (not (inline (gnus-subject-equal
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3452 gnus-tmp-prev-subject subject))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3453 subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3454 ((zerop gnus-tmp-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3455 (if (and (eq gnus-summary-make-false-root 'empty)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3456 (memq number gnus-tmp-gathered)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3457 gnus-tmp-prev-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3458 (inline (gnus-subject-equal
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3459 gnus-tmp-prev-subject subject)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3460 gnus-summary-same-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3461 subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3462 (t gnus-summary-same-subject)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3463 (if (and (eq gnus-summary-make-false-root 'adopt)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3464 (= gnus-tmp-level 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3465 (memq number gnus-tmp-gathered))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3466 (setq gnus-tmp-opening-bracket ?\<
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3467 gnus-tmp-closing-bracket ?\>)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3468 (setq gnus-tmp-opening-bracket ?\[
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3469 gnus-tmp-closing-bracket ?\]))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3470 (setq
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3471 gnus-tmp-indentation
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3472 (aref gnus-thread-indent-array gnus-tmp-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3473 gnus-tmp-lines (mail-header-lines gnus-tmp-header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3474 gnus-tmp-score (or (cdr (assq number gnus-newsgroup-scored))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3475 gnus-summary-default-score 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3476 gnus-tmp-score-char
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3477 (if (or (null gnus-summary-default-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3478 (<= (abs (- gnus-tmp-score gnus-summary-default-score))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3479 gnus-summary-zcore-fuzz))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3480 ?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3481 (if (< gnus-tmp-score gnus-summary-default-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3482 gnus-score-below-mark gnus-score-over-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3483 gnus-tmp-replied
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3484 (cond ((memq number gnus-newsgroup-processable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3485 gnus-process-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3486 ((memq number gnus-newsgroup-cached)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3487 gnus-cached-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3488 ((memq number gnus-newsgroup-replied)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3489 gnus-replied-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3490 ((memq number gnus-newsgroup-saved)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3491 gnus-saved-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3492 (t gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3493 gnus-tmp-from (mail-header-from gnus-tmp-header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3494 gnus-tmp-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3495 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3496 ((string-match "<[^>]+> *$" gnus-tmp-from)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3497 (setq beg-match (match-beginning 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3498 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3499 (substring gnus-tmp-from (1+ (match-beginning 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3500 (1- (match-end 0))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3501 (substring gnus-tmp-from 0 beg-match)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3502 ((string-match "(.+)" gnus-tmp-from)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3503 (substring gnus-tmp-from
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3504 (1+ (match-beginning 0)) (1- (match-end 0))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3505 (t gnus-tmp-from)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3506 (when (string= gnus-tmp-name "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3507 (setq gnus-tmp-name gnus-tmp-from))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3508 (unless (numberp gnus-tmp-lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3509 (setq gnus-tmp-lines 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3510 (gnus-put-text-property
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3511 (point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3512 (progn (eval gnus-summary-line-format-spec) (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3513 'gnus-number number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3514 (when gnus-visual-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3515 (forward-line -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3516 (run-hooks 'gnus-summary-update-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3517 (forward-line 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3518
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3519 (setq gnus-tmp-prev-subject subject)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3520
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3521 (when (nth 1 thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3522 (push (cons (max 0 gnus-tmp-level) (nthcdr 1 thread)) stack))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3523 (incf gnus-tmp-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3524 (setq threads (if thread-end nil (cdar thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3525 (unless threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3526 (setq gnus-tmp-level 0)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3527 (gnus-message 7 "Generating summary...done"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3528
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3529 (defun gnus-summary-prepare-unthreaded (headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3530 "Generate an unthreaded summary buffer based on HEADERS."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3531 (let (header number mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3532
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3533 (while headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3534 ;; We may have to root out some bad articles...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3535 (when (memq (setq number (mail-header-number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3536 (setq header (pop headers))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3537 gnus-newsgroup-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3538 ;; Mark article as read when it has a low score.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3539 (when (and gnus-summary-mark-below
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3540 (< (or (cdr (assq number gnus-newsgroup-scored))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3541 gnus-summary-default-score 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3542 gnus-summary-mark-below)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3543 (not (gnus-summary-article-ancient-p number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3544 (setq gnus-newsgroup-unreads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3545 (delq number gnus-newsgroup-unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3546 (if gnus-newsgroup-auto-expire
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3547 (push number gnus-newsgroup-expirable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3548 (push (cons number gnus-low-score-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3549 gnus-newsgroup-reads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3550
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3551 (setq mark (gnus-article-mark number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3552 (push (gnus-data-make number mark (1+ (point)) header 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3553 gnus-newsgroup-data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3554 (gnus-summary-insert-line
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3555 header 0 number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3556 mark (memq number gnus-newsgroup-replied)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3557 (memq number gnus-newsgroup-expirable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3558 (mail-header-subject header) nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3559 (cdr (assq number gnus-newsgroup-scored))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3560 (memq number gnus-newsgroup-processable))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3561
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3562 (defun gnus-select-newsgroup (group &optional read-all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3563 "Select newsgroup GROUP.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3564 If READ-ALL is non-nil, all articles in the group are selected."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3565 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3566 (info (nth 2 entry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3567 articles fetched-articles cached)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3568
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3569 (unless (gnus-check-server
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3570 (setq gnus-current-select-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3571 (gnus-find-method-for-group group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3572 (error "Couldn't open server"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3573
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3574 (or (and entry (not (eq (car entry) t))) ; Either it's active...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3575 (gnus-activate-group group) ; Or we can activate it...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3576 (progn ; Or we bug out.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3577 (when (equal major-mode 'gnus-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3578 (kill-buffer (current-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3579 (error "Couldn't request group %s: %s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3580 group (gnus-status-message group))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3581
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3582 (unless (gnus-request-group group t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3583 (when (equal major-mode 'gnus-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3584 (kill-buffer (current-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3585 (error "Couldn't request group %s: %s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3586 group (gnus-status-message group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3587
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3588 (setq gnus-newsgroup-name group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3589 (setq gnus-newsgroup-unselected nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3590 (setq gnus-newsgroup-unreads (gnus-list-of-unread-articles group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3591
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3592 ;; Adjust and set lists of article marks.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3593 (when info
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3594 (gnus-adjust-marked-articles info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3595
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3596 ;; Kludge to avoid having cached articles nixed out in virtual groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3597 (when (gnus-virtual-group-p group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3598 (setq cached gnus-newsgroup-cached))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3599
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3600 (setq gnus-newsgroup-unreads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3601 (gnus-set-difference
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3602 (gnus-set-difference gnus-newsgroup-unreads gnus-newsgroup-marked)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3603 gnus-newsgroup-dormant))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3604
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3605 (setq gnus-newsgroup-processable nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3606
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3607 (setq articles (gnus-articles-to-read group read-all))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3608
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3609 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3610 ((null articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3611 ;;(gnus-message 3 "Couldn't select newsgroup -- no articles to display")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3612 'quit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3613 ((eq articles 0) nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3614 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3615 ;; Init the dependencies hash table.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3616 (setq gnus-newsgroup-dependencies
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3617 (gnus-make-hashtable (length articles)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3618 ;; Retrieve the headers and read them in.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3619 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3620 (setq gnus-newsgroup-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3621 (if (eq 'nov
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3622 (setq gnus-headers-retrieved-by
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3623 (gnus-retrieve-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3624 articles gnus-newsgroup-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3625 ;; We might want to fetch old headers, but
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3626 ;; not if there is only 1 article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3627 (and gnus-fetch-old-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3628 (or (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3629 (not (eq gnus-fetch-old-headers 'some))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3630 (not (numberp gnus-fetch-old-headers)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3631 (> (length articles) 1))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3632 (gnus-get-newsgroup-headers-xover
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3633 articles nil nil gnus-newsgroup-name t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3634 (gnus-get-newsgroup-headers)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3635 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3636
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3637 ;; Kludge to avoid having cached articles nixed out in virtual groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3638 (when cached
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3639 (setq gnus-newsgroup-cached cached))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3640
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3641 ;; Suppress duplicates?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3642 (when gnus-suppress-duplicates
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3643 (gnus-dup-suppress-articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3644
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3645 ;; Set the initial limit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3646 (setq gnus-newsgroup-limit (copy-sequence articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3647 ;; Remove canceled articles from the list of unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3648 (setq gnus-newsgroup-unreads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3649 (gnus-set-sorted-intersection
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3650 gnus-newsgroup-unreads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3651 (setq fetched-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3652 (mapcar (lambda (headers) (mail-header-number headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3653 gnus-newsgroup-headers))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3654 ;; Removed marked articles that do not exist.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3655 (gnus-update-missing-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3656 (gnus-sorted-complement fetched-articles articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3657 ;; We might want to build some more threads first.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3658 (and gnus-fetch-old-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3659 (eq gnus-headers-retrieved-by 'nov)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3660 (gnus-build-old-threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3661 ;; Check whether auto-expire is to be done in this group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3662 (setq gnus-newsgroup-auto-expire
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3663 (gnus-group-auto-expirable-p group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3664 ;; Set up the article buffer now, if necessary.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3665 (unless gnus-single-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3666 (gnus-article-setup-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3667 ;; First and last article in this newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3668 (when gnus-newsgroup-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3669 (setq gnus-newsgroup-begin
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3670 (mail-header-number (car gnus-newsgroup-headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3671 gnus-newsgroup-end
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3672 (mail-header-number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3673 (gnus-last-element gnus-newsgroup-headers))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3674 ;; GROUP is successfully selected.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3675 (or gnus-newsgroup-headers t)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3676
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3677 (defun gnus-articles-to-read (group &optional read-all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3678 ;; Find out what articles the user wants to read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3679 (let* ((articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3680 ;; Select all articles if `read-all' is non-nil, or if there
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3681 ;; are no unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3682 (if (or read-all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3683 (and (zerop (length gnus-newsgroup-marked))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3684 (zerop (length gnus-newsgroup-unreads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3685 (eq (gnus-group-find-parameter group 'display)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3686 'all))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3687 (gnus-uncompress-range (gnus-active group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3688 (sort (append gnus-newsgroup-dormant gnus-newsgroup-marked
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3689 (copy-sequence gnus-newsgroup-unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3690 '<)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3691 (scored-list (gnus-killed-articles gnus-newsgroup-killed articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3692 (scored (length scored-list))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3693 (number (length articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3694 (marked (+ (length gnus-newsgroup-marked)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3695 (length gnus-newsgroup-dormant)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3696 (select
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3697 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3698 ((numberp read-all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3699 read-all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3700 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3701 (condition-case ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3702 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3703 ((and (or (<= scored marked) (= scored number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3704 (numberp gnus-large-newsgroup)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3705 (> number gnus-large-newsgroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3706 (let ((input
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3707 (read-string
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3708 (format
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3709 "How many articles from %s (default %d): "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3710 (gnus-limit-string gnus-newsgroup-name 35)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3711 number))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3712 (if (string-match "^[ \t]*$" input) number input)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3713 ((and (> scored marked) (< scored number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3714 (> (- scored number) 20))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3715 (let ((input
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3716 (read-string
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3717 (format "%s %s (%d scored, %d total): "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3718 "How many articles from"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3719 group scored number))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3720 (if (string-match "^[ \t]*$" input)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3721 number input)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3722 (t number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3723 (quit nil))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3724 (setq select (if (stringp select) (string-to-number select) select))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3725 (if (or (null select) (zerop select))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3726 select
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3727 (if (and (not (zerop scored)) (<= (abs select) scored))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3728 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3729 (setq articles (sort scored-list '<))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3730 (setq number (length articles)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3731 (setq articles (copy-sequence articles)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3732
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3733 (when (< (abs select) number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3734 (if (< select 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3735 ;; Select the N oldest articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3736 (setcdr (nthcdr (1- (abs select)) articles) nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3737 ;; Select the N most recent articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3738 (setq articles (nthcdr (- number select) articles))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3739 (setq gnus-newsgroup-unselected
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3740 (gnus-sorted-intersection
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3741 gnus-newsgroup-unreads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3742 (gnus-sorted-complement gnus-newsgroup-unreads articles)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3743 articles)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3744
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3745 (defun gnus-killed-articles (killed articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3746 (let (out)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3747 (while articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3748 (when (inline (gnus-member-of-range (car articles) killed))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3749 (push (car articles) out))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3750 (setq articles (cdr articles)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3751 out))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3752
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3753 (defun gnus-uncompress-marks (marks)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3754 "Uncompress the mark ranges in MARKS."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3755 (let ((uncompressed '(score bookmark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3756 out)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3757 (while marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3758 (if (memq (caar marks) uncompressed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3759 (push (car marks) out)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3760 (push (cons (caar marks) (gnus-uncompress-range (cdar marks))) out))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3761 (setq marks (cdr marks)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3762 out))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3763
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3764 (defun gnus-adjust-marked-articles (info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3765 "Set all article lists and remove all marks that are no longer legal."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3766 (let* ((marked-lists (gnus-info-marks info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3767 (active (gnus-active (gnus-info-group info)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3768 (min (car active))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3769 (max (cdr active))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3770 (types gnus-article-mark-lists)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3771 (uncompressed '(score bookmark killed))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3772 marks var articles article mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3773
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3774 (while marked-lists
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3775 (setq marks (pop marked-lists))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3776 (set (setq var (intern (format "gnus-newsgroup-%s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3777 (car (rassq (setq mark (car marks))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3778 types)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3779 (if (memq (car marks) uncompressed) (cdr marks)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3780 (gnus-uncompress-range (cdr marks))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3781
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3782 (setq articles (symbol-value var))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3783
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3784 ;; All articles have to be subsets of the active articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3785 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3786 ;; Adjust "simple" lists.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3787 ((memq mark '(tick dormant expirable reply save))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3788 (while articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3789 (when (or (< (setq article (pop articles)) min) (> article max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3790 (set var (delq article (symbol-value var))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3791 ;; Adjust assocs.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3792 ((memq mark uncompressed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3793 (while articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3794 (when (or (not (consp (setq article (pop articles))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3795 (< (car article) min)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3796 (> (car article) max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3797 (set var (delq article (symbol-value var))))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3798
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3799 (defun gnus-update-missing-marks (missing)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3800 "Go through the list of MISSING articles and remove them mark lists."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3801 (when missing
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3802 (let ((types gnus-article-mark-lists)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3803 var m)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3804 ;; Go through all types.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3805 (while types
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3806 (setq var (intern (format "gnus-newsgroup-%s" (car (pop types)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3807 (when (symbol-value var)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3808 ;; This list has articles. So we delete all missing articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3809 ;; from it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3810 (setq m missing)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3811 (while m
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3812 (set var (delq (pop m) (symbol-value var)))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3813
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3814 (defun gnus-update-marks ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3815 "Enter the various lists of marked articles into the newsgroup info list."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3816 (let ((types gnus-article-mark-lists)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3817 (info (gnus-get-info gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3818 (uncompressed '(score bookmark killed))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3819 type list newmarked symbol)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3820 (when info
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3821 ;; Add all marks lists that are non-nil to the list of marks lists.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3822 (while types
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3823 (setq type (pop types))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3824 (when (setq list (symbol-value
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3825 (setq symbol
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3826 (intern (format "gnus-newsgroup-%s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3827 (car type))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3828 (push (cons (cdr type)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3829 (if (memq (cdr type) uncompressed) list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3830 (gnus-compress-sequence
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3831 (set symbol (sort list '<)) t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3832 newmarked)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3833
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3834 ;; Enter these new marks into the info of the group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3835 (if (nthcdr 3 info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3836 (setcar (nthcdr 3 info) newmarked)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3837 ;; Add the marks lists to the end of the info.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3838 (when newmarked
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3839 (setcdr (nthcdr 2 info) (list newmarked))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3840
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3841 ;; Cut off the end of the info if there's nothing else there.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3842 (let ((i 5))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3843 (while (and (> i 2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3844 (not (nth i info)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3845 (when (nthcdr (decf i) info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3846 (setcdr (nthcdr i info) nil)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3847
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3848 (defun gnus-set-mode-line (where)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3849 "This function sets the mode line of the article or summary buffers.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3850 If WHERE is `summary', the summary mode line format will be used."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3851 ;; Is this mode line one we keep updated?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3852 (when (memq where gnus-updated-mode-lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3853 (let (mode-string)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3854 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3855 ;; We evaluate this in the summary buffer since these
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3856 ;; variables are buffer-local to that buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3857 (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3858 ;; We bind all these variables that are used in the `eval' form
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3859 ;; below.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3860 (let* ((mformat (symbol-value
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3861 (intern
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3862 (format "gnus-%s-mode-line-format-spec" where))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3863 (gnus-tmp-group-name gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3864 (gnus-tmp-article-number (or gnus-current-article 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3865 (gnus-tmp-unread gnus-newsgroup-unreads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3866 (gnus-tmp-unread-and-unticked (length gnus-newsgroup-unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3867 (gnus-tmp-unselected (length gnus-newsgroup-unselected))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3868 (gnus-tmp-unread-and-unselected
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3869 (cond ((and (zerop gnus-tmp-unread-and-unticked)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3870 (zerop gnus-tmp-unselected))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3871 "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3872 ((zerop gnus-tmp-unselected)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3873 (format "{%d more}" gnus-tmp-unread-and-unticked))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3874 (t (format "{%d(+%d) more}"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3875 gnus-tmp-unread-and-unticked
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3876 gnus-tmp-unselected))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3877 (gnus-tmp-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3878 (if (and gnus-current-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3879 (vectorp gnus-current-headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3880 (gnus-mode-string-quote
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3881 (mail-header-subject gnus-current-headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3882 ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3883 max-len
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3884 gnus-tmp-header);; passed as argument to any user-format-funcs
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3885 (setq mode-string (eval mformat))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3886 (setq max-len (max 4 (if gnus-mode-non-string-length
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3887 (- (window-width)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3888 gnus-mode-non-string-length)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3889 (length mode-string))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3890 ;; We might have to chop a bit of the string off...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3891 (when (> (length mode-string) max-len)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3892 (setq mode-string
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3893 (concat (gnus-truncate-string mode-string (- max-len 3))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3894 "...")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3895 ;; Pad the mode string a bit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3896 (setq mode-string (format (format "%%-%ds" max-len) mode-string))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3897 ;; Update the mode line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3898 (setq mode-line-buffer-identification
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3899 (gnus-mode-line-buffer-identification
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3900 (list mode-string)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3901 (set-buffer-modified-p t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3902
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3903 (defun gnus-create-xref-hashtb (from-newsgroup headers unreads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3904 "Go through the HEADERS list and add all Xrefs to a hash table.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3905 The resulting hash table is returned, or nil if no Xrefs were found."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3906 (let* ((virtual (gnus-virtual-group-p from-newsgroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3907 (prefix (if virtual "" (gnus-group-real-prefix from-newsgroup)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3908 (xref-hashtb (gnus-make-hashtable))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3909 start group entry number xrefs header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3910 (while headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3911 (setq header (pop headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3912 (when (and (setq xrefs (mail-header-xref header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3913 (not (memq (setq number (mail-header-number header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3914 unreads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3915 (setq start 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3916 (while (string-match "\\([^ ]+\\)[:/]\\([0-9]+\\)" xrefs start)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3917 (setq start (match-end 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3918 (setq group (if prefix
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3919 (concat prefix (substring xrefs (match-beginning 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3920 (match-end 1)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3921 (substring xrefs (match-beginning 1) (match-end 1))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3922 (setq number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3923 (string-to-int (substring xrefs (match-beginning 2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3924 (match-end 2))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3925 (if (setq entry (gnus-gethash group xref-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3926 (setcdr entry (cons number (cdr entry)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3927 (gnus-sethash group (cons number nil) xref-hashtb)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3928 (and start xref-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3929
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3930 (defun gnus-mark-xrefs-as-read (from-newsgroup headers unreads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3931 "Look through all the headers and mark the Xrefs as read."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3932 (let ((virtual (gnus-virtual-group-p from-newsgroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3933 name entry info xref-hashtb idlist method nth4)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3934 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3935 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3936 (when (setq xref-hashtb
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3937 (gnus-create-xref-hashtb from-newsgroup headers unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3938 (mapatoms
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3939 (lambda (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3940 (unless (string= from-newsgroup (setq name (symbol-name group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3941 (setq idlist (symbol-value group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3942 ;; Dead groups are not updated.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3943 (and (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3944 (setq entry (gnus-gethash name gnus-newsrc-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3945 info (nth 2 entry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3946 (when (stringp (setq nth4 (gnus-info-method info)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3947 (setq nth4 (gnus-server-to-method nth4))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3948 ;; Only do the xrefs if the group has the same
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3949 ;; select method as the group we have just read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3950 (or (gnus-methods-equal-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3951 nth4 (gnus-find-method-for-group from-newsgroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3952 virtual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3953 (equal nth4 (setq method (gnus-find-method-for-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3954 from-newsgroup)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3955 (and (equal (car nth4) (car method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3956 (equal (nth 1 nth4) (nth 1 method))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3957 gnus-use-cross-reference
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3958 (or (not (eq gnus-use-cross-reference t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3959 virtual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3960 ;; Only do cross-references on subscribed
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3961 ;; groups, if that is what is wanted.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3962 (<= (gnus-info-level info) gnus-level-subscribed))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3963 (gnus-group-make-articles-read name idlist))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3964 xref-hashtb)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3965
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3966 (defun gnus-group-make-articles-read (group articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3967 "Update the info of GROUP to say that only ARTICLES are unread."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3968 (let* ((num 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3969 (entry (gnus-gethash group gnus-newsrc-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3970 (info (nth 2 entry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3971 (active (gnus-active group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3972 range)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3973 ;; First peel off all illegal article numbers.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3974 (when active
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3975 (let ((ids articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3976 id first)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3977 (while (setq id (pop ids))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3978 (when (and first (> id (cdr active)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3979 ;; We'll end up in this situation in one particular
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3980 ;; obscure situation. If you re-scan a group and get
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3981 ;; a new article that is cross-posted to a different
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3982 ;; group that has not been re-scanned, you might get
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3983 ;; crossposted article that has a higher number than
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3984 ;; Gnus believes possible. So we re-activate this
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3985 ;; group as well. This might mean doing the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3986 ;; crossposting thingy will *increase* the number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3987 ;; of articles in some groups. Tsk, tsk.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3988 (setq active (or (gnus-activate-group group) active)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3989 (when (or (> id (cdr active))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3990 (< id (car active)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3991 (setq articles (delq id articles))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3992 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3993 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3994 (gnus-undo-register
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3995 `(progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3996 (gnus-info-set-marks ',info ',(gnus-info-marks info) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3997 (gnus-info-set-read ',info ',(gnus-info-read info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3998 (gnus-get-unread-articles-in-group ',info (gnus-active ,group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
3999 (gnus-group-update-group ,group t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4000 ;; If the read list is nil, we init it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4001 (and active
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4002 (null (gnus-info-read info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4003 (> (car active) 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4004 (gnus-info-set-read info (cons 1 (1- (car active)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4005 ;; Then we add the read articles to the range.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4006 (gnus-info-set-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4007 info
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4008 (setq range
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4009 (gnus-add-to-range
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4010 (gnus-info-read info) (setq articles (sort articles '<)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4011 ;; Then we have to re-compute how many unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4012 ;; articles there are in this group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4013 (when active
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4014 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4015 ((not range)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4016 (setq num (- (1+ (cdr active)) (car active))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4017 ((not (listp (cdr range)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4018 (setq num (- (cdr active) (- (1+ (cdr range))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4019 (car range)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4020 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4021 (while range
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4022 (if (numberp (car range))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4023 (setq num (1+ num))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4024 (setq num (+ num (- (1+ (cdar range)) (caar range)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4025 (setq range (cdr range)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4026 (setq num (- (cdr active) num))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4027 ;; Update the number of unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4028 (setcar entry num)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4029 ;; Update the group buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4030 (gnus-group-update-group group t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4031
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4032 (defun gnus-methods-equal-p (m1 m2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4033 (let ((m1 (or m1 gnus-select-method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4034 (m2 (or m2 gnus-select-method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4035 (or (equal m1 m2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4036 (and (eq (car m1) (car m2))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4037 (or (not (memq 'address (assoc (symbol-name (car m1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4038 gnus-valid-select-methods)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4039 (equal (nth 1 m1) (nth 1 m2)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4040
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4041 (defvar gnus-newsgroup-none-id 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4042
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4043 (defun gnus-get-newsgroup-headers (&optional dependencies force-new)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4044 (let ((cur nntp-server-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4045 (dependencies
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4046 (or dependencies
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4047 (save-excursion (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4048 gnus-newsgroup-dependencies)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4049 headers id id-dep ref-dep end ref)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4050 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4051 (set-buffer nntp-server-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4052 ;; Translate all TAB characters into SPACE characters.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4053 (subst-char-in-region (point-min) (point-max) ?\t ? t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4054 (run-hooks 'gnus-parse-headers-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4055 (let ((case-fold-search t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4056 in-reply-to header p lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4057 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4058 ;; Search to the beginning of the next header. Error messages
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4059 ;; do not begin with 2 or 3.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4060 (while (re-search-forward "^[23][0-9]+ " nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4061 (setq id nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4062 ref nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4063 ;; This implementation of this function, with nine
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4064 ;; search-forwards instead of the one re-search-forward and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4065 ;; a case (which basically was the old function) is actually
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4066 ;; about twice as fast, even though it looks messier. You
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4067 ;; can't have everything, I guess. Speed and elegance
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4068 ;; doesn't always go hand in hand.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4069 (setq
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4070 header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4071 (vector
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4072 ;; Number.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4073 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4074 (read cur)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4075 (end-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4076 (setq p (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4077 (narrow-to-region (point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4078 (or (and (search-forward "\n.\n" nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4079 (- (point) 2))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4080 (point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4081 ;; Subject.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4082 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4083 (goto-char p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4084 (if (search-forward "\nsubject: " nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4085 (nnheader-header-value) "(none)"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4086 ;; From.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4087 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4088 (goto-char p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4089 (if (search-forward "\nfrom: " nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4090 (nnheader-header-value) "(nobody)"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4091 ;; Date.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4092 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4093 (goto-char p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4094 (if (search-forward "\ndate: " nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4095 (nnheader-header-value) ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4096 ;; Message-ID.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4097 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4098 (goto-char p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4099 (setq id (if (search-forward "\nmessage-id: " nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4100 (nnheader-header-value)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4101 ;; If there was no message-id, we just fake one
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4102 ;; to make subsequent routines simpler.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4103 (nnheader-generate-fake-message-id))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4104 ;; References.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4105 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4106 (goto-char p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4107 (if (search-forward "\nreferences: " nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4108 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4109 (setq end (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4110 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4111 (nnheader-header-value)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4112 (setq ref
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4113 (buffer-substring
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4114 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4115 (end-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4116 (search-backward ">" end t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4117 (1+ (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4118 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4119 (search-backward "<" end t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4120 (point))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4121 ;; Get the references from the in-reply-to header if there
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4122 ;; were no references and the in-reply-to header looks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4123 ;; promising.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4124 (if (and (search-forward "\nin-reply-to: " nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4125 (setq in-reply-to (nnheader-header-value))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4126 (string-match "<[^>]+>" in-reply-to))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4127 (setq ref (substring in-reply-to (match-beginning 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4128 (match-end 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4129 (setq ref nil))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4130 ;; Chars.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4131 0
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4132 ;; Lines.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4133 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4134 (goto-char p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4135 (if (search-forward "\nlines: " nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4136 (if (numberp (setq lines (read cur)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4137 lines 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4138 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4139 ;; Xref.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4140 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4141 (goto-char p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4142 (and (search-forward "\nxref: " nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4143 (nnheader-header-value)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4144 (when (equal id ref)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4145 (setq ref nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4146 ;; We do the threading while we read the headers. The
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4147 ;; message-id and the last reference are both entered into
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4148 ;; the same hash table. Some tippy-toeing around has to be
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4149 ;; done in case an article has arrived before the article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4150 ;; which it refers to.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4151 (if (boundp (setq id-dep (intern id dependencies)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4152 (if (and (car (symbol-value id-dep))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4153 (not force-new))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4154 ;; An article with this Message-ID has already
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4155 ;; been seen, so we ignore this one, except we add
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4156 ;; any additional Xrefs (in case the two articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4157 ;; came from different servers).
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4158 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4159 (mail-header-set-xref
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4160 (car (symbol-value id-dep))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4161 (concat (or (mail-header-xref
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4162 (car (symbol-value id-dep)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4163 "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4164 (or (mail-header-xref header) "")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4165 (setq header nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4166 (setcar (symbol-value id-dep) header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4167 (set id-dep (list header)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4168 (when header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4169 (if (boundp (setq ref-dep (intern (or ref "none") dependencies)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4170 (setcdr (symbol-value ref-dep)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4171 (nconc (cdr (symbol-value ref-dep))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4172 (list (symbol-value id-dep))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4173 (set ref-dep (list nil (symbol-value id-dep))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4174 (push header headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4175 (goto-char (point-max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4176 (widen))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4177 (nreverse headers)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4178
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4179 ;; The following macros and functions were written by Felix Lee
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4180 ;; <flee@cse.psu.edu>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4181
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4182 (defmacro gnus-nov-read-integer ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4183 '(prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4184 (if (= (following-char) ?\t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4185 0
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4186 (let ((num (ignore-errors (read buffer))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4187 (if (numberp num) num 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4188 (unless (eobp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4189 (forward-char 1))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4190
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4191 (defmacro gnus-nov-skip-field ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4192 '(search-forward "\t" eol 'move))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4193
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4194 (defmacro gnus-nov-field ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4195 '(buffer-substring (point) (if (gnus-nov-skip-field) (1- (point)) eol)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4196
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4197 ;; (defvar gnus-nov-none-counter 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4198
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4199 ;; This function has to be called with point after the article number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4200 ;; on the beginning of the line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4201 (defun gnus-nov-parse-line (number dependencies &optional force-new)
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
4202 (let ((eol (gnus-point-at-eol))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4203 (buffer (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4204 header ref id id-dep ref-dep)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4205
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4206 ;; overview: [num subject from date id refs chars lines misc]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4207 (unwind-protect
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4208 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4209 (narrow-to-region (point) eol)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4210 (unless (eobp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4211 (forward-char))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4212
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4213 (setq header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4214 (vector
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4215 number ; number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4216 (gnus-nov-field) ; subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4217 (gnus-nov-field) ; from
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4218 (gnus-nov-field) ; date
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4219 (setq id (or (gnus-nov-field)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4220 (nnheader-generate-fake-message-id))) ; id
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4221 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4222 (let ((beg (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4223 (search-forward "\t" eol)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4224 (if (search-backward ">" beg t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4225 (setq ref
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4226 (buffer-substring
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4227 (1+ (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4228 (search-backward "<" beg t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4229 (setq ref nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4230 (goto-char beg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4231 (gnus-nov-field)) ; refs
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4232 (gnus-nov-read-integer) ; chars
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4233 (gnus-nov-read-integer) ; lines
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4234 (if (= (following-char) ?\n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4235 nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4236 (gnus-nov-field)) ; misc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4237 )))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4238
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4239 (widen))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4240
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4241 ;; We build the thread tree.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4242 (when (equal id ref)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4243 ;; This article refers back to itself. Naughty, naughty.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4244 (setq ref nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4245 (if (boundp (setq id-dep (intern id dependencies)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4246 (if (and (car (symbol-value id-dep))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4247 (not force-new))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4248 ;; An article with this Message-ID has already been seen,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4249 ;; so we ignore this one, except we add any additional
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4250 ;; Xrefs (in case the two articles came from different
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4251 ;; servers.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4252 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4253 (mail-header-set-xref
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4254 (car (symbol-value id-dep))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4255 (concat (or (mail-header-xref
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4256 (car (symbol-value id-dep)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4257 "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4258 (or (mail-header-xref header) "")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4259 (setq header nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4260 (setcar (symbol-value id-dep) header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4261 (set id-dep (list header)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4262 (when header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4263 (if (boundp (setq ref-dep (intern (or ref "none") dependencies)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4264 (setcdr (symbol-value ref-dep)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4265 (nconc (cdr (symbol-value ref-dep))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4266 (list (symbol-value id-dep))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4267 (set ref-dep (list nil (symbol-value id-dep)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4268 header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4269
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4270 ;; Goes through the xover lines and returns a list of vectors
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4271 (defun gnus-get-newsgroup-headers-xover (sequence &optional
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4272 force-new dependencies
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4273 group also-fetch-heads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4274 "Parse the news overview data in the server buffer, and return a
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4275 list of headers that match SEQUENCE (see `nntp-retrieve-headers')."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4276 ;; Get the Xref when the users reads the articles since most/some
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4277 ;; NNTP servers do not include Xrefs when using XOVER.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4278 (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4279 (let ((cur nntp-server-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4280 (dependencies (or dependencies gnus-newsgroup-dependencies))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4281 number headers header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4282 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4283 (set-buffer nntp-server-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4284 ;; Allow the user to mangle the headers before parsing them.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4285 (run-hooks 'gnus-parse-headers-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4286 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4287 (while (not (eobp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4288 (condition-case ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4289 (while (and sequence (not (eobp)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4290 (setq number (read cur))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4291 (while (and sequence
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4292 (< (car sequence) number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4293 (setq sequence (cdr sequence)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4294 (and sequence
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4295 (eq number (car sequence))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4296 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4297 (setq sequence (cdr sequence))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4298 (setq header (inline
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4299 (gnus-nov-parse-line
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4300 number dependencies force-new))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4301 (push header headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4302 (forward-line 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4303 (error
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4304 (gnus-error 4 "Strange nov line (%d)"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4305 (count-lines (point-min) (point)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4306 (forward-line 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4307 ;; A common bug in inn is that if you have posted an article and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4308 ;; then retrieves the active file, it will answer correctly --
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4309 ;; the new article is included. However, a NOV entry for the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4310 ;; article may not have been generated yet, so this may fail.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4311 ;; We work around this problem by retrieving the last few
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4312 ;; headers using HEAD.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4313 (if (or (not also-fetch-heads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4314 (not sequence))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4315 (nreverse headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4316 (let ((gnus-nov-is-evil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4317 (nntp-nov-is-evil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4318 (nconc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4319 (nreverse headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4320 (when (gnus-retrieve-headers sequence group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4321 (gnus-get-newsgroup-headers))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4322
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4323 (defun gnus-article-get-xrefs ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4324 "Fill in the Xref value in `gnus-current-headers', if necessary.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4325 This is meant to be called in `gnus-article-internal-prepare-hook'."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4326 (let ((headers (save-excursion (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4327 gnus-current-headers)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4328 (or (not gnus-use-cross-reference)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4329 (not headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4330 (and (mail-header-xref headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4331 (not (string= (mail-header-xref headers) "")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4332 (let ((case-fold-search t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4333 xref)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4334 (save-restriction
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4335 (nnheader-narrow-to-headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4336 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4337 (when (or (and (eq (downcase (following-char)) ?x)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4338 (looking-at "Xref:"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4339 (search-forward "\nXref:" nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4340 (goto-char (1+ (match-end 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4341 (setq xref (buffer-substring (point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4342 (progn (end-of-line) (point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4343 (mail-header-set-xref headers xref)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4344
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4345 (defun gnus-summary-insert-subject (id &optional old-header use-old-header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4346 "Find article ID and insert the summary line for that article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4347 (let ((header (if (and old-header use-old-header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4348 old-header (gnus-read-header id)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4349 (number (and (numberp id) id))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4350 pos d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4351 (when header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4352 ;; Rebuild the thread that this article is part of and go to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4353 ;; article we have fetched.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4354 (when (and (not gnus-show-threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4355 old-header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4356 (when (setq d (gnus-data-find (mail-header-number old-header)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4357 (goto-char (gnus-data-pos d))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4358 (gnus-data-remove
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4359 number
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
4360 (- (gnus-point-at-bol)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4361 (prog1
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
4362 (1+ (gnus-point-at-eol))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4363 (gnus-delete-line))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4364 (when old-header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4365 (mail-header-set-number header (mail-header-number old-header)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4366 (setq gnus-newsgroup-sparse
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4367 (delq (setq number (mail-header-number header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4368 gnus-newsgroup-sparse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4369 (setq gnus-newsgroup-ancient (delq number gnus-newsgroup-ancient))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4370 (gnus-rebuild-thread (mail-header-id header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4371 (gnus-summary-goto-subject number nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4372 (when (and (numberp number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4373 (> number 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4374 ;; We have to update the boundaries even if we can't fetch the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4375 ;; article if ID is a number -- so that the next `P' or `N'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4376 ;; command will fetch the previous (or next) article even
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4377 ;; if the one we tried to fetch this time has been canceled.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4378 (when (> number gnus-newsgroup-end)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4379 (setq gnus-newsgroup-end number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4380 (when (< number gnus-newsgroup-begin)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4381 (setq gnus-newsgroup-begin number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4382 (setq gnus-newsgroup-unselected
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4383 (delq number gnus-newsgroup-unselected)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4384 ;; Report back a success?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4385 (and header (mail-header-number header))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4386
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4387 ;;; Process/prefix in the summary buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4388
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4389 (defun gnus-summary-work-articles (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4390 "Return a list of articles to be worked upon. The prefix argument,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4391 the list of process marked articles, and the current article will be
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4392 taken into consideration."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4393 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4394 (n
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4395 ;; A numerical prefix has been given.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4396 (setq n (prefix-numeric-value n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4397 (let ((backward (< n 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4398 (n (abs (prefix-numeric-value n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4399 articles article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4400 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4401 (while
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4402 (and (> n 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4403 (push (setq article (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4404 articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4405 (if backward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4406 (gnus-summary-find-prev nil article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4407 (gnus-summary-find-next nil article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4408 (decf n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4409 (nreverse articles)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4410 ((and (boundp 'transient-mark-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4411 transient-mark-mode
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4412 (boundp 'mark-active)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4413 mark-active)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4414 ;; Work on the region between point and mark.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4415 (let ((max (max (point) (mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4416 articles article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4417 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4418 (goto-char (min (point) (mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4419 (while
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4420 (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4421 (push (setq article (gnus-summary-article-number)) articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4422 (gnus-summary-find-next nil article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4423 (< (point) max)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4424 (nreverse articles))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4425 (gnus-newsgroup-processable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4426 ;; There are process-marked articles present.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4427 ;; Save current state.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4428 (gnus-summary-save-process-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4429 ;; Return the list.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4430 (reverse gnus-newsgroup-processable))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4431 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4432 ;; Just return the current article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4433 (list (gnus-summary-article-number)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4434
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4435 (defun gnus-summary-save-process-mark ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4436 "Push the current set of process marked articles on the stack."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4437 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4438 (push (copy-sequence gnus-newsgroup-processable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4439 gnus-newsgroup-process-stack))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4440
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4441 (defun gnus-summary-kill-process-mark ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4442 "Push the current set of process marked articles on the stack and unmark."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4443 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4444 (gnus-summary-save-process-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4445 (gnus-summary-unmark-all-processable))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4446
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4447 (defun gnus-summary-yank-process-mark ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4448 "Pop the last process mark state off the stack and restore it."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4449 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4450 (unless gnus-newsgroup-process-stack
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4451 (error "Empty mark stack"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4452 (gnus-summary-process-mark-set (pop gnus-newsgroup-process-stack)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4453
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4454 (defun gnus-summary-process-mark-set (set)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4455 "Make SET into the current process marked articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4456 (gnus-summary-unmark-all-processable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4457 (while set
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4458 (gnus-summary-set-process-mark (pop set))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4459
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4460 ;;; Searching and stuff
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4461
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4462 (defun gnus-summary-search-group (&optional backward use-level)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4463 "Search for next unread newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4464 If optional argument BACKWARD is non-nil, search backward instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4465 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4466 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4467 (when (gnus-group-search-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4468 backward nil (if use-level (gnus-group-group-level) nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4469 (gnus-group-group-name))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4470
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4471 (defun gnus-summary-best-group (&optional exclude-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4472 "Find the name of the best unread group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4473 If EXCLUDE-GROUP, do not go to this group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4474 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4475 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4476 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4477 (gnus-group-best-unread-group exclude-group))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4478
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4479 (defun gnus-summary-find-next (&optional unread article backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4480 (if backward (gnus-summary-find-prev)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4481 (let* ((dummy (gnus-summary-article-intangible-p))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4482 (article (or article (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4483 (arts (gnus-data-find-list article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4484 result)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4485 (when (and (not dummy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4486 (or (not gnus-summary-check-current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4487 (not unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4488 (not (gnus-data-unread-p (car arts)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4489 (setq arts (cdr arts)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4490 (when (setq result
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4491 (if unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4492 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4493 (while arts
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4494 (when (gnus-data-unread-p (car arts))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4495 (setq result (car arts)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4496 arts nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4497 (setq arts (cdr arts)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4498 result)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4499 (car arts)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4500 (goto-char (gnus-data-pos result))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4501 (gnus-data-number result)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4502
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4503 (defun gnus-summary-find-prev (&optional unread article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4504 (let* ((eobp (eobp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4505 (article (or article (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4506 (arts (gnus-data-find-list article (gnus-data-list 'rev)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4507 result)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4508 (when (and (not eobp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4509 (or (not gnus-summary-check-current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4510 (not unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4511 (not (gnus-data-unread-p (car arts)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4512 (setq arts (cdr arts)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4513 (when (setq result
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4514 (if unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4515 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4516 (while arts
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4517 (when (gnus-data-unread-p (car arts))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4518 (setq result (car arts)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4519 arts nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4520 (setq arts (cdr arts)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4521 result)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4522 (car arts)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4523 (goto-char (gnus-data-pos result))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4524 (gnus-data-number result))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4525
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4526 (defun gnus-summary-find-subject (subject &optional unread backward article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4527 (let* ((simp-subject (gnus-simplify-subject-fully subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4528 (article (or article (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4529 (articles (gnus-data-list backward))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4530 (arts (gnus-data-find-list article articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4531 result)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4532 (when (or (not gnus-summary-check-current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4533 (not unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4534 (not (gnus-data-unread-p (car arts))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4535 (setq arts (cdr arts)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4536 (while arts
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4537 (and (or (not unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4538 (gnus-data-unread-p (car arts)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4539 (vectorp (gnus-data-header (car arts)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4540 (gnus-subject-equal
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4541 simp-subject (mail-header-subject (gnus-data-header (car arts))) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4542 (setq result (car arts)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4543 arts nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4544 (setq arts (cdr arts)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4545 (and result
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4546 (goto-char (gnus-data-pos result))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4547 (gnus-data-number result))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4548
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4549 (defun gnus-summary-search-forward (&optional unread subject backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4550 "Search forward for an article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4551 If UNREAD, look for unread articles. If SUBJECT, look for
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4552 articles with that subject. If BACKWARD, search backward instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4553 (cond (subject (gnus-summary-find-subject subject unread backward))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4554 (backward (gnus-summary-find-prev unread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4555 (t (gnus-summary-find-next unread))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4556
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4557 (defun gnus-recenter (&optional n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4558 "Center point in window and redisplay frame.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4559 Also do horizontal recentering."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4560 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4561 (when (and gnus-auto-center-summary
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4562 (not (eq gnus-auto-center-summary 'vertical)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4563 (gnus-horizontal-recenter))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4564 (recenter n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4565
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4566 (defun gnus-summary-recenter ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4567 "Center point in the summary window.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4568 If `gnus-auto-center-summary' is nil, or the article buffer isn't
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4569 displayed, no centering will be performed."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4570 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle).
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4571 ;; Recenter only when requested. Suggested by popovich@park.cs.columbia.edu.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4572 (let* ((top (cond ((< (window-height) 4) 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4573 ((< (window-height) 7) 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4574 (t 2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4575 (height (1- (window-height)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4576 (bottom (save-excursion (goto-char (point-max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4577 (forward-line (- height))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4578 (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4579 (window (get-buffer-window (current-buffer))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4580 ;; The user has to want it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4581 (when gnus-auto-center-summary
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4582 (when (get-buffer-window gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4583 ;; Only do recentering when the article buffer is displayed,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4584 ;; Set the window start to either `bottom', which is the biggest
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4585 ;; possible valid number, or the second line from the top,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4586 ;; whichever is the least.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4587 (set-window-start
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4588 window (min bottom (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4589 (forward-line (- top)) (point)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4590 ;; Do horizontal recentering while we're at it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4591 (when (and (get-buffer-window (current-buffer) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4592 (not (eq gnus-auto-center-summary 'vertical)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4593 (let ((selected (selected-window)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4594 (select-window (get-buffer-window (current-buffer) t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4595 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4596 (gnus-horizontal-recenter)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4597 (select-window selected))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4598
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4599 (defun gnus-summary-jump-to-group (newsgroup)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4600 "Move point to NEWSGROUP in group mode buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4601 ;; Keep update point of group mode buffer if visible.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4602 (if (eq (current-buffer) (get-buffer gnus-group-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4603 (save-window-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4604 ;; Take care of tree window mode.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4605 (when (get-buffer-window gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4606 (pop-to-buffer gnus-group-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4607 (gnus-group-jump-to-group newsgroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4608 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4609 ;; Take care of tree window mode.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4610 (if (get-buffer-window gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4611 (pop-to-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4612 (set-buffer gnus-group-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4613 (gnus-group-jump-to-group newsgroup))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4614
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4615 ;; This function returns a list of article numbers based on the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4616 ;; difference between the ranges of read articles in this group and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4617 ;; the range of active articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4618 (defun gnus-list-of-unread-articles (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4619 (let* ((read (gnus-info-read (gnus-get-info group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4620 (active (or (gnus-active group) (gnus-activate-group group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4621 (last (cdr active))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4622 first nlast unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4623 ;; If none are read, then all are unread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4624 (if (not read)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4625 (setq first (car active))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4626 ;; If the range of read articles is a single range, then the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4627 ;; first unread article is the article after the last read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4628 ;; article. Sounds logical, doesn't it?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4629 (if (not (listp (cdr read)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4630 (setq first (1+ (cdr read)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4631 ;; `read' is a list of ranges.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4632 (when (/= (setq nlast (or (and (numberp (car read)) (car read))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4633 (caar read)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4634 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4635 (setq first 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4636 (while read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4637 (when first
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4638 (while (< first nlast)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4639 (push first unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4640 (setq first (1+ first))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4641 (setq first (1+ (if (atom (car read)) (car read) (cdar read))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4642 (setq nlast (if (atom (cadr read)) (cadr read) (caadr read)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4643 (setq read (cdr read)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4644 ;; And add the last unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4645 (while (<= first last)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4646 (push first unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4647 (setq first (1+ first)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4648 ;; Return the list of unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4649 (nreverse unread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4650
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4651 (defun gnus-list-of-read-articles (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4652 "Return a list of unread, unticked and non-dormant articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4653 (let* ((info (gnus-get-info group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4654 (marked (gnus-info-marks info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4655 (active (gnus-active group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4656 (and info active
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4657 (gnus-set-difference
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4658 (gnus-sorted-complement
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4659 (gnus-uncompress-range active)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4660 (gnus-list-of-unread-articles group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4661 (append
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4662 (gnus-uncompress-range (cdr (assq 'dormant marked)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4663 (gnus-uncompress-range (cdr (assq 'tick marked))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4664
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4665 ;; Various summary commands
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4666
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4667 (defun gnus-summary-universal-argument (arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4668 "Perform any operation on all articles that are process/prefixed."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4669 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4670 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4671 (let ((articles (gnus-summary-work-articles arg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4672 func article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4673 (if (eq
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4674 (setq
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4675 func
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4676 (key-binding
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4677 (read-key-sequence
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4678 (substitute-command-keys
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4679 "\\<gnus-summary-mode-map>\\[gnus-summary-universal-argument]"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4680 ))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4681 'undefined)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4682 (gnus-error 1 "Undefined key")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4683 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4684 (while articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4685 (gnus-summary-goto-subject (setq article (pop articles)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4686 (let (gnus-newsgroup-processable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4687 (command-execute func))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4688 (gnus-summary-remove-process-mark article)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4689 (gnus-summary-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4690
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4691 (defun gnus-summary-toggle-truncation (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4692 "Toggle truncation of summary lines.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4693 With arg, turn line truncation on iff arg is positive."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4694 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4695 (setq truncate-lines
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4696 (if (null arg) (not truncate-lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4697 (> (prefix-numeric-value arg) 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4698 (redraw-display))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4699
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4700 (defun gnus-summary-reselect-current-group (&optional all rescan)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4701 "Exit and then reselect the current newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4702 The prefix argument ALL means to select all articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4703 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4704 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4705 (when (gnus-ephemeral-group-p gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4706 (error "Ephemeral groups can't be reselected"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4707 (let ((current-subject (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4708 (group gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4709 (setq gnus-newsgroup-begin nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4710 (gnus-summary-exit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4711 ;; We have to adjust the point of group mode buffer because
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4712 ;; point was moved to the next unread newsgroup by exiting.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4713 (gnus-summary-jump-to-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4714 (when rescan
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4715 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4716 (gnus-group-get-new-news-this-group 1)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4717 (gnus-group-read-group all t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4718 (gnus-summary-goto-subject current-subject nil t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4719
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4720 (defun gnus-summary-rescan-group (&optional all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4721 "Exit the newsgroup, ask for new articles, and select the newsgroup."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4722 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4723 (gnus-summary-reselect-current-group all t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4724
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4725 (defun gnus-summary-update-info (&optional non-destructive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4726 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4727 (let ((group gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4728 (when gnus-newsgroup-kill-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4729 (setq gnus-newsgroup-killed
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4730 (gnus-compress-sequence
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4731 (nconc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4732 (gnus-set-sorted-intersection
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4733 (gnus-uncompress-range gnus-newsgroup-killed)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4734 (setq gnus-newsgroup-unselected
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4735 (sort gnus-newsgroup-unselected '<)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4736 (setq gnus-newsgroup-unreads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4737 (sort gnus-newsgroup-unreads '<)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4738 t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4739 (unless (listp (cdr gnus-newsgroup-killed))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4740 (setq gnus-newsgroup-killed (list gnus-newsgroup-killed)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4741 (let ((headers gnus-newsgroup-headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4742 (when (and (not gnus-save-score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4743 (not non-destructive))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4744 (setq gnus-newsgroup-scored nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4745 ;; Set the new ranges of read articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4746 (gnus-update-read-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4747 group (append gnus-newsgroup-unreads gnus-newsgroup-unselected))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4748 ;; Set the current article marks.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4749 (gnus-update-marks)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4750 ;; Do the cross-ref thing.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4751 (when gnus-use-cross-reference
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4752 (gnus-mark-xrefs-as-read group headers gnus-newsgroup-unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4753 ;; Do adaptive scoring, and possibly save score files.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4754 (when gnus-newsgroup-adaptive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4755 (gnus-score-adaptive))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4756 (when gnus-use-scoring
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4757 (gnus-score-save))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4758 ;; Do not switch windows but change the buffer to work.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4759 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4760 (unless (gnus-ephemeral-group-p gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4761 (gnus-group-update-group group))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4762
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4763 (defun gnus-summary-save-newsrc (&optional force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4764 "Save the current number of read/marked articles in the dribble buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4765 The dribble buffer will then be saved.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4766 If FORCE (the prefix), also save the .newsrc file(s)."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4767 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4768 (gnus-summary-update-info t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4769 (if force
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4770 (gnus-save-newsrc-file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4771 (gnus-dribble-save)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4772
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4773 (defun gnus-summary-exit (&optional temporary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4774 "Exit reading current newsgroup, and then return to group selection mode.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4775 gnus-exit-group-hook is called with no arguments if that value is non-nil."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4776 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4777 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4778 (gnus-kill-save-kill-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4779 (let* ((group gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4780 (quit-config (gnus-group-quit-config gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4781 (mode major-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4782 (buf (current-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4783 (run-hooks 'gnus-summary-prepare-exit-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4784 ;; If we have several article buffers, we kill them at exit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4785 (unless gnus-single-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4786 (gnus-kill-buffer gnus-original-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4787 (setq gnus-article-current nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4788 (when gnus-use-cache
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4789 (gnus-cache-possibly-remove-articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4790 (gnus-cache-save-buffers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4791 (gnus-async-prefetch-remove-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4792 (when gnus-suppress-duplicates
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4793 (gnus-dup-enter-articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4794 (when gnus-use-trees
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4795 (gnus-tree-close group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4796 ;; Make all changes in this group permanent.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4797 (unless quit-config
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4798 (run-hooks 'gnus-exit-group-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4799 (gnus-summary-update-info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4800 (gnus-close-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4801 ;; Make sure where I was, and go to next newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4802 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4803 (unless quit-config
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4804 (gnus-group-jump-to-group group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4805 (run-hooks 'gnus-summary-exit-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4806 (unless quit-config
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4807 (gnus-group-next-unread-group 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4808 (if temporary
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4809 nil ;Nothing to do.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4810 ;; If we have several article buffers, we kill them at exit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4811 (unless gnus-single-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4812 (gnus-kill-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4813 (gnus-kill-buffer gnus-original-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4814 (setq gnus-article-current nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4815 (set-buffer buf)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4816 (if (not gnus-kill-summary-on-exit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4817 (gnus-deaden-summary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4818 ;; We set all buffer-local variables to nil. It is unclear why
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4819 ;; this is needed, but if we don't, buffer-local variables are
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4820 ;; not garbage-collected, it seems. This would the lead to en
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4821 ;; ever-growing Emacs.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4822 (gnus-summary-clear-local-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4823 (when (get-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4824 (bury-buffer gnus-article-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4825 ;; We clear the global counterparts of the buffer-local
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4826 ;; variables as well, just to be on the safe side.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4827 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4828 (gnus-summary-clear-local-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4829 ;; Return to group mode buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4830 (when (eq mode 'gnus-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4831 (gnus-kill-buffer buf)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4832 (setq gnus-current-select-method gnus-select-method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4833 (pop-to-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4834 ;; Clear the current group name.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4835 (if (not quit-config)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4836 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4837 (gnus-group-jump-to-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4838 (gnus-group-next-unread-group 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4839 (gnus-configure-windows 'group 'force))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4840 (gnus-handle-ephemeral-exit quit-config))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4841 (unless quit-config
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4842 (setq gnus-newsgroup-name nil)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4843
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4844 (defalias 'gnus-summary-quit 'gnus-summary-exit-no-update)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4845 (defun gnus-summary-exit-no-update (&optional no-questions)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4846 "Quit reading current newsgroup without updating read article info."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4847 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4848 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4849 (let* ((group gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4850 (quit-config (gnus-group-quit-config group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4851 (when (or no-questions
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4852 gnus-expert-user
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4853 (gnus-y-or-n-p "Discard changes to this group and exit? "))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4854 ;; If we have several article buffers, we kill them at exit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4855 (unless gnus-single-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4856 (gnus-kill-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4857 (gnus-kill-buffer gnus-original-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4858 (setq gnus-article-current nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4859 (if (not gnus-kill-summary-on-exit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4860 (gnus-deaden-summary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4861 (gnus-close-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4862 (gnus-summary-clear-local-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4863 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4864 (gnus-summary-clear-local-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4865 (when (get-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4866 (kill-buffer gnus-summary-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4867 (unless gnus-single-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4868 (setq gnus-article-current nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4869 (when gnus-use-trees
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4870 (gnus-tree-close group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4871 (gnus-async-prefetch-remove-group group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4872 (when (get-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4873 (bury-buffer gnus-article-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4874 ;; Return to the group buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4875 (gnus-configure-windows 'group 'force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4876 ;; Clear the current group name.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4877 (setq gnus-newsgroup-name nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4878 (when (equal (gnus-group-group-name) group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4879 (gnus-group-next-unread-group 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4880 (when quit-config
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4881 (gnus-handle-ephemeral-exit quit-config)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4882
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4883 (defun gnus-handle-ephemeral-exit (quit-config)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4884 "Handle movement when leaving an ephemeral group. The state
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4885 which existed when entering the ephemeral is reset."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4886 (if (not (buffer-name (car quit-config)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4887 (gnus-configure-windows 'group 'force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4888 (set-buffer (car quit-config))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4889 (cond ((eq major-mode 'gnus-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4890 (gnus-set-global-variables))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4891 ((eq major-mode 'gnus-article-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4892 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4893 ;; The `gnus-summary-buffer' variable may point
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4894 ;; to the old summary buffer when using a single
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4895 ;; article buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4896 (unless (gnus-buffer-live-p gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4897 (set-buffer gnus-group-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4898 (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4899 (gnus-set-global-variables))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4900 (if (or (eq (cdr quit-config) 'article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4901 (eq (cdr quit-config) 'pick))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4902 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4903 ;; The current article may be from the ephemeral group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4904 ;; thus it is best that we reload this article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4905 (gnus-summary-show-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4906 (if (and (boundp 'gnus-pick-mode) (symbol-value 'gnus-pick-mode))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4907 (gnus-configure-windows 'pick 'force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4908 (gnus-configure-windows (cdr quit-config) 'force)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4909 (gnus-configure-windows (cdr quit-config) 'force))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4910 (when (eq major-mode 'gnus-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4911 (gnus-summary-next-subject 1 nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4912 (gnus-summary-recenter)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4913 (gnus-summary-position-point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4914
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4915 ;;; Dead summaries.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4916
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4917 (defvar gnus-dead-summary-mode-map nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4918
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4919 (unless gnus-dead-summary-mode-map
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4920 (setq gnus-dead-summary-mode-map (make-keymap))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4921 (suppress-keymap gnus-dead-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4922 (substitute-key-definition
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4923 'undefined 'gnus-summary-wake-up-the-dead gnus-dead-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4924 (let ((keys '("\C-d" "\r" "\177")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4925 (while keys
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4926 (define-key gnus-dead-summary-mode-map
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4927 (pop keys) 'gnus-summary-wake-up-the-dead))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4928
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4929 (defvar gnus-dead-summary-mode nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4930 "Minor mode for Gnus summary buffers.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4931
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4932 (defun gnus-dead-summary-mode (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4933 "Minor mode for Gnus summary buffers."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4934 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4935 (when (eq major-mode 'gnus-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4936 (make-local-variable 'gnus-dead-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4937 (setq gnus-dead-summary-mode
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4938 (if (null arg) (not gnus-dead-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4939 (> (prefix-numeric-value arg) 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4940 (when gnus-dead-summary-mode
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4941 (unless (assq 'gnus-dead-summary-mode minor-mode-alist)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4942 (push '(gnus-dead-summary-mode " Dead") minor-mode-alist))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4943 (unless (assq 'gnus-dead-summary-mode minor-mode-map-alist)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4944 (push (cons 'gnus-dead-summary-mode gnus-dead-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4945 minor-mode-map-alist)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4946
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4947 (defun gnus-deaden-summary ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4948 "Make the current summary buffer into a dead summary buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4949 ;; Kill any previous dead summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4950 (when (and gnus-dead-summary
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4951 (buffer-name gnus-dead-summary))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4952 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4953 (set-buffer gnus-dead-summary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4954 (when gnus-dead-summary-mode
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4955 (kill-buffer (current-buffer)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4956 ;; Make this the current dead summary.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4957 (setq gnus-dead-summary (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4958 (gnus-dead-summary-mode 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4959 (let ((name (buffer-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4960 (when (string-match "Summary" name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4961 (rename-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4962 (concat (substring name 0 (match-beginning 0)) "Dead "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4963 (substring name (match-beginning 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4964 t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4965
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4966 (defun gnus-kill-or-deaden-summary (buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4967 "Kill or deaden the summary BUFFER."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4968 (when (and (buffer-name buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4969 (not gnus-single-article-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4970 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4971 (set-buffer buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4972 (gnus-kill-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4973 (gnus-kill-buffer gnus-original-article-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4974 (cond (gnus-kill-summary-on-exit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4975 (when (and gnus-use-trees
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4976 (and (get-buffer buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4977 (buffer-name (get-buffer buffer))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4978 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4979 (set-buffer (get-buffer buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4980 (gnus-tree-close gnus-newsgroup-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4981 (gnus-kill-buffer buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4982 ((and (get-buffer buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4983 (buffer-name (get-buffer buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4984 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4985 (set-buffer buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4986 (gnus-deaden-summary)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4987
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4988 (defun gnus-summary-wake-up-the-dead (&rest args)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4989 "Wake up the dead summary buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4990 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4991 (gnus-dead-summary-mode -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4992 (let ((name (buffer-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4993 (when (string-match "Dead " name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4994 (rename-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4995 (concat (substring name 0 (match-beginning 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4996 (substring name (match-end 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4997 t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4998 (gnus-message 3 "This dead summary is now alive again"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
4999
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5000 ;; Suggested by Andrew Eskilsson <pi92ae@pt.hk-r.se>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5001 (defun gnus-summary-fetch-faq (&optional faq-dir)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5002 "Fetch the FAQ for the current group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5003 If FAQ-DIR (the prefix), prompt for a directory to search for the faq
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5004 in."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5005 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5006 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5007 (when current-prefix-arg
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5008 (completing-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5009 "Faq dir: " (and (listp gnus-group-faq-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5010 gnus-group-faq-directory)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5011 (let (gnus-faq-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5012 (when (setq gnus-faq-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5013 (gnus-group-fetch-faq gnus-newsgroup-name faq-dir))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5014 (gnus-configure-windows 'summary-faq))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5015
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5016 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5017 (defun gnus-summary-describe-group (&optional force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5018 "Describe the current newsgroup."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5019 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5020 (gnus-group-describe-group force gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5021
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5022 (defun gnus-summary-describe-briefly ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5023 "Describe summary mode commands briefly."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5024 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5025 (gnus-message 6
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5026 (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")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5027
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5028 ;; Walking around group mode buffer from summary mode.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5029
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5030 (defun gnus-summary-next-group (&optional no-article target-group backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5031 "Exit current newsgroup and then select next unread newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5032 If prefix argument NO-ARTICLE is non-nil, no article is selected
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5033 initially. If NEXT-GROUP, go to this group. If BACKWARD, go to
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5034 previous group instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5035 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5036 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5037 ;; Stop pre-fetching.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5038 (gnus-async-halt-prefetch)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5039 (let ((current-group gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5040 (current-buffer (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5041 entered)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5042 ;; First we semi-exit this group to update Xrefs and all variables.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5043 ;; We can't do a real exit, because the window conf must remain
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5044 ;; the same in case the user is prompted for info, and we don't
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5045 ;; want the window conf to change before that...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5046 (gnus-summary-exit t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5047 (while (not entered)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5048 ;; Then we find what group we are supposed to enter.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5049 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5050 (gnus-group-jump-to-group current-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5051 (setq target-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5052 (or target-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5053 (if (eq gnus-keep-same-level 'best)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5054 (gnus-summary-best-group gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5055 (gnus-summary-search-group backward gnus-keep-same-level))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5056 (if (not target-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5057 ;; There are no further groups, so we return to the group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5058 ;; buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5059 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5060 (gnus-message 5 "Returning to the group buffer")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5061 (setq entered t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5062 (set-buffer current-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5063 (gnus-summary-exit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5064 (run-hooks 'gnus-group-no-more-groups-hook))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5065 ;; We try to enter the target group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5066 (gnus-group-jump-to-group target-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5067 (let ((unreads (gnus-group-group-unread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5068 (if (and (or (eq t unreads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5069 (and unreads (not (zerop unreads))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5070 (gnus-summary-read-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5071 target-group nil no-article current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5072 (setq entered t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5073 (setq current-group target-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5074 target-group nil)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5075
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5076 (defun gnus-summary-prev-group (&optional no-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5077 "Exit current newsgroup and then select previous unread newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5078 If prefix argument NO-ARTICLE is non-nil, no article is selected initially."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5079 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5080 (gnus-summary-next-group no-article nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5081
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5082 ;; Walking around summary lines.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5083
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5084 (defun gnus-summary-first-subject (&optional unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5085 "Go to the first unread subject.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5086 If UNREAD is non-nil, go to the first unread article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5087 Returns the article selected or nil if there are no unread articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5088 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5089 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5090 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5091 ;; Empty summary.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5092 ((null gnus-newsgroup-data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5093 (gnus-message 3 "No articles in the group")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5094 nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5095 ;; Pick the first article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5096 ((not unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5097 (goto-char (gnus-data-pos (car gnus-newsgroup-data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5098 (gnus-data-number (car gnus-newsgroup-data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5099 ;; No unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5100 ((null gnus-newsgroup-unreads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5101 (gnus-message 3 "No more unread articles")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5102 nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5103 ;; Find the first unread article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5104 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5105 (let ((data gnus-newsgroup-data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5106 (while (and data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5107 (not (gnus-data-unread-p (car data))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5108 (setq data (cdr data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5109 (when data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5110 (goto-char (gnus-data-pos (car data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5111 (gnus-data-number (car data))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5112 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5113
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5114 (defun gnus-summary-next-subject (n &optional unread dont-display)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5115 "Go to next N'th summary line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5116 If N is negative, go to the previous N'th subject line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5117 If UNREAD is non-nil, only unread articles are selected.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5118 The difference between N and the actual number of steps taken is
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5119 returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5120 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5121 (let ((backward (< n 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5122 (n (abs n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5123 (while (and (> n 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5124 (if backward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5125 (gnus-summary-find-prev unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5126 (gnus-summary-find-next unread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5127 (setq n (1- n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5128 (when (/= 0 n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5129 (gnus-message 7 "No more%s articles"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5130 (if unread " unread" "")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5131 (unless dont-display
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5132 (gnus-summary-recenter)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5133 (gnus-summary-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5134 n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5135
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5136 (defun gnus-summary-next-unread-subject (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5137 "Go to next N'th unread summary line."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5138 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5139 (gnus-summary-next-subject n t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5140
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5141 (defun gnus-summary-prev-subject (n &optional unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5142 "Go to previous N'th summary line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5143 If optional argument UNREAD is non-nil, only unread article is selected."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5144 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5145 (gnus-summary-next-subject (- n) unread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5146
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5147 (defun gnus-summary-prev-unread-subject (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5148 "Go to previous N'th unread summary line."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5149 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5150 (gnus-summary-next-subject (- n) t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5151
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5152 (defun gnus-summary-goto-subject (article &optional force silent)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5153 "Go the subject line of ARTICLE.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5154 If FORCE, also allow jumping to articles not currently shown."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5155 (interactive "nArticle number: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5156 (let ((b (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5157 (data (gnus-data-find article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5158 ;; We read in the article if we have to.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5159 (and (not data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5160 force
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5161 (gnus-summary-insert-subject article (and (vectorp force) force) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5162 (setq data (gnus-data-find article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5163 (goto-char b)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5164 (if (not data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5165 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5166 (unless silent
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5167 (gnus-message 3 "Can't find article %d" article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5168 nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5169 (goto-char (gnus-data-pos data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5170 article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5171
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5172 ;; Walking around summary lines with displaying articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5173
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5174 (defun gnus-summary-expand-window (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5175 "Make the summary buffer take up the entire Emacs frame.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5176 Given a prefix, will force an `article' buffer configuration."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5177 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5178 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5179 (if arg
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5180 (gnus-configure-windows 'article 'force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5181 (gnus-configure-windows 'summary 'force)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5182
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5183 (defun gnus-summary-display-article (article &optional all-header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5184 "Display ARTICLE in article buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5185 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5186 (if (null article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5187 nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5188 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5189 (if gnus-summary-display-article-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5190 (funcall gnus-summary-display-article-function article all-header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5191 (gnus-article-prepare article all-header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5192 (run-hooks 'gnus-select-article-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5193 (when (and gnus-current-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5194 (not (zerop gnus-current-article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5195 (gnus-summary-goto-subject gnus-current-article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5196 (gnus-summary-recenter)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5197 (when (and gnus-use-trees gnus-show-threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5198 (gnus-possibly-generate-tree article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5199 (gnus-highlight-selected-tree article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5200 ;; Successfully display article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5201 (gnus-article-set-window-start
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5202 (cdr (assq article gnus-newsgroup-bookmarks))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5203
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5204 (defun gnus-summary-select-article (&optional all-headers force pseudo article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5205 "Select the current article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5206 If ALL-HEADERS is non-nil, show all header fields. If FORCE is
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5207 non-nil, the article will be re-fetched even if it already present in
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5208 the article buffer. If PSEUDO is non-nil, pseudo-articles will also
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5209 be displayed."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5210 ;; Make sure we are in the summary buffer to work around bbdb bug.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5211 (unless (eq major-mode 'gnus-summary-mode)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5212 (set-buffer gnus-summary-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5213 (let ((article (or article (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5214 (all-headers (not (not all-headers))) ;Must be T or NIL.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5215 gnus-summary-display-article-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5216 did)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5217 (and (not pseudo)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5218 (gnus-summary-article-pseudo-p article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5219 (error "This is a pseudo-article."))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5220 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5221 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5222 (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5223 (if (or (and gnus-single-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5224 (or (null gnus-current-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5225 (null gnus-article-current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5226 (null (get-buffer gnus-article-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5227 (not (eq article (cdr gnus-article-current)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5228 (not (equal (car gnus-article-current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5229 gnus-newsgroup-name))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5230 (and (not gnus-single-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5231 (or (null gnus-current-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5232 (not (eq gnus-current-article article))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5233 force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5234 ;; The requested article is different from the current article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5235 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5236 (gnus-summary-display-article article all-headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5237 (setq did article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5238 (when (or all-headers gnus-show-all-headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5239 (gnus-article-show-all-headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5240 'old))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5241 (when did
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5242 (gnus-article-set-window-start
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5243 (cdr (assq article gnus-newsgroup-bookmarks)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5244
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5245 (defun gnus-summary-set-current-mark (&optional current-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5246 "Obsolete function."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5247 nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5248
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5249 (defun gnus-summary-next-article (&optional unread subject backward push)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5250 "Select the next article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5251 If UNREAD, only unread articles are selected.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5252 If SUBJECT, only articles with SUBJECT are selected.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5253 If BACKWARD, the previous article is selected instead of the next."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5254 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5255 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5256 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5257 ;; Is there such an article?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5258 ((and (gnus-summary-search-forward unread subject backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5259 (or (gnus-summary-display-article (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5260 (eq (gnus-summary-article-mark) gnus-canceled-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5261 (gnus-summary-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5262 ;; If not, we try the first unread, if that is wanted.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5263 ((and subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5264 gnus-auto-select-same
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5265 (gnus-summary-first-unread-article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5266 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5267 (gnus-message 6 "Wrapped"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5268 ;; Try to get next/previous article not displayed in this group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5269 ((and gnus-auto-extend-newsgroup
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5270 (not unread) (not subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5271 (gnus-summary-goto-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5272 (if backward (1- gnus-newsgroup-begin) (1+ gnus-newsgroup-end))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5273 nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5274 ;; Go to next/previous group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5275 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5276 (unless (gnus-ephemeral-group-p gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5277 (gnus-summary-jump-to-group gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5278 (let ((cmd last-command-char)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5279 (group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5280 (if (eq gnus-keep-same-level 'best)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5281 (gnus-summary-best-group gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5282 (gnus-summary-search-group backward gnus-keep-same-level))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5283 ;; For some reason, the group window gets selected. We change
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5284 ;; it back.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5285 (select-window (get-buffer-window (current-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5286 ;; Select next unread newsgroup automagically.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5287 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5288 ((or (not gnus-auto-select-next)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5289 (not cmd))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5290 (gnus-message 7 "No more%s articles" (if unread " unread" "")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5291 ((or (eq gnus-auto-select-next 'quietly)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5292 (and (eq gnus-auto-select-next 'slightly-quietly)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5293 push)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5294 (and (eq gnus-auto-select-next 'almost-quietly)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5295 (gnus-summary-last-article-p)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5296 ;; Select quietly.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5297 (if (gnus-ephemeral-group-p gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5298 (gnus-summary-exit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5299 (gnus-message 7 "No more%s articles (%s)..."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5300 (if unread " unread" "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5301 (if group (concat "selecting " group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5302 "exiting"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5303 (gnus-summary-next-group nil group backward)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5304 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5305 (when (gnus-key-press-event-p last-input-event)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5306 (gnus-summary-walk-group-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5307 gnus-newsgroup-name cmd unread backward))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5308
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5309 (defun gnus-summary-walk-group-buffer (from-group cmd unread backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5310 (let ((keystrokes '((?\C-n (gnus-group-next-unread-group 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5311 (?\C-p (gnus-group-prev-unread-group 1))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5312 (cursor-in-echo-area t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5313 keve key group ended)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5314 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5315 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5316 (gnus-summary-jump-to-group from-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5317 (setq group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5318 (if (eq gnus-keep-same-level 'best)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5319 (gnus-summary-best-group gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5320 (gnus-summary-search-group backward gnus-keep-same-level))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5321 (while (not ended)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5322 (gnus-message
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5323 5 "No more%s articles%s" (if unread " unread" "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5324 (if (and group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5325 (not (gnus-ephemeral-group-p gnus-newsgroup-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5326 (format " (Type %s for %s [%s])"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5327 (single-key-description cmd) group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5328 (car (gnus-gethash group gnus-newsrc-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5329 (format " (Type %s to exit %s)"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5330 (single-key-description cmd)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5331 gnus-newsgroup-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5332 ;; Confirm auto selection.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5333 (setq key (car (setq keve (gnus-read-event-char))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5334 (setq ended t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5335 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5336 ((assq key keystrokes)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5337 (let ((obuf (current-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5338 (switch-to-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5339 (when group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5340 (gnus-group-jump-to-group group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5341 (eval (cadr (assq key keystrokes)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5342 (setq group (gnus-group-group-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5343 (switch-to-buffer obuf))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5344 (setq ended nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5345 ((equal key cmd)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5346 (if (or (not group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5347 (gnus-ephemeral-group-p gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5348 (gnus-summary-exit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5349 (gnus-summary-next-group nil group backward)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5350 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5351 (push (cdr keve) unread-command-events))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5352
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5353 (defun gnus-summary-next-unread-article ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5354 "Select unread article after current one."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5355 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5356 (gnus-summary-next-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5357 (or (not (eq gnus-summary-goto-unread 'never))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5358 (gnus-summary-last-article-p (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5359 (and gnus-auto-select-same
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5360 (gnus-summary-article-subject))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5361
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5362 (defun gnus-summary-prev-article (&optional unread subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5363 "Select the article after the current one.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5364 If UNREAD is non-nil, only unread articles are selected."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5365 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5366 (gnus-summary-next-article unread subject t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5367
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5368 (defun gnus-summary-prev-unread-article ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5369 "Select unread article before current one."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5370 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5371 (gnus-summary-prev-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5372 (or (not (eq gnus-summary-goto-unread 'never))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5373 (gnus-summary-first-article-p (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5374 (and gnus-auto-select-same
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5375 (gnus-summary-article-subject))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5376
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5377 (defun gnus-summary-next-page (&optional lines circular)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5378 "Show next page of the selected article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5379 If at the end of the current article, select the next article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5380 LINES says how many lines should be scrolled up.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5381
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5382 If CIRCULAR is non-nil, go to the start of the article instead of
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5383 selecting the next article when reaching the end of the current
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5384 article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5385 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5386 (setq gnus-summary-buffer (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5387 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5388 (let ((article (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5389 (article-window (get-buffer-window gnus-article-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5390 (endp nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5391 (gnus-configure-windows 'article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5392 (if (eq (cdr (assq article gnus-newsgroup-reads)) gnus-canceled-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5393 (if (and (eq gnus-summary-goto-unread 'never)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5394 (not (gnus-summary-last-article-p article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5395 (gnus-summary-next-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5396 (gnus-summary-next-unread-article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5397 (if (or (null gnus-current-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5398 (null gnus-article-current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5399 (/= article (cdr gnus-article-current))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5400 (not (equal (car gnus-article-current) gnus-newsgroup-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5401 ;; Selected subject is different from current article's.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5402 (gnus-summary-display-article article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5403 (when article-window
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5404 (gnus-eval-in-buffer-window gnus-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5405 (setq endp (gnus-article-next-page lines)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5406 (when endp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5407 (cond (circular
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5408 (gnus-summary-beginning-of-article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5409 (lines
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5410 (gnus-message 3 "End of message"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5411 ((null lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5412 (if (and (eq gnus-summary-goto-unread 'never)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5413 (not (gnus-summary-last-article-p article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5414 (gnus-summary-next-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5415 (gnus-summary-next-unread-article))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5416 (gnus-summary-recenter)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5417 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5418
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5419 (defun gnus-summary-prev-page (&optional lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5420 "Show previous page of selected article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5421 Argument LINES specifies lines to be scrolled down."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5422 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5423 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5424 (let ((article (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5425 (gnus-configure-windows 'article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5426 (if (or (null gnus-current-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5427 (null gnus-article-current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5428 (/= article (cdr gnus-article-current))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5429 (not (equal (car gnus-article-current) gnus-newsgroup-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5430 ;; Selected subject is different from current article's.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5431 (gnus-summary-display-article article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5432 (gnus-summary-recenter)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5433 (gnus-eval-in-buffer-window gnus-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5434 (gnus-article-prev-page lines))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5435 (gnus-summary-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5436
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5437 (defun gnus-summary-scroll-up (lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5438 "Scroll up (or down) one line current article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5439 Argument LINES specifies lines to be scrolled up (or down if negative)."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5440 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5441 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5442 (gnus-configure-windows 'article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5443 (gnus-summary-show-thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5444 (when (eq (gnus-summary-select-article nil nil 'pseudo) 'old)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5445 (gnus-eval-in-buffer-window gnus-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5446 (cond ((> lines 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5447 (when (gnus-article-next-page lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5448 (gnus-message 3 "End of message")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5449 ((< lines 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5450 (gnus-article-prev-page (- lines))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5451 (gnus-summary-recenter)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5452 (gnus-summary-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5453
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5454 (defun gnus-summary-next-same-subject ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5455 "Select next article which has the same subject as current one."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5456 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5457 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5458 (gnus-summary-next-article nil (gnus-summary-article-subject)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5459
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5460 (defun gnus-summary-prev-same-subject ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5461 "Select previous article which has the same subject as current one."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5462 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5463 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5464 (gnus-summary-prev-article nil (gnus-summary-article-subject)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5465
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5466 (defun gnus-summary-next-unread-same-subject ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5467 "Select next unread article which has the same subject as current one."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5468 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5469 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5470 (gnus-summary-next-article t (gnus-summary-article-subject)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5471
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5472 (defun gnus-summary-prev-unread-same-subject ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5473 "Select previous unread article which has the same subject as current one."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5474 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5475 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5476 (gnus-summary-prev-article t (gnus-summary-article-subject)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5477
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5478 (defun gnus-summary-first-unread-article ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5479 "Select the first unread article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5480 Return nil if there are no unread articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5481 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5482 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5483 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5484 (when (gnus-summary-first-subject t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5485 (gnus-summary-show-thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5486 (gnus-summary-first-subject t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5487 (gnus-summary-display-article (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5488 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5489
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5490 (defun gnus-summary-first-article ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5491 "Select the first article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5492 Return nil if there are no articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5493 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5494 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5495 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5496 (when (gnus-summary-first-subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5497 (gnus-summary-show-thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5498 (gnus-summary-first-subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5499 (gnus-summary-display-article (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5500 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5501
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5502 (defun gnus-summary-best-unread-article ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5503 "Select the unread article with the highest score."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5504 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5505 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5506 (let ((best -1000000)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5507 (data gnus-newsgroup-data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5508 article score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5509 (while data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5510 (and (gnus-data-unread-p (car data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5511 (> (setq score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5512 (gnus-summary-article-score (gnus-data-number (car data))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5513 best)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5514 (setq best score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5515 article (gnus-data-number (car data))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5516 (setq data (cdr data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5517 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5518 (if article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5519 (gnus-summary-goto-article article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5520 (error "No unread articles"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5521 (gnus-summary-position-point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5522
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5523 (defun gnus-summary-last-subject ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5524 "Go to the last displayed subject line in the group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5525 (let ((article (gnus-data-number (car (gnus-data-list t)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5526 (when article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5527 (gnus-summary-goto-subject article))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5528
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5529 (defun gnus-summary-goto-article (article &optional all-headers force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5530 "Fetch ARTICLE and display it if it exists.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5531 If ALL-HEADERS is non-nil, no header lines are hidden."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5532 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5533 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5534 (string-to-int
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5535 (completing-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5536 "Article number: "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5537 (mapcar (lambda (number) (list (int-to-string number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5538 gnus-newsgroup-limit)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5539 current-prefix-arg
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5540 t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5541 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5542 (if (gnus-summary-goto-subject article force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5543 (gnus-summary-display-article article all-headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5544 (gnus-message 4 "Couldn't go to article %s" article) nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5545 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5546
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5547 (defun gnus-summary-goto-last-article ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5548 "Go to the previously read article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5549 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5550 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5551 (when gnus-last-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5552 (gnus-summary-goto-article gnus-last-article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5553 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5554
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5555 (defun gnus-summary-pop-article (number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5556 "Pop one article off the history and go to the previous.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5557 NUMBER articles will be popped off."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5558 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5559 (let (to)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5560 (setq gnus-newsgroup-history
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5561 (cdr (setq to (nthcdr number gnus-newsgroup-history))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5562 (if to
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5563 (gnus-summary-goto-article (car to))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5564 (error "Article history empty")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5565 (gnus-summary-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5566
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5567 ;; Summary commands and functions for limiting the summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5568
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5569 (defun gnus-summary-limit-to-articles (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5570 "Limit the summary buffer to the next N articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5571 If not given a prefix, use the process marked articles instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5572 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5573 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5574 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5575 (let ((articles (gnus-summary-work-articles n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5576 (setq gnus-newsgroup-processable nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5577 (gnus-summary-limit articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5578 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5579
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5580 (defun gnus-summary-pop-limit (&optional total)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5581 "Restore the previous limit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5582 If given a prefix, remove all limits."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5583 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5584 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5585 (when total
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5586 (setq gnus-newsgroup-limits
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5587 (list (mapcar (lambda (h) (mail-header-number h))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5588 gnus-newsgroup-headers))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5589 (unless gnus-newsgroup-limits
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5590 (error "No limit to pop"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5591 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5592 (gnus-summary-limit nil 'pop)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5593 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5594
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5595 (defun gnus-summary-limit-to-subject (subject &optional header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5596 "Limit the summary buffer to articles that have subjects that match a regexp."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5597 (interactive "sLimit to subject (regexp): ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5598 (unless header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5599 (setq header "subject"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5600 (when (not (equal "" subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5601 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5602 (let ((articles (gnus-summary-find-matching
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5603 (or header "subject") subject 'all)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5604 (unless articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5605 (error "Found no matches for \"%s\"" subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5606 (gnus-summary-limit articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5607 (gnus-summary-position-point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5608
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5609 (defun gnus-summary-limit-to-author (from)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5610 "Limit the summary buffer to articles that have authors that match a regexp."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5611 (interactive "sLimit to author (regexp): ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5612 (gnus-summary-limit-to-subject from "from"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5613
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5614 (defun gnus-summary-limit-to-age (age &optional younger-p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5615 "Limit the summary buffer to articles that are older than (or equal) AGE days.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5616 If YOUNGER-P (the prefix) is non-nil, limit the summary buffer to
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5617 articles that are younger than AGE days."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5618 (interactive "nTime in days: \nP")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5619 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5620 (let ((data gnus-newsgroup-data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5621 (cutoff (nnmail-days-to-time age))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5622 articles d date is-younger)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5623 (while (setq d (pop data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5624 (when (and (vectorp (gnus-data-header d))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5625 (setq date (mail-header-date (gnus-data-header d))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5626 (setq is-younger (nnmail-time-less
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5627 (nnmail-time-since (nnmail-date-to-time date))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5628 cutoff))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5629 (when (if younger-p is-younger (not is-younger))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5630 (push (gnus-data-number d) articles))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5631 (gnus-summary-limit (nreverse articles)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5632 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5633
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5634 (defalias 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5635 (make-obsolete
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5636 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5637
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5638 (defun gnus-summary-limit-to-unread (&optional all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5639 "Limit the summary buffer to articles that are not marked as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5640 If ALL is non-nil, limit strictly to unread articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5641 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5642 (if all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5643 (gnus-summary-limit-to-marks (char-to-string gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5644 (gnus-summary-limit-to-marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5645 ;; Concat all the marks that say that an article is read and have
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5646 ;; those removed.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5647 (list gnus-del-mark gnus-read-mark gnus-ancient-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5648 gnus-killed-mark gnus-kill-file-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5649 gnus-low-score-mark gnus-expirable-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5650 gnus-canceled-mark gnus-catchup-mark gnus-sparse-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5651 gnus-duplicate-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5652 'reverse)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5653
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5654 (defalias 'gnus-summary-delete-marked-with 'gnus-summary-limit-exclude-marks)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5655 (make-obsolete 'gnus-summary-delete-marked-with
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5656 'gnus-summary-limit-exlude-marks)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5657
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5658 (defun gnus-summary-limit-exclude-marks (marks &optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5659 "Exclude articles that are marked with MARKS (e.g. \"DK\").
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5660 If REVERSE, limit the summary buffer to articles that are marked
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5661 with MARKS. MARKS can either be a string of marks or a list of marks.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5662 Returns how many articles were removed."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5663 (interactive "sMarks: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5664 (gnus-summary-limit-to-marks marks t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5665
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5666 (defun gnus-summary-limit-to-marks (marks &optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5667 "Limit the summary buffer to articles that are marked with MARKS (e.g. \"DK\").
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5668 If REVERSE (the prefix), limit the summary buffer to articles that are
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5669 not marked with MARKS. MARKS can either be a string of marks or a
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5670 list of marks.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5671 Returns how many articles were removed."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5672 (interactive (list (read-string "Marks: ") current-prefix-arg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5673 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5674 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5675 (let ((data gnus-newsgroup-data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5676 (marks (if (listp marks) marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5677 (append marks nil))) ; Transform to list.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5678 articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5679 (while data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5680 (when (if reverse (not (memq (gnus-data-mark (car data)) marks))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5681 (memq (gnus-data-mark (car data)) marks))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5682 (push (gnus-data-number (car data)) articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5683 (setq data (cdr data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5684 (gnus-summary-limit articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5685 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5686
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5687 (defun gnus-summary-limit-to-score (&optional score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5688 "Limit to articles with score at or above SCORE."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5689 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5690 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5691 (setq score (if score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5692 (prefix-numeric-value score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5693 (or gnus-summary-default-score 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5694 (let ((data gnus-newsgroup-data)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5695 articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5696 (while data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5697 (when (>= (gnus-summary-article-score (gnus-data-number (car data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5698 score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5699 (push (gnus-data-number (car data)) articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5700 (setq data (cdr data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5701 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5702 (gnus-summary-limit articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5703 (gnus-summary-position-point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5704
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5705 (defun gnus-summary-limit-include-dormant ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5706 "Display all the hidden articles that are marked as dormant."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5707 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5708 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5709 (unless gnus-newsgroup-dormant
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5710 (error "There are no dormant articles in this group"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5711 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5712 (gnus-summary-limit (append gnus-newsgroup-dormant gnus-newsgroup-limit))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5713 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5714
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5715 (defun gnus-summary-limit-exclude-dormant ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5716 "Hide all dormant articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5717 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5718 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5719 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5720 (gnus-summary-limit-to-marks (list gnus-dormant-mark) 'reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5721 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5722
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5723 (defun gnus-summary-limit-exclude-childless-dormant ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5724 "Hide all dormant articles that have no children."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5725 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5726 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5727 (let ((data (gnus-data-list t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5728 articles d children)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5729 ;; Find all articles that are either not dormant or have
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5730 ;; children.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5731 (while (setq d (pop data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5732 (when (or (not (= (gnus-data-mark d) gnus-dormant-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5733 (and (setq children
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5734 (gnus-article-children (gnus-data-number d)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5735 (let (found)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5736 (while children
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5737 (when (memq (car children) articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5738 (setq children nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5739 found t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5740 (pop children))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5741 found)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5742 (push (gnus-data-number d) articles)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5743 ;; Do the limiting.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5744 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5745 (gnus-summary-limit articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5746 (gnus-summary-position-point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5747
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5748 (defun gnus-summary-limit-mark-excluded-as-read (&optional all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5749 "Mark all unread excluded articles as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5750 If ALL, mark even excluded ticked and dormants as read."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5751 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5752 (let ((articles (gnus-sorted-complement
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5753 (sort
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5754 (mapcar (lambda (h) (mail-header-number h))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5755 gnus-newsgroup-headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5756 '<)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5757 (sort gnus-newsgroup-limit '<)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5758 article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5759 (setq gnus-newsgroup-unreads nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5760 (if all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5761 (setq gnus-newsgroup-dormant nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5762 gnus-newsgroup-marked nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5763 gnus-newsgroup-reads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5764 (nconc
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5765 (mapcar (lambda (n) (cons n gnus-catchup-mark)) articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5766 gnus-newsgroup-reads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5767 (while (setq article (pop articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5768 (unless (or (memq article gnus-newsgroup-dormant)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5769 (memq article gnus-newsgroup-marked))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5770 (push (cons article gnus-catchup-mark) gnus-newsgroup-reads))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5771
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5772 (defun gnus-summary-limit (articles &optional pop)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5773 (if pop
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5774 ;; We pop the previous limit off the stack and use that.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5775 (setq articles (car gnus-newsgroup-limits)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5776 gnus-newsgroup-limits (cdr gnus-newsgroup-limits))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5777 ;; We use the new limit, so we push the old limit on the stack.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5778 (push gnus-newsgroup-limit gnus-newsgroup-limits))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5779 ;; Set the limit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5780 (setq gnus-newsgroup-limit articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5781 (let ((total (length gnus-newsgroup-data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5782 (data (gnus-data-find-list (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5783 (gnus-summary-mark-below nil) ; Inhibit this.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5784 found)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5785 ;; This will do all the work of generating the new summary buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5786 ;; according to the new limit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5787 (gnus-summary-prepare)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5788 ;; Hide any threads, possibly.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5789 (and gnus-show-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5790 gnus-thread-hide-subtree
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5791 (gnus-summary-hide-all-threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5792 ;; Try to return to the article you were at, or one in the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5793 ;; neighborhood.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5794 (when data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5795 ;; We try to find some article after the current one.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5796 (while data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5797 (when (gnus-summary-goto-subject (gnus-data-number (car data)) nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5798 (setq data nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5799 found t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5800 (setq data (cdr data))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5801 (unless found
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5802 ;; If there is no data, that means that we were after the last
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5803 ;; article. The same goes when we can't find any articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5804 ;; after the current one.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5805 (goto-char (point-max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5806 (gnus-summary-find-prev))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5807 ;; We return how many articles were removed from the summary
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5808 ;; buffer as a result of the new limit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5809 (- total (length gnus-newsgroup-data))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5810
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5811 (defsubst gnus-invisible-cut-children (threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5812 (let ((num 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5813 (while threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5814 (when (memq (mail-header-number (caar threads)) gnus-newsgroup-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5815 (incf num))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5816 (pop threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5817 (< num 2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5818
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5819 (defsubst gnus-cut-thread (thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5820 "Go forwards in the thread until we find an article that we want to display."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5821 (when (or (eq gnus-fetch-old-headers 'some)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5822 (eq gnus-build-sparse-threads 'some)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5823 (eq gnus-build-sparse-threads 'more))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5824 ;; Deal with old-fetched headers and sparse threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5825 (while (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5826 thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5827 (or
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5828 (gnus-summary-article-sparse-p (mail-header-number (car thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5829 (gnus-summary-article-ancient-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5830 (mail-header-number (car thread))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5831 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5832 (if (<= (length (cdr thread)) 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5833 (setq thread (cadr thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5834 (when (gnus-invisible-cut-children (cdr thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5835 (let ((th (cdr thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5836 (while th
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5837 (if (memq (mail-header-number (caar th))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5838 gnus-newsgroup-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5839 (setq thread (car th)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5840 th nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5841 (setq th (cdr th)))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5842 ))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5843 thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5844
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5845 (defun gnus-cut-threads (threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5846 "Cut off all uninteresting articles from the beginning of threads."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5847 (when (or (eq gnus-fetch-old-headers 'some)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5848 (eq gnus-build-sparse-threads 'some)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5849 (eq gnus-build-sparse-threads 'more))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5850 (let ((th threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5851 (while th
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5852 (setcar th (gnus-cut-thread (car th)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5853 (setq th (cdr th)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5854 ;; Remove nixed out threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5855 (delq nil threads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5856
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5857 (defun gnus-summary-initial-limit (&optional show-if-empty)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5858 "Figure out what the initial limit is supposed to be on group entry.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5859 This entails weeding out unwanted dormants, low-scored articles,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5860 fetch-old-headers verbiage, and so on."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5861 ;; Most groups have nothing to remove.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5862 (if (or gnus-inhibit-limiting
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5863 (and (null gnus-newsgroup-dormant)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5864 (not (eq gnus-fetch-old-headers 'some))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5865 (null gnus-summary-expunge-below)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5866 (not (eq gnus-build-sparse-threads 'some))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5867 (not (eq gnus-build-sparse-threads 'more))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5868 (null gnus-thread-expunge-below)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5869 (not gnus-use-nocem)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5870 () ; Do nothing.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5871 (push gnus-newsgroup-limit gnus-newsgroup-limits)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5872 (setq gnus-newsgroup-limit nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5873 (mapatoms
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5874 (lambda (node)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5875 (unless (car (symbol-value node))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5876 ;; These threads have no parents -- they are roots.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5877 (let ((nodes (cdr (symbol-value node)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5878 thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5879 (while nodes
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5880 (if (and gnus-thread-expunge-below
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5881 (< (gnus-thread-total-score (car nodes))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5882 gnus-thread-expunge-below))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5883 (gnus-expunge-thread (pop nodes))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5884 (setq thread (pop nodes))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5885 (gnus-summary-limit-children thread))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5886 gnus-newsgroup-dependencies)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5887 ;; If this limitation resulted in an empty group, we might
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5888 ;; pop the previous limit and use it instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5889 (when (and (not gnus-newsgroup-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5890 show-if-empty)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5891 (setq gnus-newsgroup-limit (pop gnus-newsgroup-limits)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5892 gnus-newsgroup-limit))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5893
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5894 (defun gnus-summary-limit-children (thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5895 "Return 1 if this subthread is visible and 0 if it is not."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5896 ;; First we get the number of visible children to this thread. This
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5897 ;; is done by recursing down the thread using this function, so this
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5898 ;; will really go down to a leaf article first, before slowly
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5899 ;; working its way up towards the root.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5900 (when thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5901 (let ((children
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5902 (if (cdr thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5903 (apply '+ (mapcar 'gnus-summary-limit-children
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5904 (cdr thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5905 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5906 (number (mail-header-number (car thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5907 score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5908 (if (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5909 (not (memq number gnus-newsgroup-marked))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5910 (or
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5911 ;; If this article is dormant and has absolutely no visible
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5912 ;; children, then this article isn't visible.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5913 (and (memq number gnus-newsgroup-dormant)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5914 (zerop children))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5915 ;; If this is "fetch-old-headered" and there is no
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5916 ;; visible children, then we don't want this article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5917 (and (eq gnus-fetch-old-headers 'some)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5918 (gnus-summary-article-ancient-p number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5919 (zerop children))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5920 ;; If this is a sparsely inserted article with no children,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5921 ;; we don't want it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5922 (and (eq gnus-build-sparse-threads 'some)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5923 (gnus-summary-article-sparse-p number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5924 (zerop children))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5925 ;; If we use expunging, and this article is really
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5926 ;; low-scored, then we don't want this article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5927 (when (and gnus-summary-expunge-below
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5928 (< (setq score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5929 (or (cdr (assq number gnus-newsgroup-scored))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5930 gnus-summary-default-score))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5931 gnus-summary-expunge-below))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5932 ;; We increase the expunge-tally here, but that has
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5933 ;; nothing to do with the limits, really.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5934 (incf gnus-newsgroup-expunged-tally)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5935 ;; We also mark as read here, if that's wanted.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5936 (when (and gnus-summary-mark-below
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5937 (< score gnus-summary-mark-below))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5938 (setq gnus-newsgroup-unreads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5939 (delq number gnus-newsgroup-unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5940 (if gnus-newsgroup-auto-expire
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5941 (push number gnus-newsgroup-expirable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5942 (push (cons number gnus-low-score-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5943 gnus-newsgroup-reads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5944 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5945 ;; Check NoCeM things.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5946 (if (and gnus-use-nocem
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5947 (gnus-nocem-unwanted-article-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5948 (mail-header-id (car thread))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5949 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5950 (setq gnus-newsgroup-reads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5951 (delq number gnus-newsgroup-unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5952 t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5953 ;; Nope, invisible article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5954 0
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5955 ;; Ok, this article is to be visible, so we add it to the limit
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5956 ;; and return 1.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5957 (push number gnus-newsgroup-limit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5958 1))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5959
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5960 (defun gnus-expunge-thread (thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5961 "Mark all articles in THREAD as read."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5962 (let* ((number (mail-header-number (car thread))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5963 (incf gnus-newsgroup-expunged-tally)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5964 ;; We also mark as read here, if that's wanted.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5965 (setq gnus-newsgroup-unreads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5966 (delq number gnus-newsgroup-unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5967 (if gnus-newsgroup-auto-expire
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5968 (push number gnus-newsgroup-expirable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5969 (push (cons number gnus-low-score-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5970 gnus-newsgroup-reads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5971 ;; Go recursively through all subthreads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5972 (mapcar 'gnus-expunge-thread (cdr thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5973
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5974 ;; Summary article oriented commands
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5975
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5976 (defun gnus-summary-refer-parent-article (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5977 "Refer parent article N times.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5978 If N is negative, go to ancestor -N instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5979 The difference between N and the number of articles fetched is returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5980 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5981 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5982 (let ((skip 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5983 error header ref)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5984 (when (not (natnump n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5985 (setq skip (abs n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5986 n 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5987 (while (and (> n 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5988 (not error))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5989 (setq header (gnus-summary-article-header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5990 (if (and (eq (mail-header-number header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5991 (cdr gnus-article-current))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5992 (equal gnus-newsgroup-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5993 (car gnus-article-current)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5994 ;; If we try to find the parent of the currently
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5995 ;; displayed article, then we take a look at the actual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5996 ;; References header, since this is slightly more
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5997 ;; reliable than the References field we got from the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5998 ;; server.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
5999 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6000 (set-buffer gnus-original-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6001 (nnheader-narrow-to-headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6002 (unless (setq ref (message-fetch-field "references"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6003 (setq ref (message-fetch-field "in-reply-to")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6004 (widen))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6005 (setq ref
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6006 ;; It's not the current article, so we take a bet on
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6007 ;; the value we got from the server.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6008 (mail-header-references header)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6009 (if (and ref
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6010 (not (equal ref "")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6011 (unless (gnus-summary-refer-article (gnus-parent-id ref skip))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6012 (gnus-message 1 "Couldn't find parent"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6013 (gnus-message 1 "No references in article %d"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6014 (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6015 (setq error t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6016 (decf n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6017 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6018 n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6019
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6020 (defun gnus-summary-refer-references ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6021 "Fetch all articles mentioned in the References header.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6022 Return how many articles were fetched."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6023 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6024 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6025 (let ((ref (mail-header-references (gnus-summary-article-header)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6026 (current (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6027 (n 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6028 (if (or (not ref)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6029 (equal ref ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6030 (error "No References in the current article")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6031 ;; For each Message-ID in the References header...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6032 (while (string-match "<[^>]*>" ref)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6033 (incf n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6034 ;; ... fetch that article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6035 (gnus-summary-refer-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6036 (prog1 (match-string 0 ref)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6037 (setq ref (substring ref (match-end 0))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6038 (gnus-summary-goto-subject current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6039 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6040 n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6041
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6042 (defun gnus-summary-refer-article (message-id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6043 "Fetch an article specified by MESSAGE-ID."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6044 (interactive "sMessage-ID: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6045 (when (and (stringp message-id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6046 (not (zerop (length message-id))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6047 ;; Construct the correct Message-ID if necessary.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6048 ;; Suggested by tale@pawl.rpi.edu.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6049 (unless (string-match "^<" message-id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6050 (setq message-id (concat "<" message-id)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6051 (unless (string-match ">$" message-id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6052 (setq message-id (concat message-id ">")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6053 (let* ((header (gnus-id-to-header message-id))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6054 (sparse (and header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6055 (gnus-summary-article-sparse-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6056 (mail-header-number header)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6057 (if header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6058 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6059 ;; The article is present in the buffer, to we just go to it.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6060 (gnus-summary-goto-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6061 (mail-header-number header) nil header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6062 (when sparse
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6063 (gnus-summary-update-article (mail-header-number header))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6064 ;; We fetch the article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6065 (let ((gnus-override-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6066 (and (gnus-news-group-p gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6067 gnus-refer-article-method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6068 number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6069 ;; Start the special refer-article method, if necessary.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6070 (when (and gnus-refer-article-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6071 (gnus-news-group-p gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6072 (gnus-check-server gnus-refer-article-method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6073 ;; Fetch the header, and display the article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6074 (if (setq number (gnus-summary-insert-subject message-id))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6075 (gnus-summary-select-article nil nil nil number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6076 (gnus-message 3 "Couldn't fetch article %s" message-id)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6077
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6078 (defun gnus-summary-enter-digest-group (&optional force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6079 "Enter an nndoc group based on the current article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6080 If FORCE, force a digest interpretation. If not, try
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6081 to guess what the document format is."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6082 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6083 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6084 (let ((conf gnus-current-window-configuration))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6085 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6086 (gnus-summary-select-article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6087 (setq gnus-current-window-configuration conf)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6088 (let* ((name (format "%s-%d"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6089 (gnus-group-prefixed-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6090 gnus-newsgroup-name (list 'nndoc ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6091 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6092 (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6093 gnus-current-article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6094 (ogroup gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6095 (params (append (gnus-info-params (gnus-get-info ogroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6096 (list (cons 'to-group ogroup))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6097 (case-fold-search t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6098 (buf (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6099 dig)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6100 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6101 (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6102 (insert-buffer-substring gnus-original-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6103 ;; Remove lines that may lead nndoc to misinterpret the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6104 ;; document type.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6105 (narrow-to-region
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6106 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6107 (or (search-forward "\n\n" nil t) (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6108 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6109 (delete-matching-lines "^\\(Path\\):\\|^From ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6110 (widen))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6111 (unwind-protect
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6112 (if (gnus-group-read-ephemeral-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6113 name `(nndoc ,name (nndoc-address ,(get-buffer dig))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6114 (nndoc-article-type
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6115 ,(if force 'digest 'guess))) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6116 ;; Make all postings to this group go to the parent group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6117 (nconc (gnus-info-params (gnus-get-info name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6118 params)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6119 ;; Couldn't select this doc group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6120 (switch-to-buffer buf)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6121 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6122 (gnus-configure-windows 'summary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6123 (gnus-message 3 "Article couldn't be entered?"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6124 (kill-buffer dig)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6125
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6126 (defun gnus-summary-read-document (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6127 "Open a new group based on the current article(s).
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6128 This will allow you to read digests and other similar
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6129 documents as newsgroups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6130 Obeys the standard process/prefix convention."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6131 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6132 (let* ((articles (gnus-summary-work-articles n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6133 (ogroup gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6134 (params (append (gnus-info-params (gnus-get-info ogroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6135 (list (cons 'to-group ogroup))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6136 article group egroup groups vgroup)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6137 (while (setq article (pop articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6138 (setq group (format "%s-%d" gnus-newsgroup-name article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6139 (gnus-summary-remove-process-mark article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6140 (when (gnus-summary-display-article article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6141 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6142 (nnheader-temp-write nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6143 (insert-buffer-substring gnus-original-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6144 ;; Remove some headers that may lead nndoc to make
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6145 ;; the wrong guess.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6146 (message-narrow-to-head)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6147 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6148 (delete-matching-lines "^\\(Path\\):\\|^From ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6149 (widen)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6150 (if (setq egroup
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6151 (gnus-group-read-ephemeral-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6152 group `(nndoc ,group (nndoc-address ,(current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6153 (nndoc-article-type guess))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6154 t nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6155 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6156 ;; Make all postings to this group go to the parent group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6157 (nconc (gnus-info-params (gnus-get-info egroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6158 params)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6159 (push egroup groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6160 ;; Couldn't select this doc group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6161 (gnus-error 3 "Article couldn't be entered"))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6162 ;; Now we have selected all the documents.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6163 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6164 ((not groups)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6165 (error "None of the articles could be interpreted as documents"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6166 ((gnus-group-read-ephemeral-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6167 (setq vgroup (format
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6168 "nnvirtual:%s-%s" gnus-newsgroup-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6169 (format-time-string "%Y%m%dT%H%M%S" (current-time))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6170 `(nnvirtual ,vgroup (nnvirtual-component-groups ,groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6171 t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6172 (cons (current-buffer) 'summary)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6173 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6174 (error "Couldn't select virtual nndoc group")))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6175
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6176 (defun gnus-summary-isearch-article (&optional regexp-p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6177 "Do incremental search forward on the current article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6178 If REGEXP-P (the prefix) is non-nil, do regexp isearch."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6179 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6180 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6181 (gnus-summary-select-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6182 (gnus-configure-windows 'article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6183 (gnus-eval-in-buffer-window gnus-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6184 ;;(goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6185 (isearch-forward regexp-p)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6186
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6187 (defun gnus-summary-search-article-forward (regexp &optional backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6188 "Search for an article containing REGEXP forward.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6189 If BACKWARD, search backward instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6190 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6191 (list (read-string
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6192 (format "Search article %s (regexp%s): "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6193 (if current-prefix-arg "backward" "forward")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6194 (if gnus-last-search-regexp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6195 (concat ", default " gnus-last-search-regexp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6196 "")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6197 current-prefix-arg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6198 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6199 (if (string-equal regexp "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6200 (setq regexp (or gnus-last-search-regexp ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6201 (setq gnus-last-search-regexp regexp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6202 (if (gnus-summary-search-article regexp backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6203 (gnus-summary-show-thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6204 (error "Search failed: \"%s\"" regexp)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6205
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6206 (defun gnus-summary-search-article-backward (regexp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6207 "Search for an article containing REGEXP backward."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6208 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6209 (list (read-string
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6210 (format "Search article backward (regexp%s): "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6211 (if gnus-last-search-regexp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6212 (concat ", default " gnus-last-search-regexp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6213 "")))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6214 (gnus-summary-search-article-forward regexp 'backward))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6215
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6216 (defun gnus-summary-search-article (regexp &optional backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6217 "Search for an article containing REGEXP.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6218 Optional argument BACKWARD means do search for backward.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6219 `gnus-select-article-hook' is not called during the search."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6220 (let ((gnus-select-article-hook nil) ;Disable hook.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6221 (gnus-article-display-hook nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6222 (gnus-mark-article-hook nil) ;Inhibit marking as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6223 (gnus-use-article-prefetch nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6224 (gnus-xmas-force-redisplay nil) ;Inhibit XEmacs redisplay.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6225 (sum (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6226 (found nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6227 point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6228 (gnus-save-hidden-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6229 (gnus-summary-select-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6230 (set-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6231 (when backward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6232 (forward-line -1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6233 (while (not found)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6234 (gnus-message 7 "Searching article: %d..." (cdr gnus-article-current))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6235 (if (if backward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6236 (re-search-backward regexp nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6237 (re-search-forward regexp nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6238 ;; We found the regexp.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6239 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6240 (setq found 'found)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6241 (beginning-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6242 (set-window-start
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6243 (get-buffer-window (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6244 (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6245 (forward-line 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6246 (set-buffer sum)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6247 (setq point (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6248 ;; We didn't find it, so we go to the next article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6249 (set-buffer sum)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6250 (setq found 'not)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6251 (while (eq found 'not)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6252 (if (not (if backward (gnus-summary-find-prev)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6253 (gnus-summary-find-next)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6254 ;; No more articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6255 (setq found t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6256 ;; Select the next article and adjust point.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6257 (unless (gnus-summary-article-sparse-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6258 (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6259 (setq found nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6260 (gnus-summary-select-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6261 (set-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6262 (widen)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6263 (goto-char (if backward (point-max) (point-min))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6264 (gnus-message 7 ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6265 ;; Return whether we found the regexp.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6266 (when (eq found 'found)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6267 (goto-char point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6268 (gnus-summary-show-thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6269 (gnus-summary-goto-subject gnus-current-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6270 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6271 t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6272
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6273 (defun gnus-summary-find-matching (header regexp &optional backward unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6274 not-case-fold)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6275 "Return a list of all articles that match REGEXP on HEADER.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6276 The search stars on the current article and goes forwards unless
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6277 BACKWARD is non-nil. If BACKWARD is `all', do all articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6278 If UNREAD is non-nil, only unread articles will
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6279 be taken into consideration. If NOT-CASE-FOLD, case won't be folded
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6280 in the comparisons."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6281 (let ((data (if (eq backward 'all) gnus-newsgroup-data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6282 (gnus-data-find-list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6283 (gnus-summary-article-number) (gnus-data-list backward))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6284 (func `(lambda (h) (,(intern (concat "mail-header-" header)) h)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6285 (case-fold-search (not not-case-fold))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6286 articles d)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6287 (unless (fboundp (intern (concat "mail-header-" header)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6288 (error "%s is not a valid header" header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6289 (while data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6290 (setq d (car data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6291 (and (or (not unread) ; We want all articles...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6292 (gnus-data-unread-p d)) ; Or just unreads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6293 (vectorp (gnus-data-header d)) ; It's not a pseudo.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6294 (string-match regexp (funcall func (gnus-data-header d))) ; Match.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6295 (push (gnus-data-number d) articles)) ; Success!
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6296 (setq data (cdr data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6297 (nreverse articles)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6298
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6299 (defun gnus-summary-execute-command (header regexp command &optional backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6300 "Search forward for an article whose HEADER matches REGEXP and execute COMMAND.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6301 If HEADER is an empty string (or nil), the match is done on the entire
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6302 article. If BACKWARD (the prefix) is non-nil, search backward instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6303 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6304 (list (let ((completion-ignore-case t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6305 (completing-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6306 "Header name: "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6307 (mapcar (lambda (string) (list string))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6308 '("Number" "Subject" "From" "Lines" "Date"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6309 "Message-ID" "Xref" "References" "Body"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6310 nil 'require-match))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6311 (read-string "Regexp: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6312 (read-key-sequence "Command: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6313 current-prefix-arg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6314 (when (equal header "Body")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6315 (setq header ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6316 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6317 ;; Hidden thread subtrees must be searched as well.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6318 (gnus-summary-show-all-threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6319 ;; We don't want to change current point nor window configuration.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6320 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6321 (save-window-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6322 (gnus-message 6 "Executing %s..." (key-description command))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6323 ;; We'd like to execute COMMAND interactively so as to give arguments.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6324 (gnus-execute header regexp
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6325 `(call-interactively ',(key-binding command))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6326 backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6327 (gnus-message 6 "Executing %s...done" (key-description command)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6328
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6329 (defun gnus-summary-beginning-of-article ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6330 "Scroll the article back to the beginning."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6331 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6332 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6333 (gnus-summary-select-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6334 (gnus-configure-windows 'article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6335 (gnus-eval-in-buffer-window gnus-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6336 (widen)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6337 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6338 (when gnus-break-pages
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6339 (gnus-narrow-to-page))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6340
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6341 (defun gnus-summary-end-of-article ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6342 "Scroll to the end of the article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6343 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6344 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6345 (gnus-summary-select-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6346 (gnus-configure-windows 'article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6347 (gnus-eval-in-buffer-window gnus-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6348 (widen)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6349 (goto-char (point-max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6350 (recenter -3)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6351 (when gnus-break-pages
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6352 (gnus-narrow-to-page))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6353
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6354 (defun gnus-summary-print-article (&optional filename)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6355 "Generate and print a PostScript image of the article buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6356
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6357 If the optional argument FILENAME is nil, send the image to the printer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6358 If FILENAME is a string, save the PostScript image in a file with that
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6359 name. If FILENAME is a number, prompt the user for the name of the file
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6360 to save in."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6361 (interactive (list (ps-print-preprint current-prefix-arg)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6362 (gnus-summary-select-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6363 (gnus-eval-in-buffer-window gnus-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6364 (let ((buffer (generate-new-buffer " *print*")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6365 (unwind-protect
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6366 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6367 (copy-to-buffer buffer (point-min) (point-max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6368 (set-buffer buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6369 (gnus-article-delete-invisible-text)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6370 (ps-print-buffer-with-faces filename))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6371 (kill-buffer buffer)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6372
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6373 (defun gnus-summary-show-article (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6374 "Force re-fetching of the current article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6375 If ARG (the prefix) is non-nil, show the raw article without any
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6376 article massaging functions being run."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6377 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6378 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6379 (if (not arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6380 ;; Select the article the normal way.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6381 (gnus-summary-select-article nil 'force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6382 ;; Bind the article treatment functions to nil.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6383 (let ((gnus-have-all-headers t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6384 gnus-article-display-hook
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6385 gnus-article-prepare-hook
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6386 gnus-break-pages
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6387 gnus-visual)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6388 (gnus-summary-select-article nil 'force)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6389 (gnus-summary-goto-subject gnus-current-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6390 ; (gnus-configure-windows 'article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6391 (gnus-summary-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6392
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6393 (defun gnus-summary-verbose-headers (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6394 "Toggle permanent full header display.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6395 If ARG is a positive number, turn header display on.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6396 If ARG is a negative number, turn header display off."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6397 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6398 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6399 (setq gnus-show-all-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6400 (cond ((or (not (numberp arg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6401 (zerop arg))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6402 (not gnus-show-all-headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6403 ((natnump arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6404 t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6405 (gnus-summary-show-article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6406
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6407 (defun gnus-summary-toggle-header (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6408 "Show the headers if they are hidden, or hide them if they are shown.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6409 If ARG is a positive number, show the entire header.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6410 If ARG is a negative number, hide the unwanted header lines."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6411 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6412 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6413 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6414 (set-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6415 (let* ((buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6416 (inhibit-point-motion-hooks t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6417 (hidden (text-property-any
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6418 (goto-char (point-min)) (search-forward "\n\n")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6419 'invisible t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6420 e)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6421 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6422 (when (search-forward "\n\n" nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6423 (delete-region (point-min) (1- (point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6424 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6425 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6426 (set-buffer gnus-original-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6427 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6428 (setq e (1- (or (search-forward "\n\n" nil t) (point-max)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6429 (insert-buffer-substring gnus-original-article-buffer 1 e)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6430 (let ((article-inhibit-hiding t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6431 (run-hooks 'gnus-article-display-hook))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6432 (when (or (not hidden) (and (numberp arg) (< arg 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6433 (gnus-article-hide-headers)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6434
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6435 (defun gnus-summary-show-all-headers ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6436 "Make all header lines visible."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6437 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6438 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6439 (gnus-article-show-all-headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6440
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6441 (defun gnus-summary-toggle-mime (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6442 "Toggle MIME processing.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6443 If ARG is a positive number, turn MIME processing on."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6444 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6445 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6446 (setq gnus-show-mime
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6447 (if (null arg) (not gnus-show-mime)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6448 (> (prefix-numeric-value arg) 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6449 (gnus-summary-select-article t 'force))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6450
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6451 (defun gnus-summary-caesar-message (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6452 "Caesar rotate the current article by 13.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6453 The numerical prefix specifies how many places to rotate each letter
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6454 forward."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6455 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6456 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6457 (gnus-summary-select-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6458 (let ((mail-header-separator ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6459 (gnus-eval-in-buffer-window gnus-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6460 (save-restriction
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6461 (widen)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6462 (let ((start (window-start))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6463 buffer-read-only)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6464 (message-caesar-buffer-body arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6465 (set-window-start (get-buffer-window (current-buffer)) start))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6466
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6467 (defun gnus-summary-stop-page-breaking ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6468 "Stop page breaking in the current article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6469 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6470 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6471 (gnus-summary-select-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6472 (gnus-eval-in-buffer-window gnus-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6473 (widen)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6474 (when (gnus-visual-p 'page-marker)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6475 (let ((buffer-read-only nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6476 (gnus-remove-text-with-property 'gnus-prev)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6477 (gnus-remove-text-with-property 'gnus-next)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6478
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6479 (defun gnus-summary-move-article (&optional n to-newsgroup
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6480 select-method action)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6481 "Move the current article to a different newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6482 If N is a positive number, move the N next articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6483 If N is a negative number, move the N previous articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6484 If N is nil and any articles have been marked with the process mark,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6485 move those articles instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6486 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6487 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6488 re-spool using this method.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6489
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6490 For this function to work, both the current newsgroup and the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6491 newsgroup that you want to move to have to support the `request-move'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6492 and `request-accept' functions."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6493 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6494 (unless action
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6495 (setq action 'move))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6496 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6497 ;; Disable marking as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6498 (let (gnus-mark-article-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6499 (save-window-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6500 (gnus-summary-select-article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6501 ;; Check whether the source group supports the required functions.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6502 (cond ((and (eq action 'move)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6503 (not (gnus-check-backend-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6504 'request-move-article gnus-newsgroup-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6505 (error "The current group does not support article moving"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6506 ((and (eq action 'crosspost)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6507 (not (gnus-check-backend-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6508 'request-replace-article gnus-newsgroup-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6509 (error "The current group does not support article editing")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6510 (let ((articles (gnus-summary-work-articles n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6511 (prefix (gnus-group-real-prefix gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6512 (names '((move "Move" "Moving")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6513 (copy "Copy" "Copying")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6514 (crosspost "Crosspost" "Crossposting")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6515 (copy-buf (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6516 (nnheader-set-temp-buffer " *copy article*")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6517 art-group to-method new-xref article to-groups)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6518 (unless (assq action names)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6519 (error "Unknown action %s" action))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6520 ;; Read the newsgroup name.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6521 (when (and (not to-newsgroup)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6522 (not select-method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6523 (setq to-newsgroup
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6524 (gnus-read-move-group-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6525 (cadr (assq action names))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6526 (symbol-value (intern (format "gnus-current-%s-group" action)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6527 articles prefix))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6528 (set (intern (format "gnus-current-%s-group" action)) to-newsgroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6529 (setq to-method (or select-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6530 (gnus-group-name-to-method to-newsgroup)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6531 ;; Check the method we are to move this article to...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6532 (unless (gnus-check-backend-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6533 'request-accept-article (car to-method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6534 (error "%s does not support article copying" (car to-method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6535 (unless (gnus-check-server to-method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6536 (error "Can't open server %s" (car to-method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6537 (gnus-message 6 "%s to %s: %s..."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6538 (caddr (assq action names))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6539 (or (car select-method) to-newsgroup) articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6540 (while articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6541 (setq article (pop articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6542 (setq
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6543 art-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6544 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6545 ;; Move the article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6546 ((eq action 'move)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6547 (gnus-request-move-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6548 article ; Article to move
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6549 gnus-newsgroup-name ; From newsgroup
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6550 (nth 1 (gnus-find-method-for-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6551 gnus-newsgroup-name)) ; Server
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6552 (list 'gnus-request-accept-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6553 to-newsgroup (list 'quote select-method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6554 (not articles)) ; Accept form
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6555 (not articles))) ; Only save nov last time
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6556 ;; Copy the article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6557 ((eq action 'copy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6558 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6559 (set-buffer copy-buf)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6560 (gnus-request-article-this-buffer article gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6561 (gnus-request-accept-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6562 to-newsgroup select-method (not articles))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6563 ;; Crosspost the article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6564 ((eq action 'crosspost)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6565 (let ((xref (message-tokenize-header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6566 (mail-header-xref (gnus-summary-article-header article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6567 " ")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6568 (setq new-xref (concat (gnus-group-real-name gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6569 ":" article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6570 (unless xref
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6571 (setq xref (list (system-name))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6572 (setq new-xref
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6573 (concat
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6574 (mapconcat 'identity
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6575 (delete "Xref:" (delete new-xref xref))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6576 " ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6577 new-xref))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6578 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6579 (set-buffer copy-buf)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6580 (gnus-request-article-this-buffer article gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6581 (nnheader-replace-header "xref" new-xref)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6582 (gnus-request-accept-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6583 to-newsgroup select-method (not articles)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6584 (if (not art-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6585 (gnus-message 1 "Couldn't %s article %s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6586 (cadr (assq action names)) article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6587 (let* ((entry
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6588 (or
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6589 (gnus-gethash (car art-group) gnus-newsrc-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6590 (gnus-gethash
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6591 (gnus-group-prefixed-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6592 (car art-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6593 (or select-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6594 (gnus-find-method-for-group to-newsgroup)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6595 gnus-newsrc-hashtb)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6596 (info (nth 2 entry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6597 (to-group (gnus-info-group info)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6598 ;; Update the group that has been moved to.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6599 (when (and info
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6600 (memq action '(move copy)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6601 (unless (member to-group to-groups)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6602 (push to-group to-groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6603
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6604 (unless (memq article gnus-newsgroup-unreads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6605 (gnus-info-set-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6606 info (gnus-add-to-range (gnus-info-read info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6607 (list (cdr art-group)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6608
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6609 ;; Copy any marks over to the new group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6610 (let ((marks gnus-article-mark-lists)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6611 (to-article (cdr art-group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6612
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6613 ;; See whether the article is to be put in the cache.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6614 (when gnus-use-cache
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6615 (gnus-cache-possibly-enter-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6616 to-group to-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6617 (let ((header (copy-sequence
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6618 (gnus-summary-article-header article))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6619 (mail-header-set-number header to-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6620 header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6621 (memq article gnus-newsgroup-marked)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6622 (memq article gnus-newsgroup-dormant)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6623 (memq article gnus-newsgroup-unreads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6624
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6625 (while marks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6626 (when (memq article (symbol-value
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6627 (intern (format "gnus-newsgroup-%s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6628 (caar marks)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6629 ;; If the other group is the same as this group,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6630 ;; then we have to add the mark to the list.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6631 (when (equal to-group gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6632 (set (intern (format "gnus-newsgroup-%s" (caar marks)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6633 (cons to-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6634 (symbol-value
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6635 (intern (format "gnus-newsgroup-%s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6636 (caar marks)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6637 ;; Copy mark to other group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6638 (gnus-add-marked-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6639 to-group (cdar marks) (list to-article) info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6640 (setq marks (cdr marks)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6641
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6642 ;; Update the Xref header in this article to point to
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6643 ;; the new crossposted article we have just created.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6644 (when (eq action 'crosspost)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6645 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6646 (set-buffer copy-buf)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6647 (gnus-request-article-this-buffer article gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6648 (nnheader-replace-header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6649 "xref" (concat new-xref " " (car art-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6650 ":" (cdr art-group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6651 (gnus-request-replace-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6652 article gnus-newsgroup-name (current-buffer)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6653
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6654 (gnus-summary-goto-subject article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6655 (when (eq action 'move)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6656 (gnus-summary-mark-article article gnus-canceled-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6657 (gnus-summary-remove-process-mark article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6658 ;; Re-activate all groups that have been moved to.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6659 (while to-groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6660 (gnus-activate-group (pop to-groups)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6661
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6662 (gnus-kill-buffer copy-buf)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6663 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6664 (gnus-set-mode-line 'summary)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6665
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6666 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6667 "Move the current article to a different newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6668 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6669 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6670 re-spool using this method."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6671 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6672 (gnus-summary-move-article n nil select-method 'copy))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6673
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6674 (defun gnus-summary-crosspost-article (&optional n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6675 "Crosspost the current article to some other group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6676 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6677 (gnus-summary-move-article n nil nil 'crosspost))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6678
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6679 (defcustom gnus-summary-respool-default-method nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6680 "Default method for respooling an article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6681 If nil, use to the current newsgroup method."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6682 :type 'gnus-select-method-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6683 :group 'gnus-summary-mail)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6684
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6685 (defun gnus-summary-respool-article (&optional n method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6686 "Respool the current article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6687 The article will be squeezed through the mail spooling process again,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6688 which means that it will be put in some mail newsgroup or other
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6689 depending on `nnmail-split-methods'.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6690 If N is a positive number, respool the N next articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6691 If N is a negative number, respool the N previous articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6692 If N is nil and any articles have been marked with the process mark,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6693 respool those articles instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6694
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6695 Respooling can be done both from mail groups and \"real\" newsgroups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6696 In the former case, the articles in question will be moved from the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6697 current group into whatever groups they are destined to. In the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6698 latter case, they will be copied into the relevant groups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6699 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6700 (list current-prefix-arg
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6701 (let* ((methods (gnus-methods-using 'respool))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6702 (methname
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6703 (symbol-name (or gnus-summary-respool-default-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6704 (car (gnus-find-method-for-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6705 gnus-newsgroup-name)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6706 (method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6707 (gnus-completing-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6708 methname "What backend do you want to use when respooling?"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6709 methods nil t nil 'gnus-mail-method-history))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6710 ms)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6711 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6712 ((zerop (length (setq ms (gnus-servers-using-backend
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6713 (intern method)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6714 (list (intern method) ""))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6715 ((= 1 (length ms))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6716 (car ms))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6717 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6718 (let ((ms-alist (mapcar (lambda (m) (cons (cadr m) m)) ms)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6719 (cdr (assoc (completing-read "Server name: " ms-alist nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6720 ms-alist))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6721 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6722 (unless method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6723 (error "No method given for respooling"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6724 (if (assoc (symbol-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6725 (car (gnus-find-method-for-group gnus-newsgroup-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6726 (gnus-methods-using 'respool))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6727 (gnus-summary-move-article n nil method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6728 (gnus-summary-copy-article n nil method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6729
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6730 (defun gnus-summary-import-article (file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6731 "Import a random file into a mail newsgroup."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6732 (interactive "fImport file: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6733 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6734 (let ((group gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6735 (now (current-time))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6736 atts lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6737 (unless (gnus-check-backend-function 'request-accept-article group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6738 (error "%s does not support article importing" group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6739 (or (file-readable-p file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6740 (not (file-regular-p file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6741 (error "Can't read %s" file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6742 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6743 (set-buffer (get-buffer-create " *import file*"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6744 (buffer-disable-undo (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6745 (erase-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6746 (insert-file-contents file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6747 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6748 (unless (nnheader-article-p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6749 ;; This doesn't look like an article, so we fudge some headers.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6750 (setq atts (file-attributes file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6751 lines (count-lines (point-min) (point-max)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6752 (insert "From: " (read-string "From: ") "\n"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6753 "Subject: " (read-string "Subject: ") "\n"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6754 "Date: " (timezone-make-date-arpa-standard
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6755 (current-time-string (nth 5 atts))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6756 (current-time-zone now)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6757 (current-time-zone now))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6758 "\n"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6759 "Message-ID: " (message-make-message-id) "\n"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6760 "Lines: " (int-to-string lines) "\n"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6761 "Chars: " (int-to-string (nth 7 atts)) "\n\n"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6762 (gnus-request-accept-article group nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6763 (kill-buffer (current-buffer)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6764
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6765 (defun gnus-summary-article-posted-p ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6766 "Say whether the current (mail) article is available from `gnus-select-method' as well.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6767 This will be the case if the article has both been mailed and posted."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6768 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6769 (let ((id (mail-header-references (gnus-summary-article-header)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6770 (gnus-override-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6771 (or gnus-refer-article-method gnus-select-method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6772 (if (gnus-request-head id "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6773 (gnus-message 2 "The current message was found on %s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6774 gnus-override-method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6775 (gnus-message 2 "The current message couldn't be found on %s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6776 gnus-override-method)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6777 nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6778
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6779 (defun gnus-summary-expire-articles (&optional now)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6780 "Expire all articles that are marked as expirable in the current group."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6781 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6782 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6783 (when (gnus-check-backend-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6784 'request-expire-articles gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6785 ;; This backend supports expiry.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6786 (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6787 (expirable (if total
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6788 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6789 ;; We need to update the info for
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6790 ;; this group for `gnus-list-of-read-articles'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6791 ;; to give us the right answer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6792 (run-hooks 'gnus-exit-group-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6793 (gnus-summary-update-info)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6794 (gnus-list-of-read-articles gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6795 (setq gnus-newsgroup-expirable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6796 (sort gnus-newsgroup-expirable '<))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6797 (expiry-wait (if now 'immediate
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6798 (gnus-group-find-parameter
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6799 gnus-newsgroup-name 'expiry-wait)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6800 es)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6801 (when expirable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6802 ;; There are expirable articles in this group, so we run them
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6803 ;; through the expiry process.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6804 (gnus-message 6 "Expiring articles...")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6805 ;; The list of articles that weren't expired is returned.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6806 (if expiry-wait
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6807 (let ((nnmail-expiry-wait-function nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6808 (nnmail-expiry-wait expiry-wait))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6809 (setq es (gnus-request-expire-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6810 expirable gnus-newsgroup-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6811 (setq es (gnus-request-expire-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6812 expirable gnus-newsgroup-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6813 (unless total
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6814 (setq gnus-newsgroup-expirable es))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6815 ;; We go through the old list of expirable, and mark all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6816 ;; really expired articles as nonexistent.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6817 (unless (eq es expirable) ;If nothing was expired, we don't mark.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6818 (let ((gnus-use-cache nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6819 (while expirable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6820 (unless (memq (car expirable) es)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6821 (when (gnus-data-find (car expirable))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6822 (gnus-summary-mark-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6823 (car expirable) gnus-canceled-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6824 (setq expirable (cdr expirable)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6825 (gnus-message 6 "Expiring articles...done")))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6826
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6827 (defun gnus-summary-expire-articles-now ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6828 "Expunge all expirable articles in the current group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6829 This means that *all* articles that are marked as expirable will be
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6830 deleted forever, right now."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6831 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6832 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6833 (or gnus-expert-user
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6834 (gnus-yes-or-no-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6835 "Are you really, really, really sure you want to delete all these messages? ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6836 (error "Phew!"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6837 (gnus-summary-expire-articles t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6838
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6839 ;; Suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6840 (defun gnus-summary-delete-article (&optional n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6841 "Delete the N next (mail) articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6842 This command actually deletes articles. This is not a marking
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6843 command. The article will disappear forever from your life, never to
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6844 return.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6845 If N is negative, delete backwards.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6846 If N is nil and articles have been marked with the process mark,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6847 delete these instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6848 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6849 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6850 (unless (gnus-check-backend-function 'request-expire-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6851 gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6852 (error "The current newsgroup does not support article deletion."))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6853 ;; Compute the list of articles to delete.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6854 (let ((articles (gnus-summary-work-articles n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6855 not-deleted)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6856 (if (and gnus-novice-user
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6857 (not (gnus-yes-or-no-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6858 (format "Do you really want to delete %s forever? "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6859 (if (> (length articles) 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6860 (format "these %s articles" (length articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6861 "this article")))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6862 ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6863 ;; Delete the articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6864 (setq not-deleted (gnus-request-expire-articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6865 articles gnus-newsgroup-name 'force))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6866 (while articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6867 (gnus-summary-remove-process-mark (car articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6868 ;; The backend might not have been able to delete the article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6869 ;; after all.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6870 (unless (memq (car articles) not-deleted)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6871 (gnus-summary-mark-article (car articles) gnus-canceled-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6872 (setq articles (cdr articles))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6873 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6874 (gnus-set-mode-line 'summary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6875 not-deleted))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6876
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6877 (defun gnus-summary-edit-article (&optional force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6878 "Edit the current article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6879 This will have permanent effect only in mail groups.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6880 If FORCE is non-nil, allow editing of articles even in read-only
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6881 groups."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6882 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6883 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6884 (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6885 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6886 (when (and (not force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6887 (gnus-group-read-only-p))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6888 (error "The current newsgroup does not support article editing."))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6889 ;; Select article if needed.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6890 (unless (eq (gnus-summary-article-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6891 gnus-current-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6892 (gnus-summary-select-article t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6893 (gnus-article-edit-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6894 `(lambda ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6895 (gnus-summary-edit-article-done
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6896 ,(or (mail-header-references gnus-current-headers) "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6897 ,(gnus-group-read-only-p) ,gnus-summary-buffer)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6898
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6899 (defalias 'gnus-summary-edit-article-postpone 'gnus-article-edit-exit)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6900
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6901 (defun gnus-summary-edit-article-done (&optional references read-only buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6902 "Make edits to the current article permanent."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6903 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6904 ;; Replace the article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6905 (if (and (not read-only)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6906 (not (gnus-request-replace-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6907 (cdr gnus-article-current) (car gnus-article-current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6908 (current-buffer))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6909 (error "Couldn't replace article.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6910 ;; Update the summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6911 (if (and references
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6912 (equal (message-tokenize-header references " ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6913 (message-tokenize-header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6914 (or (message-fetch-field "references") "") " ")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6915 ;; We only have to update this line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6916 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6917 (save-restriction
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6918 (message-narrow-to-head)
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6919 (let ((head (buffer-string))
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6920 header)
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6921 (nnheader-temp-write nil
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6922 (insert (format "211 %d Article retrieved.\n"
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6923 (cdr gnus-article-current)))
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6924 (insert head)
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6925 (insert ".\n")
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6926 (let ((nntp-server-buffer (current-buffer)))
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6927 (setq header (car (gnus-get-newsgroup-headers
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6928 (save-excursion
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6929 (set-buffer gnus-summary-buffer)
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6930 gnus-newsgroup-dependencies)
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6931 t))))
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6932 (save-excursion
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6933 (set-buffer gnus-summary-buffer)
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6934 (gnus-data-set-header
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6935 (gnus-data-find (cdr gnus-article-current))
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6936 header)
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6937 (gnus-summary-update-article-line
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
6938 (cdr gnus-article-current) header))))))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6939 ;; Update threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6940 (set-buffer (or buffer gnus-summary-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6941 (gnus-summary-update-article (cdr gnus-article-current)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6942 ;; Prettify the article buffer again.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6943 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6944 (set-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6945 (run-hooks 'gnus-article-display-hook))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6946 ;; Prettify the summary buffer line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6947 (when (gnus-visual-p 'summary-highlight 'highlight)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6948 (run-hooks 'gnus-visual-mark-article-hook))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6949
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6950 (defun gnus-summary-edit-wash (key)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6951 "Perform editing command in the article buffer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6952 (interactive
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6953 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6954 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6955 (message "%s" (concat (this-command-keys) "- "))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6956 (read-char))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6957 (message "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6958 (gnus-summary-edit-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6959 (execute-kbd-macro (concat (this-command-keys) key))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6960 (gnus-article-edit-done))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6961
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6962 ;;; Respooling
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6963
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6964 (defun gnus-summary-respool-query ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6965 "Query where the respool algorithm would put this article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6966 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6967 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6968 (let (gnus-mark-article-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6969 (gnus-summary-select-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6970 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6971 (set-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6972 (save-restriction
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6973 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6974 (search-forward "\n\n")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6975 (narrow-to-region (point-min) (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6976 (message "This message would go to %s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6977 (mapconcat 'car (nnmail-article-group 'identity) ", "))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6978
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6979 ;; Summary marking commands.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6980
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6981 (defun gnus-summary-kill-same-subject-and-select (&optional unmark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6982 "Mark articles which has the same subject as read, and then select the next.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6983 If UNMARK is positive, remove any kind of mark.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6984 If UNMARK is negative, tick articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6985 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6986 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6987 (when unmark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6988 (setq unmark (prefix-numeric-value unmark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6989 (let ((count
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6990 (gnus-summary-mark-same-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6991 (gnus-summary-article-subject) unmark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6992 ;; Select next unread article. If auto-select-same mode, should
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6993 ;; select the first unread article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6994 (gnus-summary-next-article t (and gnus-auto-select-same
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6995 (gnus-summary-article-subject)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6996 (gnus-message 7 "%d article%s marked as %s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6997 count (if (= count 1) " is" "s are")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6998 (if unmark "unread" "read"))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
6999
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7000 (defun gnus-summary-kill-same-subject (&optional unmark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7001 "Mark articles which has the same subject as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7002 If UNMARK is positive, remove any kind of mark.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7003 If UNMARK is negative, tick articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7004 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7005 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7006 (when unmark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7007 (setq unmark (prefix-numeric-value unmark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7008 (let ((count
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7009 (gnus-summary-mark-same-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7010 (gnus-summary-article-subject) unmark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7011 ;; If marked as read, go to next unread subject.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7012 (when (null unmark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7013 ;; Go to next unread subject.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7014 (gnus-summary-next-subject 1 t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7015 (gnus-message 7 "%d articles are marked as %s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7016 count (if unmark "unread" "read"))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7017
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7018 (defun gnus-summary-mark-same-subject (subject &optional unmark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7019 "Mark articles with same SUBJECT as read, and return marked number.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7020 If optional argument UNMARK is positive, remove any kinds of marks.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7021 If optional argument UNMARK is negative, mark articles as unread instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7022 (let ((count 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7023 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7024 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7025 ((null unmark) ; Mark as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7026 (while (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7027 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7028 (gnus-summary-mark-article-as-read gnus-killed-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7029 (gnus-summary-show-thread) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7030 (gnus-summary-find-subject subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7031 (setq count (1+ count))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7032 ((> unmark 0) ; Tick.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7033 (while (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7034 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7035 (gnus-summary-mark-article-as-unread gnus-ticked-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7036 (gnus-summary-show-thread) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7037 (gnus-summary-find-subject subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7038 (setq count (1+ count))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7039 (t ; Mark as unread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7040 (while (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7041 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7042 (gnus-summary-mark-article-as-unread gnus-unread-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7043 (gnus-summary-show-thread) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7044 (gnus-summary-find-subject subject))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7045 (setq count (1+ count)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7046 (gnus-set-mode-line 'summary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7047 ;; Return the number of marked articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7048 count)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7049
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7050 (defun gnus-summary-mark-as-processable (n &optional unmark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7051 "Set the process mark on the next N articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7052 If N is negative, mark backward instead. If UNMARK is non-nil, remove
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7053 the process mark instead. The difference between N and the actual
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7054 number of articles marked is returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7055 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7056 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7057 (let ((backward (< n 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7058 (n (abs n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7059 (while (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7060 (> n 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7061 (if unmark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7062 (gnus-summary-remove-process-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7063 (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7064 (gnus-summary-set-process-mark (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7065 (zerop (gnus-summary-next-subject (if backward -1 1) nil t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7066 (setq n (1- n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7067 (when (/= 0 n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7068 (gnus-message 7 "No more articles"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7069 (gnus-summary-recenter)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7070 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7071 n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7072
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7073 (defun gnus-summary-unmark-as-processable (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7074 "Remove the process mark from the next N articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7075 If N is negative, mark backward instead. The difference between N and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7076 the actual number of articles marked is returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7077 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7078 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7079 (gnus-summary-mark-as-processable n t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7080
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7081 (defun gnus-summary-unmark-all-processable ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7082 "Remove the process mark from all articles."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7083 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7084 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7085 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7086 (while gnus-newsgroup-processable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7087 (gnus-summary-remove-process-mark (car gnus-newsgroup-processable))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7088 (gnus-summary-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7089
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7090 (defun gnus-summary-mark-as-expirable (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7091 "Mark N articles forward as expirable.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7092 If N is negative, mark backward instead. The difference between N and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7093 the actual number of articles marked is returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7094 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7095 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7096 (gnus-summary-mark-forward n gnus-expirable-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7097
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7098 (defun gnus-summary-mark-article-as-replied (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7099 "Mark ARTICLE replied and update the summary line."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7100 (push article gnus-newsgroup-replied)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7101 (let ((buffer-read-only nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7102 (when (gnus-summary-goto-subject article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7103 (gnus-summary-update-secondary-mark article))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7104
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7105 (defun gnus-summary-set-bookmark (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7106 "Set a bookmark in current article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7107 (interactive (list (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7108 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7109 (when (or (not (get-buffer gnus-article-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7110 (not gnus-current-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7111 (not gnus-article-current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7112 (not (equal gnus-newsgroup-name (car gnus-article-current))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7113 (error "No current article selected"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7114 ;; Remove old bookmark, if one exists.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7115 (let ((old (assq article gnus-newsgroup-bookmarks)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7116 (when old
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7117 (setq gnus-newsgroup-bookmarks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7118 (delq old gnus-newsgroup-bookmarks))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7119 ;; Set the new bookmark, which is on the form
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7120 ;; (article-number . line-number-in-body).
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7121 (push
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7122 (cons article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7123 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7124 (set-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7125 (count-lines
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7126 (min (point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7127 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7128 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7129 (search-forward "\n\n" nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7130 (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7131 (point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7132 gnus-newsgroup-bookmarks)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7133 (gnus-message 6 "A bookmark has been added to the current article."))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7134
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7135 (defun gnus-summary-remove-bookmark (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7136 "Remove the bookmark from the current article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7137 (interactive (list (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7138 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7139 ;; Remove old bookmark, if one exists.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7140 (let ((old (assq article gnus-newsgroup-bookmarks)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7141 (if old
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7142 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7143 (setq gnus-newsgroup-bookmarks
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7144 (delq old gnus-newsgroup-bookmarks))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7145 (gnus-message 6 "Removed bookmark."))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7146 (gnus-message 6 "No bookmark in current article."))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7147
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7148 ;; Suggested by Daniel Quinlan <quinlan@best.com>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7149 (defun gnus-summary-mark-as-dormant (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7150 "Mark N articles forward as dormant.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7151 If N is negative, mark backward instead. The difference between N and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7152 the actual number of articles marked is returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7153 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7154 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7155 (gnus-summary-mark-forward n gnus-dormant-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7156
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7157 (defun gnus-summary-set-process-mark (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7158 "Set the process mark on ARTICLE and update the summary line."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7159 (setq gnus-newsgroup-processable
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7160 (cons article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7161 (delq article gnus-newsgroup-processable)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7162 (when (gnus-summary-goto-subject article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7163 (gnus-summary-show-thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7164 (gnus-summary-update-secondary-mark article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7165
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7166 (defun gnus-summary-remove-process-mark (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7167 "Remove the process mark from ARTICLE and update the summary line."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7168 (setq gnus-newsgroup-processable (delq article gnus-newsgroup-processable))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7169 (when (gnus-summary-goto-subject article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7170 (gnus-summary-show-thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7171 (gnus-summary-update-secondary-mark article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7172
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7173 (defun gnus-summary-set-saved-mark (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7174 "Set the process mark on ARTICLE and update the summary line."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7175 (push article gnus-newsgroup-saved)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7176 (when (gnus-summary-goto-subject article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7177 (gnus-summary-update-secondary-mark article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7178
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7179 (defun gnus-summary-mark-forward (n &optional mark no-expire)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7180 "Mark N articles as read forwards.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7181 If N is negative, mark backwards instead. Mark with MARK, ?r by default.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7182 The difference between N and the actual number of articles marked is
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7183 returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7184 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7185 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7186 (let ((backward (< n 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7187 (gnus-summary-goto-unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7188 (and gnus-summary-goto-unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7189 (not (eq gnus-summary-goto-unread 'never))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7190 (not (memq mark (list gnus-unread-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7191 gnus-ticked-mark gnus-dormant-mark)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7192 (n (abs n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7193 (mark (or mark gnus-del-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7194 (while (and (> n 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7195 (gnus-summary-mark-article nil mark no-expire)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7196 (zerop (gnus-summary-next-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7197 (if backward -1 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7198 (and gnus-summary-goto-unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7199 (not (eq gnus-summary-goto-unread 'never)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7200 t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7201 (setq n (1- n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7202 (when (/= 0 n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7203 (gnus-message 7 "No more %sarticles" (if mark "" "unread ")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7204 (gnus-summary-recenter)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7205 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7206 (gnus-set-mode-line 'summary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7207 n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7208
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7209 (defun gnus-summary-mark-article-as-read (mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7210 "Mark the current article quickly as read with MARK."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7211 (let ((article (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7212 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7213 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7214 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7215 (push (cons article mark) gnus-newsgroup-reads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7216 ;; Possibly remove from cache, if that is used.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7217 (when gnus-use-cache
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7218 (gnus-cache-enter-remove-article article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7219 ;; Allow the backend to change the mark.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7220 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7221 ;; Check for auto-expiry.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7222 (when (and gnus-newsgroup-auto-expire
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7223 (or (= mark gnus-killed-mark) (= mark gnus-del-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7224 (= mark gnus-catchup-mark) (= mark gnus-low-score-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7225 (= mark gnus-ancient-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7226 (= mark gnus-read-mark) (= mark gnus-souped-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7227 (= mark gnus-duplicate-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7228 (setq mark gnus-expirable-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7229 (push article gnus-newsgroup-expirable))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7230 ;; Set the mark in the buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7231 (gnus-summary-update-mark mark 'unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7232 t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7233
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7234 (defun gnus-summary-mark-article-as-unread (mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7235 "Mark the current article quickly as unread with MARK."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7236 (let ((article (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7237 (if (< article 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7238 (gnus-error 1 "Unmarkable article")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7239 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7240 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7241 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7242 (setq gnus-newsgroup-reads (delq article gnus-newsgroup-reads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7243 (cond ((= mark gnus-ticked-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7244 (push article gnus-newsgroup-marked))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7245 ((= mark gnus-dormant-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7246 (push article gnus-newsgroup-dormant))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7247 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7248 (push article gnus-newsgroup-unreads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7249 (setq gnus-newsgroup-reads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7250 (delq (assq article gnus-newsgroup-reads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7251 gnus-newsgroup-reads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7252
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7253 ;; See whether the article is to be put in the cache.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7254 (and gnus-use-cache
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7255 (vectorp (gnus-summary-article-header article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7256 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7257 (gnus-cache-possibly-enter-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7258 gnus-newsgroup-name article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7259 (gnus-summary-article-header article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7260 (= mark gnus-ticked-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7261 (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7262
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7263 ;; Fix the mark.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7264 (gnus-summary-update-mark mark 'unread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7265 t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7266
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7267 (defun gnus-summary-mark-article (&optional article mark no-expire)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7268 "Mark ARTICLE with MARK. MARK can be any character.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7269 Four MARK strings are reserved: `? ' (unread), `?!' (ticked),
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7270 `??' (dormant) and `?E' (expirable).
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7271 If MARK is nil, then the default character `?D' is used.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7272 If ARTICLE is nil, then the article on the current line will be
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7273 marked."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7274 ;; The mark might be a string.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7275 (when (stringp mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7276 (setq mark (aref mark 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7277 ;; If no mark is given, then we check auto-expiring.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7278 (and (not no-expire)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7279 gnus-newsgroup-auto-expire
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7280 (or (not mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7281 (and (gnus-characterp mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7282 (or (= mark gnus-killed-mark) (= mark gnus-del-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7283 (= mark gnus-catchup-mark) (= mark gnus-low-score-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7284 (= mark gnus-read-mark) (= mark gnus-souped-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7285 (= mark gnus-duplicate-mark))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7286 (setq mark gnus-expirable-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7287 (let* ((mark (or mark gnus-del-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7288 (article (or article (gnus-summary-article-number))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7289 (unless article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7290 (error "No article on current line"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7291 (if (or (= mark gnus-unread-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7292 (= mark gnus-ticked-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7293 (= mark gnus-dormant-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7294 (gnus-mark-article-as-unread article mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7295 (gnus-mark-article-as-read article mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7296
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7297 ;; See whether the article is to be put in the cache.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7298 (and gnus-use-cache
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7299 (not (= mark gnus-canceled-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7300 (vectorp (gnus-summary-article-header article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7301 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7302 (gnus-cache-possibly-enter-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7303 gnus-newsgroup-name article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7304 (gnus-summary-article-header article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7305 (= mark gnus-ticked-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7306 (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7307
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7308 (when (gnus-summary-goto-subject article nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7309 (let ((buffer-read-only nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7310 (gnus-summary-show-thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7311 ;; Fix the mark.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7312 (gnus-summary-update-mark mark 'unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7313 t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7314
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7315 (defun gnus-summary-update-secondary-mark (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7316 "Update the secondary (read, process, cache) mark."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7317 (gnus-summary-update-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7318 (cond ((memq article gnus-newsgroup-processable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7319 gnus-process-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7320 ((memq article gnus-newsgroup-cached)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7321 gnus-cached-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7322 ((memq article gnus-newsgroup-replied)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7323 gnus-replied-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7324 ((memq article gnus-newsgroup-saved)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7325 gnus-saved-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7326 (t gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7327 'replied)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7328 (when (gnus-visual-p 'summary-highlight 'highlight)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7329 (run-hooks 'gnus-summary-update-hook))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7330 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7331
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7332 (defun gnus-summary-update-mark (mark type)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7333 (let ((forward (cdr (assq type gnus-summary-mark-positions)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7334 (buffer-read-only nil))
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
7335 (re-search-backward "[\n\r]" (gnus-point-at-bol) 'move-to-limit)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7336 (when (looking-at "\r")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7337 (incf forward))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7338 (when (and forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7339 (<= (+ forward (point)) (point-max)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7340 ;; Go to the right position on the line.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7341 (goto-char (+ forward (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7342 ;; Replace the old mark with the new mark.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7343 (subst-char-in-region (point) (1+ (point)) (following-char) mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7344 ;; Optionally update the marks by some user rule.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7345 (when (eq type 'unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7346 (gnus-data-set-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7347 (gnus-data-find (gnus-summary-article-number)) mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7348 (gnus-summary-update-line (eq mark gnus-unread-mark))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7349
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7350 (defun gnus-mark-article-as-read (article &optional mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7351 "Enter ARTICLE in the pertinent lists and remove it from others."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7352 ;; Make the article expirable.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7353 (let ((mark (or mark gnus-del-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7354 (if (= mark gnus-expirable-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7355 (push article gnus-newsgroup-expirable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7356 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7357 ;; Remove from unread and marked lists.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7358 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7359 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7360 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7361 (push (cons article mark) gnus-newsgroup-reads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7362 ;; Possibly remove from cache, if that is used.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7363 (when gnus-use-cache
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7364 (gnus-cache-enter-remove-article article))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7365
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7366 (defun gnus-mark-article-as-unread (article &optional mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7367 "Enter ARTICLE in the pertinent lists and remove it from others."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7368 (let ((mark (or mark gnus-ticked-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7369 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7370 gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7371 gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7372 gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7373
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7374 ;; Unsuppress duplicates?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7375 (when gnus-suppress-duplicates
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7376 (gnus-dup-unsuppress-article article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7377
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7378 (cond ((= mark gnus-ticked-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7379 (push article gnus-newsgroup-marked))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7380 ((= mark gnus-dormant-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7381 (push article gnus-newsgroup-dormant))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7382 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7383 (push article gnus-newsgroup-unreads)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7384 (setq gnus-newsgroup-reads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7385 (delq (assq article gnus-newsgroup-reads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7386 gnus-newsgroup-reads))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7387
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7388 (defalias 'gnus-summary-mark-as-unread-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7389 'gnus-summary-tick-article-forward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7390 (make-obsolete 'gnus-summary-mark-as-unread-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7391 'gnus-summary-tick-article-forward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7392 (defun gnus-summary-tick-article-forward (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7393 "Tick N articles forwards.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7394 If N is negative, tick backwards instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7395 The difference between N and the number of articles ticked is returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7396 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7397 (gnus-summary-mark-forward n gnus-ticked-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7398
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7399 (defalias 'gnus-summary-mark-as-unread-backward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7400 'gnus-summary-tick-article-backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7401 (make-obsolete 'gnus-summary-mark-as-unread-backward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7402 'gnus-summary-tick-article-backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7403 (defun gnus-summary-tick-article-backward (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7404 "Tick N articles backwards.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7405 The difference between N and the number of articles ticked is returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7406 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7407 (gnus-summary-mark-forward (- n) gnus-ticked-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7408
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7409 (defalias 'gnus-summary-mark-as-unread 'gnus-summary-tick-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7410 (make-obsolete 'gnus-summary-mark-as-unread 'gnus-summary-tick-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7411 (defun gnus-summary-tick-article (&optional article clear-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7412 "Mark current article as unread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7413 Optional 1st argument ARTICLE specifies article number to be marked as unread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7414 Optional 2nd argument CLEAR-MARK remove any kinds of mark."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7415 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7416 (gnus-summary-mark-article article (if clear-mark gnus-unread-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7417 gnus-ticked-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7418
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7419 (defun gnus-summary-mark-as-read-forward (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7420 "Mark N articles as read forwards.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7421 If N is negative, mark backwards instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7422 The difference between N and the actual number of articles marked is
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7423 returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7424 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7425 (gnus-summary-mark-forward n gnus-del-mark t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7426
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7427 (defun gnus-summary-mark-as-read-backward (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7428 "Mark the N articles as read backwards.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7429 The difference between N and the actual number of articles marked is
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7430 returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7431 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7432 (gnus-summary-mark-forward (- n) gnus-del-mark t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7433
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7434 (defun gnus-summary-mark-as-read (&optional article mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7435 "Mark current article as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7436 ARTICLE specifies the article to be marked as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7437 MARK specifies a string to be inserted at the beginning of the line."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7438 (gnus-summary-mark-article article mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7439
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7440 (defun gnus-summary-clear-mark-forward (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7441 "Clear marks from N articles forward.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7442 If N is negative, clear backward instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7443 The difference between N and the number of marks cleared is returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7444 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7445 (gnus-summary-mark-forward n gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7446
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7447 (defun gnus-summary-clear-mark-backward (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7448 "Clear marks from N articles backward.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7449 The difference between N and the number of marks cleared is returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7450 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7451 (gnus-summary-mark-forward (- n) gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7452
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7453 (defun gnus-summary-mark-unread-as-read ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7454 "Intended to be used by `gnus-summary-mark-article-hook'."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7455 (when (memq gnus-current-article gnus-newsgroup-unreads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7456 (gnus-summary-mark-article gnus-current-article gnus-read-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7457
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7458 (defun gnus-summary-mark-read-and-unread-as-read ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7459 "Intended to be used by `gnus-summary-mark-article-hook'."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7460 (let ((mark (gnus-summary-article-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7461 (when (or (gnus-unread-mark-p mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7462 (gnus-read-mark-p mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7463 (gnus-summary-mark-article gnus-current-article gnus-read-mark))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7464
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7465 (defun gnus-summary-mark-region-as-read (point mark all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7466 "Mark all unread articles between point and mark as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7467 If given a prefix, mark all articles between point and mark as read,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7468 even ticked and dormant ones."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7469 (interactive "r\nP")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7470 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7471 (let (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7472 (goto-char point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7473 (beginning-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7474 (while (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7475 (< (point) mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7476 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7477 (when (or all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7478 (memq (setq article (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7479 gnus-newsgroup-unreads))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7480 (gnus-summary-mark-article article gnus-del-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7481 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7482 (gnus-summary-find-next))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7483
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7484 (defun gnus-summary-mark-below (score mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7485 "Mark articles with score less than SCORE with MARK."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7486 (interactive "P\ncMark: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7487 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7488 (setq score (if score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7489 (prefix-numeric-value score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7490 (or gnus-summary-default-score 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7491 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7492 (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7493 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7494 (while
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7495 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7496 (and (< (gnus-summary-article-score) score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7497 (gnus-summary-mark-article nil mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7498 (gnus-summary-find-next)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7499
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7500 (defun gnus-summary-kill-below (&optional score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7501 "Mark articles with score below SCORE as read."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7502 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7503 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7504 (gnus-summary-mark-below score gnus-killed-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7505
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7506 (defun gnus-summary-clear-above (&optional score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7507 "Clear all marks from articles with score above SCORE."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7508 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7509 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7510 (gnus-summary-mark-above score gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7511
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7512 (defun gnus-summary-tick-above (&optional score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7513 "Tick all articles with score above SCORE."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7514 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7515 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7516 (gnus-summary-mark-above score gnus-ticked-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7517
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7518 (defun gnus-summary-mark-above (score mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7519 "Mark articles with score over SCORE with MARK."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7520 (interactive "P\ncMark: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7521 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7522 (setq score (if score
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7523 (prefix-numeric-value score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7524 (or gnus-summary-default-score 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7525 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7526 (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7527 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7528 (while (and (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7529 (when (> (gnus-summary-article-score) score)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7530 (gnus-summary-mark-article nil mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7531 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7532 (gnus-summary-find-next)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7533
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7534 ;; Suggested by Daniel Quinlan <quinlan@best.com>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7535 (defalias 'gnus-summary-show-all-expunged 'gnus-summary-limit-include-expunged)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7536 (defun gnus-summary-limit-include-expunged (&optional no-error)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7537 "Display all the hidden articles that were expunged for low scores."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7538 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7539 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7540 (let ((buffer-read-only nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7541 (let ((scored gnus-newsgroup-scored)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7542 headers h)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7543 (while scored
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7544 (unless (gnus-summary-goto-subject (caar scored))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7545 (and (setq h (gnus-summary-article-header (caar scored)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7546 (< (cdar scored) gnus-summary-expunge-below)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7547 (push h headers)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7548 (setq scored (cdr scored)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7549 (if (not headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7550 (when (not no-error)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7551 (error "No expunged articles hidden."))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7552 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7553 (gnus-summary-prepare-unthreaded (nreverse headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7554 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7555 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7556 t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7557
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7558 (defun gnus-summary-catchup (&optional all quietly to-here not-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7559 "Mark all unread articles in this newsgroup as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7560 If prefix argument ALL is non-nil, ticked and dormant articles will
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7561 also be marked as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7562 If QUIETLY is non-nil, no questions will be asked.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7563 If TO-HERE is non-nil, it should be a point in the buffer. All
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7564 articles before this point will be marked as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7565 Note that this function will only catch up the unread article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7566 in the current summary buffer limitation.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7567 The number of articles marked as read is returned."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7568 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7569 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7570 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7571 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7572 (when (or quietly
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7573 (not gnus-interactive-catchup) ;Without confirmation?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7574 gnus-expert-user
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7575 (gnus-y-or-n-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7576 (if all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7577 "Mark absolutely all articles as read? "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7578 "Mark all unread articles as read? ")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7579 (if (and not-mark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7580 (not gnus-newsgroup-adaptive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7581 (not gnus-newsgroup-auto-expire)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7582 (not gnus-suppress-duplicates))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7583 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7584 (when all
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7585 (setq gnus-newsgroup-marked nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7586 gnus-newsgroup-dormant nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7587 (setq gnus-newsgroup-unreads nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7588 ;; We actually mark all articles as canceled, which we
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7589 ;; have to do when using auto-expiry or adaptive scoring.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7590 (gnus-summary-show-all-threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7591 (when (gnus-summary-first-subject (not all))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7592 (while (and
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7593 (if to-here (< (point) to-here) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7594 (gnus-summary-mark-article-as-read gnus-catchup-mark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7595 (gnus-summary-find-next (not all)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7596 (gnus-set-mode-line 'summary))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7597 t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7598 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7599
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7600 (defun gnus-summary-catchup-to-here (&optional all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7601 "Mark all unticked articles before the current one as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7602 If ALL is non-nil, also mark ticked and dormant articles as read."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7603 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7604 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7605 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7606 (gnus-save-hidden-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7607 (let ((beg (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7608 ;; We check that there are unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7609 (when (or all (gnus-summary-find-prev))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7610 (gnus-summary-catchup all t beg)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7611 (gnus-summary-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7612
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7613 (defun gnus-summary-catchup-all (&optional quietly)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7614 "Mark all articles in this newsgroup as read."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7615 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7616 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7617 (gnus-summary-catchup t quietly))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7618
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7619 (defun gnus-summary-catchup-and-exit (&optional all quietly)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7620 "Mark all articles not marked as unread in this newsgroup as read, then exit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7621 If prefix argument ALL is non-nil, all articles are marked as read."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7622 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7623 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7624 (when (gnus-summary-catchup all quietly nil 'fast)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7625 ;; Select next newsgroup or exit.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7626 (if (eq gnus-auto-select-next 'quietly)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7627 (gnus-summary-next-group nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7628 (gnus-summary-exit))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7629
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7630 (defun gnus-summary-catchup-all-and-exit (&optional quietly)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7631 "Mark all articles in this newsgroup as read, and then exit."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7632 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7633 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7634 (gnus-summary-catchup-and-exit t quietly))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7635
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7636 ;; Suggested by "Arne Eofsson" <arne@hodgkin.mbi.ucla.edu>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7637 (defun gnus-summary-catchup-and-goto-next-group (&optional all)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7638 "Mark all articles in this group as read and select the next group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7639 If given a prefix, mark all articles, unread as well as ticked, as
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7640 read."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7641 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7642 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7643 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7644 (gnus-summary-catchup all))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7645 (gnus-summary-next-article t nil nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7646
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7647 ;; Thread-based commands.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7648
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7649 (defun gnus-summary-articles-in-thread (&optional article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7650 "Return a list of all articles in the current thread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7651 If ARTICLE is non-nil, return all articles in the thread that starts
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7652 with that article."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7653 (let* ((article (or article (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7654 (data (gnus-data-find-list article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7655 (top-level (gnus-data-level (car data)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7656 (top-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7657 (cond ((null gnus-thread-operation-ignore-subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7658 (gnus-simplify-subject-re
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7659 (mail-header-subject (gnus-data-header (car data)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7660 ((eq gnus-thread-operation-ignore-subject 'fuzzy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7661 (gnus-simplify-subject-fuzzy
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7662 (mail-header-subject (gnus-data-header (car data)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7663 (t nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7664 (end-point (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7665 (if (gnus-summary-go-to-next-thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7666 (point) (point-max))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7667 articles)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7668 (while (and data
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7669 (< (gnus-data-pos (car data)) end-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7670 (when (or (not top-subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7671 (string= top-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7672 (if (eq gnus-thread-operation-ignore-subject 'fuzzy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7673 (gnus-simplify-subject-fuzzy
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7674 (mail-header-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7675 (gnus-data-header (car data))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7676 (gnus-simplify-subject-re
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7677 (mail-header-subject
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7678 (gnus-data-header (car data)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7679 (push (gnus-data-number (car data)) articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7680 (unless (and (setq data (cdr data))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7681 (> (gnus-data-level (car data)) top-level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7682 (setq data nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7683 ;; Return the list of articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7684 (nreverse articles)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7685
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7686 (defun gnus-summary-rethread-current ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7687 "Rethread the thread the current article is part of."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7688 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7689 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7690 (let* ((gnus-show-threads t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7691 (article (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7692 (id (mail-header-id (gnus-summary-article-header)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7693 (gnus-newsgroup-threads (list (gnus-id-to-thread (gnus-root-id id)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7694 (unless id
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7695 (error "No article on the current line"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7696 (gnus-rebuild-thread id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7697 (gnus-summary-goto-subject article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7698
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7699 (defun gnus-summary-reparent-thread ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7700 "Make current article child of the marked (or previous) article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7701
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7702 Note that the re-threading will only work if `gnus-thread-ignore-subject'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7703 is non-nil or the Subject: of both articles are the same."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7704 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7705 (unless (not (gnus-group-read-only-p))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7706 (error "The current newsgroup does not support article editing."))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7707 (unless (<= (length gnus-newsgroup-processable) 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7708 (error "No more than one article may be marked."))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7709 (save-window-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7710 (let ((gnus-article-buffer " *reparent*")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7711 (current-article (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7712 ; first grab the marked article, otherwise one line up.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7713 (parent-article (if (not (null gnus-newsgroup-processable))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7714 (car gnus-newsgroup-processable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7715 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7716 (if (eq (forward-line -1) 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7717 (gnus-summary-article-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7718 (error "Beginning of summary buffer."))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7719 (unless (not (eq current-article parent-article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7720 (error "An article may not be self-referential."))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7721 (let ((message-id (mail-header-id
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7722 (gnus-summary-article-header parent-article))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7723 (unless (and message-id (not (equal message-id "")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7724 (error "No message-id in desired parent."))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7725 (gnus-summary-select-article t t nil current-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7726 (set-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7727 (setq buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7728 (let ((buf (format "%s" (buffer-string))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7729 (erase-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7730 (insert buf))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7731 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7732 (if (search-forward-regexp "^References: " nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7733 (insert message-id " " )
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7734 (insert "References: " message-id "\n"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7735 (unless (gnus-request-replace-article current-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7736 (car gnus-article-current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7737 gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7738 (error "Couldn't replace article."))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7739 (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7740 (gnus-summary-unmark-all-processable)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7741 (gnus-summary-rethread-current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7742 (gnus-message 3 "Article %d is now the child of article %d."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7743 current-article parent-article)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7744
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7745 (defun gnus-summary-toggle-threads (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7746 "Toggle showing conversation threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7747 If ARG is positive number, turn showing conversation threads on."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7748 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7749 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7750 (let ((current (or (gnus-summary-article-number) gnus-newsgroup-end)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7751 (setq gnus-show-threads
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7752 (if (null arg) (not gnus-show-threads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7753 (> (prefix-numeric-value arg) 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7754 (gnus-summary-prepare)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7755 (gnus-summary-goto-subject current)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7756 (gnus-message 6 "Threading is now %s" (if gnus-show-threads "on" "off"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7757 (gnus-summary-position-point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7758
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7759 (defun gnus-summary-show-all-threads ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7760 "Show all threads."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7761 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7762 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7763 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7764 (let ((buffer-read-only nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7765 (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7766 (gnus-summary-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7767
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7768 (defun gnus-summary-show-thread ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7769 "Show thread subtrees.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7770 Returns nil if no thread was there to be shown."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7771 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7772 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7773 (let ((buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7774 (orig (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7775 ;; first goto end then to beg, to have point at beg after let
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7776 (end (progn (end-of-line) (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7777 (beg (progn (beginning-of-line) (point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7778 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7779 ;; Any hidden lines here?
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7780 (search-forward "\r" end t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7781 (subst-char-in-region beg end ?\^M ?\n t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7782 (goto-char orig)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7783 (gnus-summary-position-point))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7784
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7785 (defun gnus-summary-hide-all-threads ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7786 "Hide all thread subtrees."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7787 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7788 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7789 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7790 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7791 (gnus-summary-hide-thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7792 (while (zerop (gnus-summary-next-thread 1 t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7793 (gnus-summary-hide-thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7794 (gnus-summary-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7795
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7796 (defun gnus-summary-hide-thread ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7797 "Hide thread subtrees.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7798 Returns nil if no threads were there to be hidden."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7799 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7800 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7801 (let ((buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7802 (start (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7803 (article (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7804 (goto-char start)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7805 ;; Go forward until either the buffer ends or the subthread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7806 ;; ends.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7807 (when (and (not (eobp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7808 (or (zerop (gnus-summary-next-thread 1 t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7809 (goto-char (point-max))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7810 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7811 (if (and (> (point) start)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7812 (search-backward "\n" start t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7813 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7814 (subst-char-in-region start (point) ?\n ?\^M)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7815 (gnus-summary-goto-subject article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7816 (goto-char start)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7817 nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7818 ;;(gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7819 ))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7820
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7821 (defun gnus-summary-go-to-next-thread (&optional previous)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7822 "Go to the same level (or less) next thread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7823 If PREVIOUS is non-nil, go to previous thread instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7824 Return the article number moved to, or nil if moving was impossible."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7825 (let ((level (gnus-summary-thread-level))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7826 (way (if previous -1 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7827 (beg (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7828 (forward-line way)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7829 (while (and (not (eobp))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7830 (< level (gnus-summary-thread-level)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7831 (forward-line way))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7832 (if (eobp)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7833 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7834 (goto-char beg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7835 nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7836 (setq beg (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7837 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7838 (gnus-summary-article-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7839 (goto-char beg)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7840
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7841 (defun gnus-summary-next-thread (n &optional silent)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7842 "Go to the same level next N'th thread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7843 If N is negative, search backward instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7844 Returns the difference between N and the number of skips actually
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7845 done.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7846
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7847 If SILENT, don't output messages."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7848 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7849 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7850 (let ((backward (< n 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7851 (n (abs n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7852 (while (and (> n 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7853 (gnus-summary-go-to-next-thread backward))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7854 (decf n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7855 (unless silent
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7856 (gnus-summary-position-point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7857 (when (and (not silent) (/= 0 n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7858 (gnus-message 7 "No more threads"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7859 n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7860
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7861 (defun gnus-summary-prev-thread (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7862 "Go to the same level previous N'th thread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7863 Returns the difference between N and the number of skips actually
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7864 done."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7865 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7866 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7867 (gnus-summary-next-thread (- n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7868
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7869 (defun gnus-summary-go-down-thread ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7870 "Go down one level in the current thread."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7871 (let ((children (gnus-summary-article-children)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7872 (when children
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7873 (gnus-summary-goto-subject (car children)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7874
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7875 (defun gnus-summary-go-up-thread ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7876 "Go up one level in the current thread."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7877 (let ((parent (gnus-summary-article-parent)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7878 (when parent
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7879 (gnus-summary-goto-subject parent))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7880
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7881 (defun gnus-summary-down-thread (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7882 "Go down thread N steps.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7883 If N is negative, go up instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7884 Returns the difference between N and how many steps down that were
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7885 taken."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7886 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7887 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7888 (let ((up (< n 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7889 (n (abs n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7890 (while (and (> n 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7891 (if up (gnus-summary-go-up-thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7892 (gnus-summary-go-down-thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7893 (setq n (1- n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7894 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7895 (when (/= 0 n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7896 (gnus-message 7 "Can't go further"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7897 n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7898
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7899 (defun gnus-summary-up-thread (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7900 "Go up thread N steps.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7901 If N is negative, go up instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7902 Returns the difference between N and how many steps down that were
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7903 taken."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7904 (interactive "p")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7905 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7906 (gnus-summary-down-thread (- n)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7907
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7908 (defun gnus-summary-top-thread ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7909 "Go to the top of the thread."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7910 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7911 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7912 (while (gnus-summary-go-up-thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7913 (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7914
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7915 (defun gnus-summary-kill-thread (&optional unmark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7916 "Mark articles under current thread as read.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7917 If the prefix argument is positive, remove any kinds of marks.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7918 If the prefix argument is negative, tick articles instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7919 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7920 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7921 (when unmark
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7922 (setq unmark (prefix-numeric-value unmark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7923 (let ((articles (gnus-summary-articles-in-thread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7924 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7925 ;; Expand the thread.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7926 (gnus-summary-show-thread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7927 ;; Mark all the articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7928 (while articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7929 (gnus-summary-goto-subject (car articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7930 (cond ((null unmark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7931 (gnus-summary-mark-article-as-read gnus-killed-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7932 ((> unmark 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7933 (gnus-summary-mark-article-as-unread gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7934 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7935 (gnus-summary-mark-article-as-unread gnus-ticked-mark)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7936 (setq articles (cdr articles))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7937 ;; Hide killed subtrees.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7938 (and (null unmark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7939 gnus-thread-hide-killed
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7940 (gnus-summary-hide-thread))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7941 ;; If marked as read, go to next unread subject.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7942 (when (null unmark)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7943 ;; Go to next unread subject.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7944 (gnus-summary-next-subject 1 t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7945 (gnus-set-mode-line 'summary))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7946
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7947 ;; Summary sorting commands
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7948
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7949 (defun gnus-summary-sort-by-number (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7950 "Sort the summary buffer by article number.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7951 Argument REVERSE means reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7952 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7953 (gnus-summary-sort 'number reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7954
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7955 (defun gnus-summary-sort-by-author (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7956 "Sort the summary buffer by author name alphabetically.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7957 If case-fold-search is non-nil, case of letters is ignored.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7958 Argument REVERSE means reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7959 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7960 (gnus-summary-sort 'author reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7961
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7962 (defun gnus-summary-sort-by-subject (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7963 "Sort the summary buffer by subject alphabetically. `Re:'s are ignored.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7964 If case-fold-search is non-nil, case of letters is ignored.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7965 Argument REVERSE means reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7966 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7967 (gnus-summary-sort 'subject reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7968
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7969 (defun gnus-summary-sort-by-date (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7970 "Sort the summary buffer by date.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7971 Argument REVERSE means reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7972 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7973 (gnus-summary-sort 'date reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7974
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7975 (defun gnus-summary-sort-by-score (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7976 "Sort the summary buffer by score.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7977 Argument REVERSE means reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7978 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7979 (gnus-summary-sort 'score reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7980
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7981 (defun gnus-summary-sort-by-lines (&optional reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7982 "Sort the summary buffer by article length.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7983 Argument REVERSE means reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7984 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7985 (gnus-summary-sort 'lines reverse))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7986
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7987 (defun gnus-summary-sort (predicate reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7988 "Sort summary buffer by PREDICATE. REVERSE means reverse order."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7989 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7990 (let* ((thread (intern (format "gnus-thread-sort-by-%s" predicate)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7991 (article (intern (format "gnus-article-sort-by-%s" predicate)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7992 (gnus-thread-sort-functions
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7993 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7994 (if (not reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7995 thread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7996 `(lambda (t1 t2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7997 (,thread t2 t1)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7998 (gnus-article-sort-functions
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
7999 (list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8000 (if (not reverse)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8001 article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8002 `(lambda (t1 t2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8003 (,article t2 t1)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8004 (buffer-read-only)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8005 (gnus-summary-prepare-hook nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8006 ;; We do the sorting by regenerating the threads.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8007 (gnus-summary-prepare)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8008 ;; Hide subthreads if needed.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8009 (when (and gnus-show-threads gnus-thread-hide-subtree)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8010 (gnus-summary-hide-all-threads))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8011
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8012 ;; Summary saving commands.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8013
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8014 (defun gnus-summary-save-article (&optional n not-saved)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8015 "Save the current article using the default saver function.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8016 If N is a positive number, save the N next articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8017 If N is a negative number, save the N previous articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8018 If N is nil and any articles have been marked with the process mark,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8019 save those articles instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8020 The variable `gnus-default-article-saver' specifies the saver function."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8021 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8022 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8023 (let* ((articles (gnus-summary-work-articles n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8024 (save-buffer (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8025 (nnheader-set-temp-buffer " *Gnus Save*")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8026 (num (length articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8027 header article file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8028 (while articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8029 (setq header (gnus-summary-article-header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8030 (setq article (pop articles))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8031 (if (not (vectorp header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8032 ;; This is a pseudo-article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8033 (if (assq 'name header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8034 (gnus-copy-file (cdr (assq 'name header)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8035 (gnus-message 1 "Article %d is unsaveable" article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8036 ;; This is a real article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8037 (save-window-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8038 (gnus-summary-select-article t nil nil article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8039 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8040 (set-buffer save-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8041 (erase-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8042 (insert-buffer-substring gnus-original-article-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8043 (setq file (gnus-article-save save-buffer file num))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8044 (gnus-summary-remove-process-mark article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8045 (unless not-saved
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8046 (gnus-summary-set-saved-mark article))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8047 (gnus-kill-buffer save-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8048 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8049 (gnus-set-mode-line 'summary)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8050 n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8051
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8052 (defun gnus-summary-pipe-output (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8053 "Pipe the current article to a subprocess.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8054 If N is a positive number, pipe the N next articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8055 If N is a negative number, pipe the N previous articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8056 If N is nil and any articles have been marked with the process mark,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8057 pipe those articles instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8058 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8059 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8060 (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8061 (gnus-summary-save-article arg t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8062 (gnus-configure-windows 'pipe))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8063
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8064 (defun gnus-summary-save-article-mail (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8065 "Append the current article to an mail file.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8066 If N is a positive number, save the N next articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8067 If N is a negative number, save the N previous articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8068 If N is nil and any articles have been marked with the process mark,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8069 save those articles instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8070 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8071 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8072 (let ((gnus-default-article-saver 'gnus-summary-save-in-mail))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8073 (gnus-summary-save-article arg)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8074
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8075 (defun gnus-summary-save-article-rmail (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8076 "Append the current article to an rmail file.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8077 If N is a positive number, save the N next articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8078 If N is a negative number, save the N previous articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8079 If N is nil and any articles have been marked with the process mark,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8080 save those articles instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8081 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8082 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8083 (let ((gnus-default-article-saver 'gnus-summary-save-in-rmail))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8084 (gnus-summary-save-article arg)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8085
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8086 (defun gnus-summary-save-article-file (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8087 "Append the current article to a file.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8088 If N is a positive number, save the N next articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8089 If N is a negative number, save the N previous articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8090 If N is nil and any articles have been marked with the process mark,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8091 save those articles instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8092 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8093 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8094 (let ((gnus-default-article-saver 'gnus-summary-save-in-file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8095 (gnus-summary-save-article arg)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8096
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8097 (defun gnus-summary-write-article-file (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8098 "Write the current article to a file, deleting the previous file.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8099 If N is a positive number, save the N next articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8100 If N is a negative number, save the N previous articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8101 If N is nil and any articles have been marked with the process mark,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8102 save those articles instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8103 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8104 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8105 (let ((gnus-default-article-saver 'gnus-summary-write-to-file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8106 (gnus-summary-save-article arg)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8107
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8108 (defun gnus-summary-save-article-body-file (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8109 "Append the current article body to a file.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8110 If N is a positive number, save the N next articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8111 If N is a negative number, save the N previous articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8112 If N is nil and any articles have been marked with the process mark,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8113 save those articles instead."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8114 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8115 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8116 (let ((gnus-default-article-saver 'gnus-summary-save-body-in-file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8117 (gnus-summary-save-article arg)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8118
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8119 (defun gnus-summary-pipe-message (program)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8120 "Pipe the current article through PROGRAM."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8121 (interactive "sProgram: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8122 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8123 (gnus-summary-select-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8124 (let ((mail-header-separator "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8125 (art-buf (get-buffer gnus-article-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8126 (gnus-eval-in-buffer-window gnus-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8127 (save-restriction
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8128 (widen)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8129 (let ((start (window-start))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8130 buffer-read-only)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8131 (message-pipe-buffer-body program)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8132 (set-window-start (get-buffer-window (current-buffer)) start))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8133
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8134 (defun gnus-get-split-value (methods)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8135 "Return a value based on the split METHODS."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8136 (let (split-name method result match)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8137 (when methods
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8138 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8139 (set-buffer gnus-original-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8140 (save-restriction
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8141 (nnheader-narrow-to-headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8142 (while methods
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8143 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8144 (setq method (pop methods))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8145 (setq match (car method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8146 (when (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8147 ((stringp match)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8148 ;; Regular expression.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8149 (ignore-errors
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8150 (re-search-forward match nil t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8151 ((gnus-functionp match)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8152 ;; Function.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8153 (save-restriction
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8154 (widen)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8155 (setq result (funcall match gnus-newsgroup-name))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8156 ((consp match)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8157 ;; Form.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8158 (save-restriction
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8159 (widen)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8160 (setq result (eval match)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8161 (setq split-name (append (cdr method) split-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8162 (cond ((stringp result)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8163 (push (expand-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8164 result gnus-article-save-directory)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8165 split-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8166 ((consp result)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8167 (setq split-name (append result split-name)))))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8168 split-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8169
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8170 (defun gnus-valid-move-group-p (group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8171 (and (boundp group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8172 (symbol-name group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8173 (memq 'respool
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8174 (assoc (symbol-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8175 (car (gnus-find-method-for-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8176 (symbol-name group))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8177 gnus-valid-select-methods))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8178
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8179 (defun gnus-read-move-group-name (prompt default articles prefix)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8180 "Read a group name."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8181 (let* ((split-name (gnus-get-split-value gnus-move-split-methods))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8182 (minibuffer-confirm-incomplete nil) ; XEmacs
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8183 (prom
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8184 (format "%s %s to:"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8185 prompt
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8186 (if (> (length articles) 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8187 (format "these %d articles" (length articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8188 "this article")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8189 (to-newsgroup
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8190 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8191 ((null split-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8192 (gnus-completing-read default prom
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8193 gnus-active-hashtb
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8194 'gnus-valid-move-group-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8195 nil prefix
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8196 'gnus-group-history))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8197 ((= 1 (length split-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8198 (gnus-completing-read (car split-name) prom
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8199 gnus-active-hashtb
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8200 'gnus-valid-move-group-p
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8201 nil nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8202 'gnus-group-history))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8203 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8204 (gnus-completing-read nil prom
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8205 (mapcar (lambda (el) (list el))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8206 (nreverse split-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8207 nil nil nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8208 'gnus-group-history)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8209 (when to-newsgroup
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8210 (if (or (string= to-newsgroup "")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8211 (string= to-newsgroup prefix))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8212 (setq to-newsgroup (or default "")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8213 (or (gnus-active to-newsgroup)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8214 (gnus-activate-group to-newsgroup)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8215 (if (gnus-y-or-n-p (format "No such group: %s. Create it? "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8216 to-newsgroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8217 (or (and (gnus-request-create-group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8218 to-newsgroup (gnus-group-name-to-method to-newsgroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8219 (gnus-activate-group to-newsgroup nil nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8220 (gnus-group-name-to-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8221 to-newsgroup)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8222 (error "Couldn't create group %s" to-newsgroup)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8223 (error "No such group: %s" to-newsgroup)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8224 to-newsgroup))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8225
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8226 ;; Summary extract commands
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8227
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8228 (defun gnus-summary-insert-pseudos (pslist &optional not-view)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8229 (let ((buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8230 (article (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8231 after-article b e)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8232 (unless (gnus-summary-goto-subject article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8233 (error "No such article: %d" article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8234 (gnus-summary-position-point)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8235 ;; If all commands are to be bunched up on one line, we collect
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8236 ;; them here.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8237 (unless gnus-view-pseudos-separately
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8238 (let ((ps (setq pslist (sort pslist 'gnus-pseudos<)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8239 files action)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8240 (while ps
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8241 (setq action (cdr (assq 'action (car ps))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8242 (setq files (list (cdr (assq 'name (car ps)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8243 (while (and ps (cdr ps)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8244 (string= (or action "1")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8245 (or (cdr (assq 'action (cadr ps))) "2")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8246 (push (cdr (assq 'name (cadr ps))) files)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8247 (setcdr ps (cddr ps)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8248 (when files
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8249 (when (not (string-match "%s" action))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8250 (push " " files))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8251 (push " " files)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8252 (when (assq 'execute (car ps))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8253 (setcdr (assq 'execute (car ps))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8254 (funcall (if (string-match "%s" action)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8255 'format 'concat)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8256 action
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8257 (mapconcat (lambda (f) f) files " ")))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8258 (setq ps (cdr ps)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8259 (if (and gnus-view-pseudos (not not-view))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8260 (while pslist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8261 (when (assq 'execute (car pslist))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8262 (gnus-execute-command (cdr (assq 'execute (car pslist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8263 (eq gnus-view-pseudos 'not-confirm)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8264 (setq pslist (cdr pslist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8265 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8266 (while pslist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8267 (setq after-article (or (cdr (assq 'article (car pslist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8268 (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8269 (gnus-summary-goto-subject after-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8270 (forward-line 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8271 (setq b (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8272 (insert " " (file-name-nondirectory
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8273 (cdr (assq 'name (car pslist))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8274 ": " (or (cdr (assq 'execute (car pslist))) "") "\n")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8275 (setq e (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8276 (forward-line -1) ; back to `b'
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8277 (gnus-add-text-properties
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8278 b (1- e) (list 'gnus-number gnus-reffed-article-number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8279 gnus-mouse-face-prop gnus-mouse-face))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8280 (gnus-data-enter
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8281 after-article gnus-reffed-article-number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8282 gnus-unread-mark b (car pslist) 0 (- e b))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8283 (push gnus-reffed-article-number gnus-newsgroup-unreads)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8284 (setq gnus-reffed-article-number (1- gnus-reffed-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8285 (setq pslist (cdr pslist)))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8286
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8287 (defun gnus-pseudos< (p1 p2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8288 (let ((c1 (cdr (assq 'action p1)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8289 (c2 (cdr (assq 'action p2))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8290 (and c1 c2 (string< c1 c2))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8291
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8292 (defun gnus-request-pseudo-article (props)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8293 (cond ((assq 'execute props)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8294 (gnus-execute-command (cdr (assq 'execute props)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8295 (let ((gnus-current-article (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8296 (run-hooks 'gnus-mark-article-hook)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8297
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8298 (defun gnus-execute-command (command &optional automatic)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8299 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8300 (gnus-article-setup-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8301 (set-buffer gnus-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8302 (setq buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8303 (let ((command (if automatic command (read-string "Command: " command)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8304 ;; Just binding this here doesn't help, because there might
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8305 ;; be output from the process after exiting the scope of
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8306 ;; this `let'.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8307 ;; (buffer-read-only nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8308 )
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8309 (erase-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8310 (insert "$ " command "\n\n")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8311 (if gnus-view-pseudo-asynchronously
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8312 (start-process "gnus-execute" nil shell-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8313 shell-command-switch command)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8314 (call-process shell-file-name nil t nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8315 shell-command-switch command)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8316
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8317 ;; Summary kill commands.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8318
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8319 (defun gnus-summary-edit-global-kill (article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8320 "Edit the \"global\" kill file."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8321 (interactive (list (gnus-summary-article-number)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8322 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8323 (gnus-group-edit-global-kill article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8324
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8325 (defun gnus-summary-edit-local-kill ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8326 "Edit a local kill file applied to the current newsgroup."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8327 (interactive)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8328 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8329 (setq gnus-current-headers (gnus-summary-article-header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8330 (gnus-set-global-variables)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8331 (gnus-group-edit-local-kill
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8332 (gnus-summary-article-number) gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8333
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8334 ;;; Header reading.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8335
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8336 (defun gnus-read-header (id &optional header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8337 "Read the headers of article ID and enter them into the Gnus system."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8338 (let ((group gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8339 (gnus-override-method
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8340 (and (gnus-news-group-p gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8341 gnus-refer-article-method))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8342 where)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8343 ;; First we check to see whether the header in question is already
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8344 ;; fetched.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8345 (if (stringp id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8346 ;; This is a Message-ID.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8347 (setq header (or header (gnus-id-to-header id)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8348 ;; This is an article number.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8349 (setq header (or header (gnus-summary-article-header id))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8350 (if (and header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8351 (not (gnus-summary-article-sparse-p (mail-header-number header))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8352 ;; We have found the header.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8353 header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8354 ;; We have to really fetch the header to this article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8355 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8356 (set-buffer nntp-server-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8357 (when (setq where (gnus-request-head id group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8358 (nnheader-fold-continuation-lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8359 (goto-char (point-max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8360 (insert ".\n")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8361 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8362 (insert "211 ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8363 (princ (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8364 ((numberp id) id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8365 ((cdr where) (cdr where))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8366 (header (mail-header-number header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8367 (t gnus-reffed-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8368 (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8369 (insert " Article retrieved.\n"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8370 (if (not (setq header (car (gnus-get-newsgroup-headers nil t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8371 () ; Malformed head.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8372 (unless (gnus-summary-article-sparse-p (mail-header-number header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8373 (when (and (stringp id)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8374 (not (string= (gnus-group-real-name group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8375 (car where))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8376 ;; If we fetched by Message-ID and the article came
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8377 ;; from a different group, we fudge some bogus article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8378 ;; numbers for this article.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8379 (mail-header-set-number header gnus-reffed-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8380 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8381 (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8382 (decf gnus-reffed-article-number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8383 (gnus-remove-header (mail-header-number header))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8384 (push header gnus-newsgroup-headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8385 (setq gnus-current-headers header)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8386 (push (mail-header-number header) gnus-newsgroup-limit)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8387 header)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8388
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8389 (defun gnus-remove-header (number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8390 "Remove header NUMBER from `gnus-newsgroup-headers'."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8391 (if (and gnus-newsgroup-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8392 (= number (mail-header-number (car gnus-newsgroup-headers))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8393 (pop gnus-newsgroup-headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8394 (let ((headers gnus-newsgroup-headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8395 (while (and (cdr headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8396 (not (= number (mail-header-number (cadr headers)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8397 (pop headers))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8398 (when (cdr headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8399 (setcdr headers (cddr headers))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8400
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8401 ;;;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8402 ;;; summary highlights
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8403 ;;;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8404
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8405 (defun gnus-highlight-selected-summary ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8406 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8407 ;; Highlight selected article in summary buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8408 (when gnus-summary-selected-face
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8409 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8410 (let* ((beg (progn (beginning-of-line) (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8411 (end (progn (end-of-line) (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8412 ;; Fix by Mike Dugan <dugan@bucrf16.bu.edu>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8413 (from (if (get-text-property beg gnus-mouse-face-prop)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8414 beg
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8415 (or (next-single-property-change
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8416 beg gnus-mouse-face-prop nil end)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8417 beg)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8418 (to
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8419 (if (= from end)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8420 (- from 2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8421 (or (next-single-property-change
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8422 from gnus-mouse-face-prop nil end)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8423 end))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8424 ;; If no mouse-face prop on line we will have to = from = end,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8425 ;; so we highlight the entire line instead.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8426 (when (= (+ to 2) from)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8427 (setq from beg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8428 (setq to end))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8429 (if gnus-newsgroup-selected-overlay
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8430 ;; Move old overlay.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8431 (gnus-move-overlay
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8432 gnus-newsgroup-selected-overlay from to (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8433 ;; Create new overlay.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8434 (gnus-overlay-put
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8435 (setq gnus-newsgroup-selected-overlay (gnus-make-overlay from to))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8436 'face gnus-summary-selected-face))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8437
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8438 ;; New implementation by Christian Limpach <Christian.Limpach@nice.ch>.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8439 (defun gnus-summary-highlight-line ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8440 "Highlight current line according to `gnus-summary-highlight'."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8441 (let* ((list gnus-summary-highlight)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8442 (p (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8443 (end (progn (end-of-line) (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8444 ;; now find out where the line starts and leave point there.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8445 (beg (progn (beginning-of-line) (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8446 (article (gnus-summary-article-number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8447 (score (or (cdr (assq (or article gnus-current-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8448 gnus-newsgroup-scored))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8449 gnus-summary-default-score 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8450 (mark (or (gnus-summary-article-mark) gnus-unread-mark))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8451 (inhibit-read-only t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8452 ;; Eval the cars of the lists until we find a match.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8453 (let ((default gnus-summary-default-score))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8454 (while (and list
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8455 (not (eval (caar list))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8456 (setq list (cdr list))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8457 (let ((face (cdar list)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8458 (unless (eq face (get-text-property beg 'face))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8459 (gnus-put-text-property
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8460 beg end 'face
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8461 (setq face (if (boundp face) (symbol-value face) face)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8462 (when gnus-summary-highlight-line-function
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8463 (funcall gnus-summary-highlight-line-function article face))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8464 (goto-char p)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8465
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8466 (defun gnus-update-read-articles (group unread)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8467 "Update the list of read articles in GROUP."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8468 (let* ((active (or gnus-newsgroup-active (gnus-active group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8469 (entry (gnus-gethash group gnus-newsrc-hashtb))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8470 (info (nth 2 entry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8471 (prev 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8472 (unread (sort (copy-sequence unread) '<))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8473 read)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8474 (if (or (not info) (not active))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8475 ;; There is no info on this group if it was, in fact,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8476 ;; killed. Gnus stores no information on killed groups, so
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8477 ;; there's nothing to be done.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8478 ;; One could store the information somewhere temporarily,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8479 ;; perhaps... Hmmm...
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8480 ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8481 ;; Remove any negative articles numbers.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8482 (while (and unread (< (car unread) 0))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8483 (setq unread (cdr unread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8484 ;; Remove any expired article numbers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8485 (while (and unread (< (car unread) (car active)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8486 (setq unread (cdr unread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8487 ;; Compute the ranges of read articles by looking at the list of
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8488 ;; unread articles.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8489 (while unread
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8490 (when (/= (car unread) prev)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8491 (push (if (= prev (1- (car unread))) prev
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8492 (cons prev (1- (car unread))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8493 read))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8494 (setq prev (1+ (car unread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8495 (setq unread (cdr unread)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8496 (when (<= prev (cdr active))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8497 (push (cons prev (cdr active)) read))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8498 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8499 (set-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8500 (gnus-undo-register
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8501 `(progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8502 (gnus-info-set-marks ',info ',(gnus-info-marks info) t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8503 (gnus-info-set-read ',info ',(gnus-info-read info))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8504 (gnus-get-unread-articles-in-group ',info (gnus-active ,group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8505 (gnus-group-update-group ,group t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8506 ;; Enter this list into the group info.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8507 (gnus-info-set-read
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8508 info (if (> (length read) 1) (nreverse read) read))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8509 ;; Set the number of unread articles in gnus-newsrc-hashtb.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8510 (gnus-get-unread-articles-in-group info (gnus-active group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8511 t)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8512
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8513 (provide 'gnus-sum)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8514
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8515 (run-hooks 'gnus-sum-load-hook)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8516
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents:
diff changeset
8517 ;;; gnus-sum.el ends here